[MachineScheduler] Fix physreg dependencies of ExitSU (#123541)
[llvm-project.git] / llvm / test / CodeGen / AMDGPU / spill-sgpr-stack-no-sgpr.ll
blob5338bc8f7aa7ac05b03b68a1de902ff886375d50
1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc -mtriple=amdgcn -mcpu=gfx1010 -mattr=+wavefrontsize64 < %s | FileCheck -check-prefix=GFX10 %s
4 ; The test was originally written to spill an SGPR to scratch without
5 ; having spare SGPRs available to save exec. This scenario won't be
6 ; true anymore as we reserve SGPR(s) upfront for saving exec.
8 define amdgpu_kernel void @test() #1 {
9 ; GFX10-LABEL: test:
10 ; GFX10:       ; %bb.0:
11 ; GFX10-NEXT:    s_mov_b32 s8, SCRATCH_RSRC_DWORD0
12 ; GFX10-NEXT:    s_mov_b32 s9, SCRATCH_RSRC_DWORD1
13 ; GFX10-NEXT:    s_mov_b32 s10, -1
14 ; GFX10-NEXT:    s_mov_b32 s11, 0x31e16000
15 ; GFX10-NEXT:    s_add_u32 s8, s8, s7
16 ; GFX10-NEXT:    s_addc_u32 s9, s9, 0
17 ; GFX10-NEXT:    ;;#ASMSTART
18 ; GFX10-NEXT:    ; def s[0:7]
19 ; GFX10-NEXT:    ;;#ASMEND
20 ; GFX10-NEXT:    ;;#ASMSTART
21 ; GFX10-NEXT:    ; def s[8:12]
22 ; GFX10-NEXT:    ;;#ASMEND
23 ; GFX10-NEXT:    ;;#ASMSTART
24 ; GFX10-NEXT:    ;;#ASMEND
25 ; GFX10-NEXT:    ;;#ASMSTART
26 ; GFX10-NEXT:    ; use s[0:7]
27 ; GFX10-NEXT:    ;;#ASMEND
28 ; GFX10-NEXT:    ;;#ASMSTART
29 ; GFX10-NEXT:    ; use s[8:12]
30 ; GFX10-NEXT:    ;;#ASMEND
31 ; GFX10-NEXT:    s_endpgm
32   %wide.sgpr0 = call <8 x i32> asm sideeffect "; def $0", "={s[0:7]}" () #0
33   %wide.sgpr2 = call <5 x i32> asm sideeffect "; def $0", "={s[8:12]}" () #0
34   call void asm sideeffect "", "~{v[0:7]}" () #0
35   call void asm sideeffect "; use $0", "s"(<8 x i32> %wide.sgpr0) #0
36   call void asm sideeffect "; use $0", "s"(<5 x i32> %wide.sgpr2) #0
37   ret void
40 ; FIXME: amdgpu-no attributese are a workaround for cases where the
41 ; number of incoming arguments is larger than the number of permitted
42 ; registers.
43 attributes #0 = { nounwind }
44 attributes #1 = { nounwind "amdgpu-num-sgpr"="16" "amdgpu-num-vgpr"="8" "amdgpu-no-queue-ptr" "amdgpu-no-dispatch-id" }