File: spill-sgpr-stack-no-sgpr.ll

package info (click to toggle)
llvm-toolchain-14 1%3A14.0.6-12
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 1,496,180 kB
  • sloc: cpp: 5,593,972; ansic: 986,872; asm: 585,869; python: 184,223; objc: 72,530; lisp: 31,119; f90: 27,793; javascript: 9,780; pascal: 9,762; sh: 9,482; perl: 7,468; ml: 5,432; awk: 3,523; makefile: 2,538; xml: 953; cs: 573; fortran: 567
file content (70 lines) | stat: -rw-r--r-- 2,974 bytes parent folder | download | duplicates (6)
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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
; RUN: llc -march=amdgcn -mcpu=gfx1010 -mattr=-wavefrontsize32,+wavefrontsize64 -verify-machineinstrs < %s | FileCheck -check-prefix=GFX10 %s

; Spill an SGPR to scratch without having spare SGPRs available to save exec

define amdgpu_kernel void @test() #1 {
; GFX10-LABEL: test:
; GFX10:       ; %bb.0:
; GFX10-NEXT:    s_mov_b32 s8, SCRATCH_RSRC_DWORD0
; GFX10-NEXT:    s_mov_b32 s9, SCRATCH_RSRC_DWORD1
; GFX10-NEXT:    s_mov_b32 s10, -1
; GFX10-NEXT:    s_mov_b32 s11, 0x31e16000
; GFX10-NEXT:    s_add_u32 s8, s8, s1
; GFX10-NEXT:    s_addc_u32 s9, s9, 0
; GFX10-NEXT:    ;;#ASMSTART
; GFX10-NEXT:    ; def s[0:7]
; GFX10-NEXT:    ;;#ASMEND
; GFX10-NEXT:    ;;#ASMSTART
; GFX10-NEXT:    ; def s[8:12]
; GFX10-NEXT:    ;;#ASMEND
; GFX10-NEXT:    s_not_b64 exec, exec
; GFX10-NEXT:    buffer_store_dword v0, off, s[8:11], 0
; GFX10-NEXT:    v_writelane_b32 v0, s8, 0
; GFX10-NEXT:    v_writelane_b32 v0, s9, 1
; GFX10-NEXT:    v_writelane_b32 v0, s10, 2
; GFX10-NEXT:    v_writelane_b32 v0, s11, 3
; GFX10-NEXT:    v_writelane_b32 v0, s12, 4
; GFX10-NEXT:    buffer_store_dword v0, off, s[8:11], 0 offset:4 ; 4-byte Folded Spill
; GFX10-NEXT:    s_waitcnt_depctr 0xffe3
; GFX10-NEXT:    s_not_b64 exec, exec
; GFX10-NEXT:    buffer_store_dword v0, off, s[8:11], 0 offset:4 ; 4-byte Folded Spill
; GFX10-NEXT:    s_waitcnt_depctr 0xffe3
; GFX10-NEXT:    s_not_b64 exec, exec
; GFX10-NEXT:    buffer_load_dword v0, off, s[8:11], 0
; GFX10-NEXT:    s_waitcnt vmcnt(0)
; GFX10-NEXT:    s_waitcnt_depctr 0xffe3
; GFX10-NEXT:    s_not_b64 exec, exec
; GFX10-NEXT:    ;;#ASMSTART
; GFX10-NEXT:    ;;#ASMEND
; GFX10-NEXT:    ;;#ASMSTART
; GFX10-NEXT:    ; use s[0:7]
; GFX10-NEXT:    ;;#ASMEND
; GFX10-NEXT:    s_mov_b64 s[6:7], exec
; GFX10-NEXT:    s_mov_b64 exec, 31
; GFX10-NEXT:    buffer_store_dword v0, off, s[8:11], 0
; GFX10-NEXT:    buffer_load_dword v0, off, s[8:11], 0 offset:4 ; 4-byte Folded Reload
; GFX10-NEXT:    s_waitcnt vmcnt(0)
; GFX10-NEXT:    v_readlane_b32 s0, v0, 0
; GFX10-NEXT:    v_readlane_b32 s1, v0, 1
; GFX10-NEXT:    v_readlane_b32 s2, v0, 2
; GFX10-NEXT:    v_readlane_b32 s3, v0, 3
; GFX10-NEXT:    v_readlane_b32 s4, v0, 4
; GFX10-NEXT:    buffer_load_dword v0, off, s[8:11], 0
; GFX10-NEXT:    s_waitcnt vmcnt(0)
; GFX10-NEXT:    s_waitcnt_depctr 0xffe3
; GFX10-NEXT:    s_mov_b64 exec, s[6:7]
; GFX10-NEXT:    ;;#ASMSTART
; GFX10-NEXT:    ; use s[0:4]
; GFX10-NEXT:    ;;#ASMEND
; GFX10-NEXT:    s_endpgm
  %wide.sgpr0 = call <8 x i32> asm sideeffect "; def $0", "={s[0:7]}" () #0
  %wide.sgpr2 = call <5 x i32> asm sideeffect "; def $0", "={s[8:12]}" () #0
  call void asm sideeffect "", "~{v[0:7]}" () #0
  call void asm sideeffect "; use $0", "s"(<8 x i32> %wide.sgpr0) #0
  call void asm sideeffect "; use $0", "s"(<5 x i32> %wide.sgpr2) #0
  ret void
}

attributes #0 = { nounwind }
attributes #1 = { nounwind "amdgpu-num-sgpr"="16" "amdgpu-num-vgpr"="8" }