File: track-spilled-vgpr-liveness.mir

package info (click to toggle)
swiftlang 6.0.3-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 2,519,992 kB
  • sloc: cpp: 9,107,863; ansic: 2,040,022; asm: 1,135,751; python: 296,500; objc: 82,456; f90: 60,502; lisp: 34,951; pascal: 19,946; sh: 18,133; perl: 7,482; ml: 4,937; javascript: 4,117; makefile: 3,840; awk: 3,535; xml: 914; fortran: 619; cs: 573; ruby: 573
file content (104 lines) | stat: -rw-r--r-- 4,982 bytes parent folder | download | duplicates (4)
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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
# NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
# RUN: llc -mtriple=amdgcn-amd-amdhsa -mcpu=gfx906 -run-pass=prologepilog -verify-machineinstrs %s -o - | FileCheck -check-prefix=GCN %s

# VGPR spill code in the prolog sets the `IsKill` flag for the spilled register
# based on the entry block's livein info.

---
name:            vgpr_use_after_prolog_spill
tracksRegLiveness: true
machineFunctionInfo:
  scratchRSrcReg:  '$sgpr0_sgpr1_sgpr2_sgpr3'
  frameOffsetReg:  '$sgpr33'
  stackPtrOffsetReg: '$sgpr32'
body:             |
  bb.0:
    liveins: $sgpr42, $vgpr0, $sgpr30_sgpr31

    ; GCN-LABEL: name: vgpr_use_after_prolog_spill
    ; GCN: liveins: $sgpr42, $vgpr0, $sgpr30_sgpr31
    ; GCN-NEXT: {{  $}}
    ; GCN-NEXT: $sgpr4_sgpr5 = S_XOR_SAVEEXEC_B64 -1, implicit-def $exec, implicit-def dead $scc, implicit $exec
    ; GCN-NEXT: BUFFER_STORE_DWORD_OFFSET $vgpr0, $sgpr0_sgpr1_sgpr2_sgpr3, $sgpr32, 0, 0, 0, implicit $exec :: (store (s32) into %stack.0, addrspace 5)
    ; GCN-NEXT: $exec = S_MOV_B64 killed $sgpr4_sgpr5
    ; GCN-NEXT: $vgpr0 = V_ADD_U32_e32 8192, killed $vgpr0, implicit $exec
    ; GCN-NEXT: $vgpr0 = V_WRITELANE_B32 killed $sgpr42, 0, $vgpr0
    ; GCN-NEXT: S_NOP 0, implicit-def $vgpr0
    ; GCN-NEXT: $sgpr4_sgpr5 = S_XOR_SAVEEXEC_B64 -1, implicit-def $exec, implicit-def dead $scc, implicit $exec
    ; GCN-NEXT: $vgpr0 = BUFFER_LOAD_DWORD_OFFSET $sgpr0_sgpr1_sgpr2_sgpr3, $sgpr32, 0, 0, 0, implicit $exec :: (load (s32) from %stack.0, addrspace 5)
    ; GCN-NEXT: $exec = S_MOV_B64 killed $sgpr4_sgpr5
    ; GCN-NEXT: S_SETPC_B64_return $sgpr30_sgpr31
    $vgpr0 = V_ADD_U32_e32 8192, killed $vgpr0, implicit $exec
    $vgpr0 = V_WRITELANE_B32 killed $sgpr42, 0, $vgpr0
    S_NOP 0, implicit-def $vgpr0
    S_SETPC_B64_return $sgpr30_sgpr31
...

---
name:            livein_vgpr_def_after_prolog_spill
tracksRegLiveness: true
machineFunctionInfo:
  scratchRSrcReg:  '$sgpr0_sgpr1_sgpr2_sgpr3'
  frameOffsetReg:  '$sgpr33'
  stackPtrOffsetReg: '$sgpr32'
