1 ; RUN: llc < %s -march=r600 -mcpu=redwood | FileCheck %s 2 3 ; CHECK: GROUP_BARRIER 4 5 define void @test(i32 addrspace(1)* %out) { 6 entry: 7 %0 = call i32 @llvm.r600.read.tidig.x() 8 %1 = getelementptr i32 addrspace(1)* %out, i32 %0 9 store i32 %0, i32 addrspace(1)* %1 10 call void @llvm.AMDGPU.barrier.local() 11 %2 = call i32 @llvm.r600.read.local.size.x() 12 %3 = sub i32 %2, 1 13 %4 = sub i32 %3, %0 14 %5 = getelementptr i32 addrspace(1)* %out, i32 %4 15 %6 = load i32 addrspace(1)* %5 16 store i32 %6, i32 addrspace(1)* %1 17 ret void 18 } 19 20 declare i32 @llvm.r600.read.tidig.x() #0 21 declare void @llvm.AMDGPU.barrier.local() 22 declare i32 @llvm.r600.read.local.size.x() #0 23 24 attributes #0 = { readnone } 25