comparison test/CodeGen/AMDGPU/llvm.amdgcn.s.barrier.ll @ 100:7d135dc70f03 LLVM 3.9

LLVM 3.9
author Miyagi Mitsuki <e135756@ie.u-ryukyu.ac.jp>
date Tue, 26 Jan 2016 22:53:40 +0900
parents
children 1172e4bd9c6f
comparison
equal deleted inserted replaced
96:6418606d0ead 100:7d135dc70f03
1 ; RUN: llc -march=amdgcn -verify-machineinstrs < %s | FileCheck -check-prefix=GCN %s
2
3 ; GCN-LABEL: {{^}}test_barrier:
4 ; GCN: buffer_store_dword
5 ; GCN: s_waitcnt
6 ; GCN: s_barrier
7 define void @test_barrier(i32 addrspace(1)* %out) #0 {
8 entry:
9 %tmp = call i32 @llvm.r600.read.tidig.x()
10 %tmp1 = getelementptr i32, i32 addrspace(1)* %out, i32 %tmp
11 store i32 %tmp, i32 addrspace(1)* %tmp1
12 call void @llvm.amdgcn.s.barrier()
13 %tmp2 = call i32 @llvm.r600.read.local.size.x()
14 %tmp3 = sub i32 %tmp2, 1
15 %tmp4 = sub i32 %tmp3, %tmp
16 %tmp5 = getelementptr i32, i32 addrspace(1)* %out, i32 %tmp4
17 %tmp6 = load i32, i32 addrspace(1)* %tmp5
18 store i32 %tmp6, i32 addrspace(1)* %tmp1
19 ret void
20 }
21
22 declare void @llvm.amdgcn.s.barrier() #1
23 declare i32 @llvm.r600.read.tidig.x() #2
24 declare i32 @llvm.r600.read.local.size.x() #2
25
26 attributes #0 = { nounwind }
27 attributes #1 = { convergent nounwind }
28 attributes #2 = { nounwind readnone }