llvm.org GIT mirror llvm / 42d86b3
AMDGPU: Remove old intrinsic uses git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@303305 91177308-0d34-0410-b5e6-96231b3b80d8 Matt Arsenault 2 years ago
5 changed file(s) with 13 addition(s) and 15 deletion(s). Raw diff Collapse all Expand all
44
55 define spir_kernel void @hoge() {
66 bb:
7 %tmp = tail call i32 @llvm.r600.read.tidig.x()
7 %tmp = tail call i32 @llvm.amdgcn.workitem.id.x()
88 br i1 undef, label %bb2, label %bb23
99
1010 bb2:
4949 ret void
5050 }
5151
52 declare i32 @llvm.r600.read.tidig.x()
52 declare i32 @llvm.amdgcn.workitem.id.x()
None ; RUN: llc < %s -march=amdgcn -mcpu=SI -verify-machineinstrs | FileCheck %s
0 ; RUN: llc < %s -march=amdgcn -verify-machineinstrs | FileCheck %s
11
22 ; This tests that the llvm.SI.end.cf intrinsic is not inserted into the
33 ; loop block. This intrinsic will be lowered to s_or_b64 by the code
1313 ; CHECK: s_cbranch_execnz [[LOOP_LABEL]]
1414 define amdgpu_kernel void @test(i32 addrspace(1)* %out) {
1515 entry:
16 %cond = call i32 @llvm.r600.read.tidig.x() #0
16 %cond = call i32 @llvm.amdgcn.workitem.id.x() #0
1717 %tmp0 = icmp eq i32 %cond, 0
1818 br i1 %tmp0, label %if, label %loop
1919
3333 ret void
3434 }
3535
36 declare i32 @llvm.r600.read.tidig.x() #0
36 declare i32 @llvm.amdgcn.workitem.id.x() #0
3737
38 attributes #0 = { readnone }
38 attributes #0 = { nounwind readnone }
1111 ; SI: s_endpgm
1212 define amdgpu_kernel void @br_i1_phi(i32 %arg) {
1313 bb:
14 %tidig = call i32 @llvm.r600.read.tidig.x() #0
14 %tidig = call i32 @llvm.amdgcn.workitem.id.x()
1515 %cmp = trunc i32 %tidig to i1
1616 br i1 %cmp, label %bb2, label %bb3
1717
3131 ret void
3232 }
3333
34 declare i32 @llvm.r600.read.tidig.x() #0
34 declare i32 @llvm.amdgcn.workitem.id.x() #0
3535
36 attributes #0 = { readnone }
36 attributes #0 = { nounwind readnone }
66 ; GFX9: flat_store_dword
77 ; GFX9-NOT: s_waitcnt
88 ; GCN: s_barrier
9 define amdgpu_kernel void @test_barrier(i32 addrspace(1)* %out) #0 {
9 define amdgpu_kernel void @test_barrier(i32 addrspace(1)* %out, i32 %size) #0 {
1010 entry:
1111 %tmp = call i32 @llvm.amdgcn.workitem.id.x()
1212 %tmp1 = getelementptr i32, i32 addrspace(1)* %out, i32 %tmp
1313 store i32 %tmp, i32 addrspace(1)* %tmp1
1414 call void @llvm.amdgcn.s.barrier()
15 %tmp2 = call i32 @llvm.r600.read.local.size.x()
16 %tmp3 = sub i32 %tmp2, 1
15 %tmp3 = sub i32 %size, 1
1716 %tmp4 = sub i32 %tmp3, %tmp
1817 %tmp5 = getelementptr i32, i32 addrspace(1)* %out, i32 %tmp4
1918 %tmp6 = load i32, i32 addrspace(1)* %tmp5
2322
2423 declare void @llvm.amdgcn.s.barrier() #1
2524 declare i32 @llvm.amdgcn.workitem.id.x() #2
26 declare i32 @llvm.r600.read.local.size.x() #2
2725
2826 attributes #0 = { nounwind }
2927 attributes #1 = { convergent nounwind }
185185 %tmp140 = phi float [ 0.000000e+00, %bb ], [ %tmp405, %bb145 ]
186186 %tmp141 = phi float [ 0.000000e+00, %bb ], [ %tmp406, %bb145 ]
187187 %tmp142 = bitcast float %tmp95 to i32
188 %tid = call i32 @llvm.r600.read.tidig.x() #1
188 %tid = call i32 @llvm.amdgcn.workitem.id.x() #1
189189 %tmp143 = icmp sgt i32 %tmp142, %tid
190190 br i1 %tmp143, label %bb144, label %bb145
191191
592592 br label %bb12
593593 }
594594
595 declare i32 @llvm.r600.read.tidig.x() #1
595 declare i32 @llvm.amdgcn.workitem.id.x() #1
596596
597597 attributes #0 = { nounwind }
598598 attributes #1 = { nounwind readnone }