150
|
1 ; RUN: llc -march=amdgcn -mcpu=tonga -verify-machineinstrs < %s | FileCheck --check-prefix=TONGA %s
|
|
2
|
|
3 ; On Tonga and Iceland, limited SGPR availability means care must be taken to
|
|
4 ; allocate scratch registers correctly. Check that this test compiles without
|
|
5 ; error.
|
|
6 ; TONGA-LABEL: test
|
252
|
7 define amdgpu_kernel void @test(ptr addrspace(1) %out, ptr addrspace(1) %in) {
|
150
|
8 entry:
|
|
9 %mbcnt.lo = call i32 @llvm.amdgcn.mbcnt.lo(i32 -1, i32 0)
|
|
10 %tid = call i32 @llvm.amdgcn.mbcnt.hi(i32 -1, i32 %mbcnt.lo)
|
252
|
11 %aptr = getelementptr <256 x i32>, ptr addrspace(1) %in, i32 %tid
|
|
12 %a = load <256 x i32>, ptr addrspace(1) %aptr
|
150
|
13 call void asm sideeffect "", "~{memory}" ()
|
252
|
14 %outptr = getelementptr <256 x i32>, ptr addrspace(1) %in, i32 %tid
|
|
15 store <256 x i32> %a, ptr addrspace(1) %outptr
|
150
|
16
|
|
17 ; mark 128-bit SGPR registers as used so they are unavailable for the
|
|
18 ; scratch resource descriptor
|
|
19 call void asm sideeffect "", "~{s4},~{s8},~{s12},~{s16},~{s20},~{s24},~{s28}" ()
|
|
20 call void asm sideeffect "", "~{s32},~{s36},~{s40},~{s44},~{s48},~{s52},~{s56}" ()
|
|
21 call void asm sideeffect "", "~{s60},~{s64},~{s68}" ()
|
|
22 ret void
|
|
23 }
|
|
24
|
|
25 declare i32 @llvm.amdgcn.mbcnt.lo(i32, i32) #0
|
|
26 declare i32 @llvm.amdgcn.mbcnt.hi(i32, i32) #0
|
|
27
|
|
28 attributes #0 = { nounwind readnone }
|