150
|
1 ; RUN: opt -S -mtriple=amdgcn-amd-amdhsa -amdgpu-stress-function-calls -amdgpu-always-inline %s | FileCheck %s
|
|
2
|
|
3 ; CHECK: define internal fastcc i32 @alwaysinline_func(i32 %a) #0 {
|
|
4 define internal fastcc i32 @alwaysinline_func(i32 %a) alwaysinline {
|
|
5 entry:
|
|
6 %tmp0 = add i32 %a, 1
|
|
7 ret i32 %tmp0
|
|
8 }
|
|
9
|
|
10 ; CHECK: define internal fastcc i32 @noinline_func(i32 %a) #1 {
|
|
11 define internal fastcc i32 @noinline_func(i32 %a) noinline {
|
|
12 entry:
|
|
13 %tmp0 = add i32 %a, 2
|
|
14 ret i32 %tmp0
|
|
15 }
|
|
16
|
|
17 ; CHECK: define internal fastcc i32 @unmarked_func(i32 %a) #1 {
|
|
18 define internal fastcc i32 @unmarked_func(i32 %a) {
|
|
19 entry:
|
|
20 %tmp0 = add i32 %a, 3
|
|
21 ret i32 %tmp0
|
|
22 }
|
|
23
|
|
24 define amdgpu_kernel void @kernel(i32 addrspace(1)* %out) {
|
|
25 entry:
|
|
26 %tmp0 = call i32 @alwaysinline_func(i32 1)
|
|
27 store volatile i32 %tmp0, i32 addrspace(1)* %out
|
|
28 %tmp1 = call i32 @noinline_func(i32 1)
|
|
29 store volatile i32 %tmp1, i32 addrspace(1)* %out
|
|
30 %tmp2 = call i32 @unmarked_func(i32 1)
|
|
31 store volatile i32 %tmp2, i32 addrspace(1)* %out
|
|
32 ret void
|
|
33 }
|
|
34
|
|
35 ; CHECK: attributes #0 = { alwaysinline }
|
|
36 ; CHECK: attributes #1 = { noinline }
|