body:             |
  bb.0:
    liveins: $sgpr42, $vgpr0, $vgpr1, $sgpr30_sgpr31

    ; GCN-LABEL: name: livein_vgpr_def_after_prolog_spill
    ; GCN: liveins: $sgpr42, $vgpr0, $vgpr1, $sgpr30_sgpr31
    ; GCN-NEXT: {{  $}}
    ; GCN-NEXT: $sgpr4_sgpr5 = S_XOR_SAVEEXEC_B64 -1, implicit-def $exec, implicit-def dead $scc, implicit $exec
    ; GCN-NEXT: BUFFER_STORE_DWORD_OFFSET $vgpr0, $sgpr0_sgpr1_sgpr2_sgpr3, $sgpr32, 0, 0, 0, implicit $exec :: (store (s32) into %stack.0, addrspace 5)
    ; GCN-NEXT: $exec = S_MOV_B64 killed $sgpr4_sgpr5
    ; GCN-NEXT: $vgpr0 = V_ADD_U32_e32 8192, killed $vgpr1, implicit $exec
    ; GCN-NEXT: $vgpr0 = V_WRITELANE_B32 killed $sgpr42, 0, $vgpr0
    ; GCN-NEXT: S_NOP 0, implicit-def $vgpr0
    ; GCN-NEXT: $sgpr4_sgpr5 = S_XOR_SAVEEXEC_B64 -1, implicit-def $exec, implicit-def dead $scc, implicit $exec
    ; GCN-NEXT: $vgpr0 = BUFFER_LOAD_DWORD_OFFSET $sgpr0_sgpr1_sgpr2_sgpr3, $sgpr32, 0, 0, 0, implicit $exec :: (load (s32) from %stack.0, addrspace 5)
    ; GCN-NEXT: $exec = S_MOV_B64 killed $sgpr4_sgpr5
    ; GCN-NEXT: S_SETPC_B64_return $sgpr30_sgpr31
    $vgpr0 = V_ADD_U32_e32 8192, killed $vgpr1, implicit $exec
    $vgpr0 = V_WRITELANE_B32 killed $sgpr42, 0, $vgpr0
    S_NOP 0, implicit-def $vgpr0
    S_SETPC_B64_return $sgpr30_sgpr31
...

---
name:            livein_vgpr_not_referred_in_entry_bb
tracksRegLiveness: true
machineFunctionInfo:
  scratchRSrcReg:  '$sgpr0_sgpr1_sgpr2_sgpr3'
  frameOffsetReg:  '$sgpr33'
  stackPtrOffsetReg: '$sgpr32'
body:             |
  ; GCN-LABEL: name: livein_vgpr_not_referred_in_entry_bb
  ; GCN: bb.0:
  ; GCN-NEXT:   successors: %bb.1(0x80000000)
  ; GCN-NEXT:   liveins: $sgpr42, $vgpr0, $sgpr30_sgpr31
  ; GCN-NEXT: {{  $}}
  ; GCN-NEXT:   $sgpr4_sgpr5 = S_XOR_SAVEEXEC_B64 -1, implicit-def $exec, implicit-def dead $scc, implicit $exec
  ; GCN-NEXT:   BUFFER_STORE_DWORD_OFFSET $vgpr0, $sgpr0_sgpr1_sgpr2_sgpr3, $sgpr32, 0, 0, 0, implicit $exec :: (store (s32) into %stack.0, addrspace 5)
  ; GCN-NEXT:   $exec = S_MOV_B64 killed $sgpr4_sgpr5
  ; GCN-NEXT:   S_NOP 0
  ; GCN-NEXT:   S_BRANCH %bb.1
  ; GCN-NEXT: {{  $}}
  ; GCN-NEXT: bb.1:
  ; GCN-NEXT:   liveins: $sgpr42, $vgpr0, $sgpr30_sgpr31
  ; GCN-NEXT: {{  $}}
  ; GCN-NEXT:   $vgpr0 = V_WRITELANE_B32 killed $sgpr42, 0, $vgpr0
  ; GCN-NEXT:   S_NOP 0, implicit-def $vgpr0
  ; GCN-NEXT:   $sgpr4_sgpr5 = S_XOR_SAVEEXEC_B64 -1, implicit-def $exec, implicit-def dead $scc, implicit $exec
  ; GCN-NEXT:   $vgpr0 = BUFFER_LOAD_DWORD_OFFSET $sgpr0_sgpr1_sgpr2_sgpr3, $sgpr32, 0, 0, 0, implicit $exec :: (load (s32) from %stack.0, addrspace 5)
  ; GCN-NEXT:   $exec = S_MOV_B64 killed $sgpr4_sgpr5
  ; GCN-NEXT:   S_SETPC_B64_return $sgpr30_sgpr31
  bb.0:
    liveins: $sgpr42, $vgpr0, $sgpr30_sgpr31
    S_NOP 0
    S_BRANCH %bb.1
  bb.1:
    liveins: $sgpr42, $vgpr0, $sgpr30_sgpr31
    $vgpr0 = V_WRITELANE_B32 killed $sgpr42, 0, $vgpr0
    S_NOP 0, implicit-def $vgpr0
    S_SETPC_B64_return $sgpr30_sgpr31
...