|
1 |
| -; RUN: opt -mtriple=amdgcn--amdhsa -data-layout=A5 -O3 -S -inline-threshold=1 < %s | FileCheck -check-prefix=GCN -check-prefix=GCN-INL1 %s |
2 |
| -; RUN: opt -mtriple=amdgcn--amdhsa -data-layout=A5 -O3 -S < %s | FileCheck -check-prefix=GCN -check-prefix=GCN-INLDEF %s |
3 |
| -; RUN: opt -mtriple=amdgcn--amdhsa -data-layout=A5 -passes='default<O3>' -S -inline-threshold=1 < %s | FileCheck -check-prefix=GCN -check-prefix=GCN-INL1 %s |
4 |
| -; RUN: opt -mtriple=amdgcn--amdhsa -data-layout=A5 -passes='default<O3>' -S < %s | FileCheck -check-prefix=GCN -check-prefix=GCN-INLDEF %s |
| 1 | +; RUN: opt -mtriple=amdgcn--amdhsa -data-layout=A5 -O3 -S -inline-threshold=1 < %s | FileCheck -check-prefixes=GCN,GCN-INL1,GCN-MAXBBDEF %s |
| 2 | +; RUN: opt -mtriple=amdgcn--amdhsa -data-layout=A5 -O3 -S < %s | FileCheck -check-prefixes=GCN,GCN-INLDEF,GCN-MAXBBDEF %s |
| 3 | +; RUN: opt -mtriple=amdgcn--amdhsa -data-layout=A5 -passes='default<O3>' -S -inline-threshold=1 < %s | FileCheck -check-prefixes=GCN,GCN-INL1,GCN-MAXBBDEF %s |
| 4 | +; RUN: opt -mtriple=amdgcn--amdhsa -data-layout=A5 -passes='default<O3>' -S < %s | FileCheck -check-prefixes=GCN,GCN-INLDEF,GCN-MAXBBDEF %s |
| 5 | +; RUN: opt -mtriple=amdgcn--amdhsa -data-layout=A5 -passes='default<O3>' -S -amdgpu-inline-max-bb=1 < %s | FileCheck -check-prefixes=GCN,GCN-MAXBB1 %s |
5 | 6 |
|
6 | 7 | define coldcc float @foo(float %x, float %y) {
|
7 | 8 | entry:
|
@@ -57,12 +58,14 @@ entry:
|
57 | 58 | }
|
58 | 59 |
|
59 | 60 | ; GCN: define amdgpu_kernel void @test_inliner(
|
60 |
| -; GCN-INL1: %c1 = tail call coldcc float @foo( |
61 |
| -; GCN-INLDEF: %cmp.i = fcmp ogt float %tmp2, 0.000000e+00 |
62 |
| -; GCN: %div.i{{[0-9]*}} = fdiv float 1.000000e+00, %c |
63 |
| -; GCN: %div.i{{[0-9]*}} = fdiv float 2.000000e+00, %tmp1.i |
64 |
| -; GCN: call void @foo_noinline( |
65 |
| -; GCN: tail call float @_Z3sinf( |
| 61 | +; GCN-INL1: %c1 = tail call coldcc float @foo( |
| 62 | +; GCN-INLDEF: %cmp.i = fcmp ogt float %tmp2, 0.000000e+00 |
| 63 | +; GCN-MAXBBDEF: %div.i{{[0-9]*}} = fdiv float 1.000000e+00, %c |
| 64 | +; GCN-MAXBBDEF: %div.i{{[0-9]*}} = fdiv float 2.000000e+00, %tmp1.i |
| 65 | +; GCN-MAXBB1: call coldcc void @foo_private_ptr |
| 66 | +; GCN-MAXBB1: call coldcc void @foo_private_ptr2 |
| 67 | +; GCN: call void @foo_noinline( |
| 68 | +; GCN: tail call float @_Z3sinf( |
66 | 69 | define amdgpu_kernel void @test_inliner(float addrspace(1)* nocapture %a, i32 %n) {
|
67 | 70 | entry:
|
68 | 71 | %pvt_arr = alloca [64 x float], align 4, addrspace(5)
|
|
95 | 98 | }
|
96 | 99 |
|
97 | 100 | ; GCN: define amdgpu_kernel void @test_inliner_multi_pvt_ptr(
|
98 |
| -; GCN: %div.i{{[0-9]*}} = fdiv float 2.000000e+00, %tmp1.i |
| 101 | +; GCN-MAXBBDEF: %div.i{{[0-9]*}} = fdiv float 2.000000e+00, %tmp1.i |
| 102 | +; GCN-MAXBB1: call coldcc void @foo_private_ptr2 |
99 | 103 | define amdgpu_kernel void @test_inliner_multi_pvt_ptr(float addrspace(1)* nocapture %a, i32 %n, float %v) {
|
100 | 104 | entry:
|
101 | 105 | %pvt_arr1 = alloca [32 x float], align 4, addrspace(5)
|
@@ -147,6 +151,24 @@ entry:
|
147 | 151 | ret void
|
148 | 152 | }
|
149 | 153 |
|
| 154 | +; GCN: define amdgpu_kernel void @test_inliner_maxbb_singlebb( |
| 155 | +; GCN: tail call float @_Z3sinf |
| 156 | +define amdgpu_kernel void @test_inliner_maxbb_singlebb(float addrspace(1)* nocapture %a, i32 %n) { |
| 157 | +entry: |
| 158 | + %cmp = icmp eq i32 %n, 1 |
| 159 | + br i1 %cmp, label %bb.1, label %bb.2 |
| 160 | + br label %bb.1 |
| 161 | + |
| 162 | +bb.1: |
| 163 | + store float 1.0, float* undef |
| 164 | + br label %bb.2 |
| 165 | + |
| 166 | +bb.2: |
| 167 | + %c = call float @sin_wrapper(float 1.0) |
| 168 | + store float %c, float addrspace(1)* %a |
| 169 | + ret void |
| 170 | +} |
| 171 | + |
150 | 172 | declare i32 @llvm.amdgcn.workitem.id.x() #1
|
151 | 173 | declare float @_Z3sinf(float) #1
|
152 | 174 |
|
|
0 commit comments