1 ; RUN: llc -march=r600 -mcpu=redwood < %s | FileCheck -check-prefix=EG %s
3 ; EG-LABEL: {{^}}test_group_barrier:
5 define amdgpu_kernel void @test_group_barrier(i32 addrspace(1)* %out) #0 {
7 %tmp = call i32 @llvm.r600.read.tidig.x()
8 %tmp1 = getelementptr i32, i32 addrspace(1)* %out, i32 %tmp
9 store i32 %tmp, i32 addrspace(1)* %tmp1
10 call void @llvm.r600.group.barrier()
11 %tmp2 = call i32 @llvm.r600.read.local.size.x()
12 %tmp3 = sub i32 %tmp2, 1
13 %tmp4 = sub i32 %tmp3, %tmp
14 %tmp5 = getelementptr i32, i32 addrspace(1)* %out, i32 %tmp4
15 %tmp6 = load i32, i32 addrspace(1)* %tmp5
16 store i32 %tmp6, i32 addrspace(1)* %tmp1
20 ; Function Attrs: convergent nounwind
21 declare void @llvm.r600.group.barrier() #1
23 ; Function Attrs: nounwind readnone
24 declare i32 @llvm.r600.read.tidig.x() #2
26 ; Function Attrs: nounwind readnone
27 declare i32 @llvm.r600.read.local.size.x() #2
29 attributes #0 = { nounwind }
30 attributes #1 = { convergent nounwind }
31 attributes #2 = { nounwind readnone }