diff options
| author | Matt Arsenault <Matthew.Arsenault@amd.com> | 2017-09-21 07:00:48 +0000 |
|---|---|---|
| committer | Matt Arsenault <Matthew.Arsenault@amd.com> | 2017-09-21 07:00:48 +0000 |
| commit | 1390af2dd2a0950cb0a7374602985a4d0792a63b (patch) | |
| tree | 674889f5cb7b93080b5fb9fda595bb84bb5b2e2e /llvm/test/CodeGen | |
| parent | 6810367610ac9a706ee544c220b49c15edea88fd (diff) | |
| download | bcm5719-llvm-1390af2dd2a0950cb0a7374602985a4d0792a63b.tar.gz bcm5719-llvm-1390af2dd2a0950cb0a7374602985a4d0792a63b.zip | |
AMDGPU: Add option to stress calls
This inverts the behavior of the AlwaysInline pass to mark
every function not already marked alwaysinline as noinline.
llvm-svn: 313865
Diffstat (limited to 'llvm/test/CodeGen')
| -rw-r--r-- | llvm/test/CodeGen/AMDGPU/stress-calls.ll | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/llvm/test/CodeGen/AMDGPU/stress-calls.ll b/llvm/test/CodeGen/AMDGPU/stress-calls.ll new file mode 100644 index 00000000000..480d40d67d4 --- /dev/null +++ b/llvm/test/CodeGen/AMDGPU/stress-calls.ll @@ -0,0 +1,36 @@ +; RUN: opt -S -amdgpu-stress-function-calls -amdgpu-always-inline %s | FileCheck %s + +; CHECK: define internal fastcc i32 @alwaysinline_func(i32 %a) #0 { +define internal fastcc i32 @alwaysinline_func(i32 %a) alwaysinline { +entry: + %tmp0 = add i32 %a, 1 + ret i32 %tmp0 +} + +; CHECK: define internal fastcc i32 @noinline_func(i32 %a) #1 { +define internal fastcc i32 @noinline_func(i32 %a) noinline { +entry: + %tmp0 = add i32 %a, 2 + ret i32 %tmp0 +} + +; CHECK: define internal fastcc i32 @unmarked_func(i32 %a) #1 { +define internal fastcc i32 @unmarked_func(i32 %a) { +entry: + %tmp0 = add i32 %a, 3 + ret i32 %tmp0 +} + +define amdgpu_kernel void @kernel(i32 addrspace(1)* %out) { +entry: + %tmp0 = call i32 @alwaysinline_func(i32 1) + store volatile i32 %tmp0, i32 addrspace(1)* %out + %tmp1 = call i32 @noinline_func(i32 1) + store volatile i32 %tmp1, i32 addrspace(1)* %out + %tmp2 = call i32 @unmarked_func(i32 1) + store volatile i32 %tmp2, i32 addrspace(1)* %out + ret void +} + +; CHECK: attributes #0 = { alwaysinline } +; CHECK: attributes #1 = { noinline } |

