48 lines
2.0 KiB
LLVM
48 lines
2.0 KiB
LLVM
; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 6
|
|
; RUN: opt -mtriple=amdgcn -passes=amdgpu-attributor < %s | llc -mtriple=amdgcn -mcpu=gfx1100 | FileCheck %s
|
|
|
|
; This function uses scratch_store to spill some values to the stack. While
|
|
; these stores are potentially outstanding it should not send the DEALLOC_VGPRS
|
|
; message.
|
|
|
|
define amdgpu_kernel void @f(ptr %ptr, i32 %arg) "amdgpu-flat-work-group-size"="64,64" {
|
|
; CHECK-LABEL: f:
|
|
; CHECK: ; %bb.0:
|
|
; CHECK-NEXT: s_load_b64 s[2:3], s[0:1], 0x24
|
|
; CHECK-NEXT: v_lshlrev_b32_e32 v0, 2, v0
|
|
; CHECK-NEXT: s_load_b32 s0, s[0:1], 0x2c
|
|
; CHECK-NEXT: scratch_store_b32 off, v0, off offset:4 ; 4-byte Folded Spill
|
|
; CHECK-NEXT: s_waitcnt lgkmcnt(0)
|
|
; CHECK-NEXT: global_load_b32 v0, v0, s[2:3]
|
|
; CHECK-NEXT: s_bitcmp0_b32 s0, 0
|
|
; CHECK-NEXT: s_waitcnt vmcnt(0)
|
|
; CHECK-NEXT: scratch_store_b32 off, v0, off ; 4-byte Folded Spill
|
|
; CHECK-NEXT: ;;#ASMSTART
|
|
; CHECK-NEXT: ; clobber
|
|
; CHECK-NEXT: ;;#ASMEND
|
|
; CHECK-NEXT: s_cbranch_scc1 .LBB0_2
|
|
; CHECK-NEXT: ; %bb.1: ; %true
|
|
; CHECK-NEXT: s_clause 0x1 ; 8-byte Folded Reload
|
|
; CHECK-NEXT: scratch_load_b32 v0, off, off offset:4
|
|
; CHECK-NEXT: scratch_load_b32 v2, off, off
|
|
; CHECK-NEXT: s_waitcnt vmcnt(1)
|
|
; CHECK-NEXT: v_add_co_u32 v0, s0, s2, v0
|
|
; CHECK-NEXT: s_delay_alu instid0(VALU_DEP_1)
|
|
; CHECK-NEXT: v_add_co_ci_u32_e64 v1, null, s3, 0, s0
|
|
; CHECK-NEXT: s_waitcnt vmcnt(0)
|
|
; CHECK-NEXT: global_store_b32 v[0:1], v2, off
|
|
; CHECK-NEXT: .LBB0_2: ; %false
|
|
; CHECK-NEXT: s_endpgm
|
|
%tid = call i32 @llvm.amdgcn.workitem.id.x()
|
|
%gep = getelementptr i32, ptr %ptr, i32 %tid
|
|
%val = load i32, ptr %gep
|
|
call void asm "; clobber", "~{v[0:31]},~{v[32:63]},~{v[64:95]},~{v[96:127]},~{v[128:159]},~{v[160:191]},~{v[192:223]},~{v[224:255]},~{memory}" ()
|
|
%cond = trunc i32 %arg to i1
|
|
br i1 %cond, label %true, label %false
|
|
true:
|
|
store i32 %val, ptr %gep
|
|
br label %false
|
|
false:
|
|
ret void
|
|
}
|