aboutsummaryrefslogtreecommitdiffstats
path: root/test/CodeGen/R600/llvm.AMDGPU.barrier.global.ll
blob: 98f6695f731d7f6f4f39a3f18bed52937af18500 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
; RUN: llc -march=r600 -mcpu=SI < %s | FileCheck -check-prefix=SI -check-prefix=FUNC %s
; RUN: llc -march=r600 -mcpu=redwood < %s | FileCheck -check-prefix=EG -check-prefix=FUNC %s

; FUNC-LABEL: {{^}}test_barrier_global:
; EG: GROUP_BARRIER
; SI: s_barrier

define void @test_barrier_global(i32 addrspace(1)* %out) {
entry:
  %0 = call i32 @llvm.r600.read.tidig.x()
  %1 = getelementptr i32 addrspace(1)* %out, i32 %0
  store i32 %0, i32 addrspace(1)* %1
  call void @llvm.AMDGPU.barrier.global()
  %2 = call i32 @llvm.r600.read.local.size.x()
  %3 = sub i32 %2, 1
  %4 = sub i32 %3, %0
  %5 = getelementptr i32 addrspace(1)* %out, i32 %4
  %6 = load i32 addrspace(1)* %5
  store i32 %6, i32 addrspace(1)* %1
  ret void
}

declare void @llvm.AMDGPU.barrier.global()

declare i32 @llvm.r600.read.tidig.x() #0
declare i32 @llvm.r600.read.local.size.x() #0

attributes #0 = { readnone }