CodeQL / Analyze (actions) (push) Canceled after 0s
CodeQL / Analyze (python) (push) Canceled after 0s
pre-commit / pre-commit (push) Canceled after 0s
Multi-Arch CI / setup (push) Canceled after 0s
Publish build_manylinux_x86_64 images / publish_build_manylinux_x86_64 (push) Canceled after 0s
Setup (Multi-Arch) / setup (push) Canceled after 0s
Multi-Arch CI / Linux::${{ fromJSON(needs.setup.outputs.linux_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubi10 image / publish_no_rocm_image_ubi10 (push) Canceled after 0s
Multi-Arch CI / Windows::${{ fromJSON(needs.setup.outputs.windows_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Multi-Arch CI / Manifest Diff (push) Canceled after 0s
TheRock Manifest Diff Report / Generate Manifest Diff Report (push) Canceled after 0s
Multi-Arch CI / CI Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_ocl_rt images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_rocgdb images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Unit Tests / Unit Tests :: ubuntu-24.04 (push) Canceled after 0s
Unit Tests / Unit Tests :: windows-2022 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_media (push) Canceled after 0s
Unit Tests / Unit Tests Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_openmpi (push) Canceled after 0s
103 lines
2.3 KiB
LLVM
103 lines
2.3 KiB
LLVM
; RUN: opt -passes=inline -S < %s | FileCheck %s
|
|
|
|
declare ptr @get()
|
|
declare ptr @foo1()
|
|
declare ptr @foo2()
|
|
|
|
; Don't need to track inline history for non-mutually recursive calls.
|
|
|
|
define internal void @x() noinline {
|
|
ret void
|
|
}
|
|
|
|
define internal void @y() {
|
|
call void @x()
|
|
ret void
|
|
}
|
|
|
|
define void @z() {
|
|
; CHECK-LABEL: define void @z() {
|
|
; CHECK-NEXT: call void @x(){{$}}
|
|
; CHECK-NEXT: ret void
|
|
call void @y()
|
|
ret void
|
|
}
|
|
|
|
; Indirect calls may be devirtualized, they need inline history tracking. In
|
|
; this case, @s is the history, but it gets deleted so the inline history
|
|
; metadata becomes null. This is fine since we cannot infinitely inline through
|
|
; @s anymore as it doesn't exist.
|
|
|
|
define internal void @s() {
|
|
%p = call ptr @get()
|
|
call void %p()
|
|
ret void
|
|
}
|
|
|
|
define void @t() {
|
|
; CHECK-LABEL: define void @t() {
|
|
; CHECK-NEXT: %p.i = call ptr @get()
|
|
; CHECK-NEXT: call void %p.i(), !inline_history [[HISTORY_T:![0-9]+]]
|
|
; CHECK-NEXT: ret void
|
|
call void @s()
|
|
ret void
|
|
}
|
|
|
|
; This will inline @f1 into @a, causing two new calls to @f2, which will get inlined for two calls to @f1.
|
|
; The inline history should stop recursive inlining here.
|
|
|
|
define internal void @f1(ptr %p) {
|
|
call void %p(ptr @f1)
|
|
ret void
|
|
}
|
|
|
|
define internal void @f2(ptr %p) {
|
|
call void %p(ptr @f2)
|
|
call void %p(ptr @f2)
|
|
ret void
|
|
}
|
|
|
|
define void @b() {
|
|
; CHECK-LABEL: define void @b() {
|
|
; CHECK-NEXT: call void @f1(ptr @f2), !inline_history [[HISTORY_B:![0-9]+]]
|
|
; CHECK-NEXT: call void @f1(ptr @f2), !inline_history [[HISTORY_B:![0-9]+]]
|
|
; CHECK-NEXT: ret void
|
|
;
|
|
call void @a()
|
|
ret void
|
|
}
|
|
|
|
define internal void @a() {
|
|
call void @f1(ptr @f2)
|
|
ret void
|
|
}
|
|
|
|
; Check that the inline history is
|
|
; {callee, processed call's inline_history, just-inlined call's inline_history}
|
|
|
|
define void @m(ptr %p) noinline {
|
|
ret void
|
|
}
|
|
|
|
define void @n() {
|
|
call void @m(ptr @n2), !inline_history !{ptr @foo1}
|
|
ret void
|
|
}
|
|
|
|
define void @n2() {
|
|
call void @m(ptr @n)
|
|
ret void
|
|
}
|
|
|
|
define void @o() {
|
|
; CHECK-LABEL: define void @o() {
|
|
; CHECK-NEXT: call void @m(ptr @n2), !inline_history [[HISTORY_O:![0-9]+]]
|
|
; CHECK-NEXT: ret void
|
|
call void @n(), !inline_history !{ptr @foo2}
|
|
ret void
|
|
}
|
|
|
|
; CHECK-DAG: [[HISTORY_T]] = distinct !{null}
|
|
; CHECK-DAG: [[HISTORY_B]] = !{ptr @f2, ptr @f1}
|
|
; CHECK-DAG: [[HISTORY_O]] = !{ptr @n, ptr @foo2, ptr @foo1}
|