1 # NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2 # RUN: llc -mtriple riscv64 -mattr=+m,+v -run-pass=prologepilog -o - \
3 # RUN: -verify-machineinstrs %s | FileCheck %s
5 target datalayout = "e-m:e-p:64:64-i64:64-i128:128-n64-S128"
6 target triple = "riscv64"
8 define void @spillslot() {
16 tracksRegLiveness: true
18 - { reg: '$x12', virtual-reg: '' }
20 isFrameAddressTaken: false
21 isReturnAddressTaken: false
30 maxCallFrameSize: 4294967295
31 cvBytesOfCalleeSavedRegisters: 0
32 hasOpaqueSPAdjustment: false
34 hasMustTailInVarArgFunc: false
41 - { id: 0, name: '', type: default, offset: 0, size: 2048, alignment: 128,
42 stack-id: default, callee-saved-register: '', callee-saved-restored: true,
43 debug-info-variable: '', debug-info-expression: '', debug-info-location: '' }
44 - { id: 1, name: '', type: spill-slot, offset: 0, size: 8, alignment: 8,
45 stack-id: scalable-vector, callee-saved-register: '', callee-saved-restored: true,
46 debug-info-variable: '', debug-info-expression: '', debug-info-location: '' }
47 - { id: 2, name: '', type: spill-slot, offset: 0, size: 400, alignment: 8,
48 stack-id: scalable-vector, callee-saved-register: '', callee-saved-restored: true,
49 debug-info-variable: '', debug-info-expression: '', debug-info-location: '' }
51 ; CHECK-LABEL: name: spillslot
53 ; CHECK-NEXT: successors: %bb.1(0x40000000), %bb.2(0x40000000)
54 ; CHECK-NEXT: liveins: $x12, $x1, $x18, $x19, $x20, $x21, $x22, $x23, $x24, $x25, $x26, $x27
56 ; CHECK-NEXT: $x2 = frame-setup ADDI $x2, -2032
57 ; CHECK-NEXT: frame-setup CFI_INSTRUCTION def_cfa_offset 2032
58 ; CHECK-NEXT: SD killed $x1, $x2, 2024 :: (store (s64) into %stack.3)
59 ; CHECK-NEXT: SD killed $x8, $x2, 2016 :: (store (s64) into %stack.4)
60 ; CHECK-NEXT: SD killed $x18, $x2, 2008 :: (store (s64) into %stack.5)
61 ; CHECK-NEXT: SD killed $x19, $x2, 2000 :: (store (s64) into %stack.6)
62 ; CHECK-NEXT: SD killed $x20, $x2, 1992 :: (store (s64) into %stack.7)
63 ; CHECK-NEXT: SD killed $x21, $x2, 1984 :: (store (s64) into %stack.8)
64 ; CHECK-NEXT: SD killed $x22, $x2, 1976 :: (store (s64) into %stack.9)
65 ; CHECK-NEXT: SD killed $x23, $x2, 1968 :: (store (s64) into %stack.10)
66 ; CHECK-NEXT: SD killed $x24, $x2, 1960 :: (store (s64) into %stack.11)
67 ; CHECK-NEXT: SD killed $x25, $x2, 1952 :: (store (s64) into %stack.12)
68 ; CHECK-NEXT: SD killed $x26, $x2, 1944 :: (store (s64) into %stack.13)
69 ; CHECK-NEXT: SD killed $x27, $x2, 1936 :: (store (s64) into %stack.14)
70 ; CHECK-NEXT: frame-setup CFI_INSTRUCTION offset $x1, -8
71 ; CHECK-NEXT: frame-setup CFI_INSTRUCTION offset $x8, -16
72 ; CHECK-NEXT: frame-setup CFI_INSTRUCTION offset $x18, -24
73 ; CHECK-NEXT: frame-setup CFI_INSTRUCTION offset $x19, -32
74 ; CHECK-NEXT: frame-setup CFI_INSTRUCTION offset $x20, -40
75 ; CHECK-NEXT: frame-setup CFI_INSTRUCTION offset $x21, -48
76 ; CHECK-NEXT: frame-setup CFI_INSTRUCTION offset $x22, -56
77 ; CHECK-NEXT: frame-setup CFI_INSTRUCTION offset $x23, -64
78 ; CHECK-NEXT: frame-setup CFI_INSTRUCTION offset $x24, -72
79 ; CHECK-NEXT: frame-setup CFI_INSTRUCTION offset $x25, -80
80 ; CHECK-NEXT: frame-setup CFI_INSTRUCTION offset $x26, -88
81 ; CHECK-NEXT: frame-setup CFI_INSTRUCTION offset $x27, -96
82 ; CHECK-NEXT: $x8 = frame-setup ADDI $x2, 2032
83 ; CHECK-NEXT: frame-setup CFI_INSTRUCTION def_cfa $x8, 0
84 ; CHECK-NEXT: $x2 = frame-setup ADDI $x2, -272
85 ; CHECK-NEXT: $x10 = frame-setup PseudoReadVLENB
86 ; CHECK-NEXT: $x11 = frame-setup ADDI $x0, 52
87 ; CHECK-NEXT: $x10 = frame-setup MUL killed $x10, killed $x11
88 ; CHECK-NEXT: $x2 = frame-setup SUB $x2, killed $x10
89 ; CHECK-NEXT: $x2 = frame-setup ANDI $x2, -128
90 ; CHECK-NEXT: dead renamable $x15 = PseudoVSETIVLI 1, 72 /* e16, m1, ta, mu */, implicit-def $vl, implicit-def $vtype
91 ; CHECK-NEXT: renamable $v25 = PseudoVMV_V_X_M1 undef $v25, killed renamable $x12, $noreg, 4 /* e16 */, 0 /* tu, mu */, implicit $vl, implicit $vtype
92 ; CHECK-NEXT: $x10 = PseudoReadVLENB
93 ; CHECK-NEXT: $x11 = ADDI $x0, 50
94 ; CHECK-NEXT: $x10 = MUL killed $x10, killed $x11
95 ; CHECK-NEXT: $x10 = ADD $x2, killed $x10
96 ; CHECK-NEXT: $x10 = ADDI killed $x10, 2047
97 ; CHECK-NEXT: $x10 = ADDI killed $x10, 161
98 ; CHECK-NEXT: VS1R_V killed renamable $v25, killed $x10 :: (store unknown-size into %stack.1, align 8)
99 ; CHECK-NEXT: renamable $x1 = ADDI $x0, 255
100 ; CHECK-NEXT: renamable $x5 = nuw ADDI $x2, 384
101 ; CHECK-NEXT: renamable $x6 = ADDI $x2, 512
102 ; CHECK-NEXT: renamable $x7 = nuw ADDI $x2, 640
103 ; CHECK-NEXT: renamable $x10 = ADDI $x0, 128
104 ; CHECK-NEXT: renamable $x12 = nuw ADDI $x2, 256
105 ; CHECK-NEXT: renamable $x14 = COPY $x0
106 ; CHECK-NEXT: renamable $x17 = nuw ADDI $x2, 256
107 ; CHECK-NEXT: renamable $x18 = ADDI $x2, 1280
108 ; CHECK-NEXT: renamable $x19 = ADDI $x2, 1408
109 ; CHECK-NEXT: renamable $x20 = ADDI $x2, 1536
110 ; CHECK-NEXT: renamable $x21 = ADDI $x2, 1664
111 ; CHECK-NEXT: renamable $x22 = ADDI $x2, 1792
112 ; CHECK-NEXT: renamable $x23 = ADDI $x2, 1920
113 ; CHECK-NEXT: $x24 = ADDI $x2, 2047
114 ; CHECK-NEXT: $x24 = ADDI killed $x24, 1
115 ; CHECK-NEXT: renamable $x25 = ADDI $x2, 128
116 ; CHECK-NEXT: renamable $x26 = ADDI $x2, 128
117 ; CHECK-NEXT: renamable $x27 = ADDI $x0, 2
118 ; CHECK-NEXT: renamable $x28 = ADDI $x2, 768
119 ; CHECK-NEXT: renamable $x29 = ADDI $x2, 896
120 ; CHECK-NEXT: renamable $x30 = ADDI $x2, 1024
121 ; CHECK-NEXT: renamable $x31 = nuw ADDI $x2, 1152
122 ; CHECK-NEXT: renamable $x15 = ADDIW renamable $x14, 0
123 ; CHECK-NEXT: renamable $x11 = ANDI renamable $x15, 255
124 ; CHECK-NEXT: renamable $x13 = SLLI renamable $x11, 3
125 ; CHECK-NEXT: renamable $x13 = ADD renamable $x26, killed renamable $x13
126 ; CHECK-NEXT: renamable $x13 = LD killed renamable $x13, 0 :: (load (s64))
127 ; CHECK-NEXT: renamable $x16 = SUB killed renamable $x13, renamable $x13
128 ; CHECK-NEXT: dead renamable $x13 = PseudoVSETIVLI 1, 64 /* e8, m1, ta, mu */, implicit-def $vl, implicit-def $vtype
129 ; CHECK-NEXT: renamable $x13 = nsw ADDI renamable $x16, -2
130 ; CHECK-NEXT: SD killed $x10, $x2, 8 :: (store (s64) into %stack.15)
131 ; CHECK-NEXT: $x10 = PseudoReadVLENB
132 ; CHECK-NEXT: SD killed $x12, $x2, 0 :: (store (s64) into %stack.16)
133 ; CHECK-NEXT: $x12 = ADDI $x0, 50
134 ; CHECK-NEXT: $x10 = MUL killed $x10, killed $x12
135 ; CHECK-NEXT: $x12 = LD $x2, 0 :: (load (s64) from %stack.16)
136 ; CHECK-NEXT: $x10 = ADD $x2, killed $x10
137 ; CHECK-NEXT: $x10 = ADDI killed $x10, 2047
138 ; CHECK-NEXT: $x10 = ADDI killed $x10, 161
139 ; CHECK-NEXT: renamable $v0 = VL1RE8_V killed $x10 :: (load unknown-size from %stack.1, align 8)
140 ; CHECK-NEXT: $x10 = LD $x2, 8 :: (load (s64) from %stack.15)
141 ; CHECK-NEXT: renamable $v0 = PseudoVSLIDEDOWN_VX_M1 undef renamable $v0, killed renamable $v0, killed renamable $x13, $noreg, 3 /* e8 */, 1 /* ta, mu */, implicit $vl, implicit $vtype
142 ; CHECK-NEXT: renamable $x13 = PseudoVMV_X_S killed renamable $v0, 3 /* e8 */, implicit $vl, implicit $vtype
143 ; CHECK-NEXT: BLT killed renamable $x16, renamable $x27, %bb.2
146 ; CHECK-NEXT: successors: %bb.2(0x80000000)
147 ; CHECK-NEXT: liveins: $x1, $x5, $x6, $x7, $x9, $x10, $x11, $x12, $x13, $x14, $x15, $x17, $x18, $x19, $x20, $x21, $x22, $x23, $x24, $x25, $x26, $x27, $x28, $x29, $x30, $x31
149 ; CHECK-NEXT: renamable $x10 = COPY killed renamable $x13
150 ; CHECK-NEXT: PseudoBR %bb.2
153 ; CHECK-NEXT: $x2 = frame-destroy ADDI $x8, -2048
154 ; CHECK-NEXT: $x2 = frame-destroy ADDI killed $x2, -256
155 ; CHECK-NEXT: $x2 = frame-destroy ADDI $x2, 272
156 ; CHECK-NEXT: $x1 = LD $x2, 2024 :: (load (s64) from %stack.3)
157 ; CHECK-NEXT: $x8 = LD $x2, 2016 :: (load (s64) from %stack.4)
158 ; CHECK-NEXT: $x18 = LD $x2, 2008 :: (load (s64) from %stack.5)
159 ; CHECK-NEXT: $x19 = LD $x2, 2000 :: (load (s64) from %stack.6)
160 ; CHECK-NEXT: $x20 = LD $x2, 1992 :: (load (s64) from %stack.7)
161 ; CHECK-NEXT: $x21 = LD $x2, 1984 :: (load (s64) from %stack.8)
162 ; CHECK-NEXT: $x22 = LD $x2, 1976 :: (load (s64) from %stack.9)
163 ; CHECK-NEXT: $x23 = LD $x2, 1968 :: (load (s64) from %stack.10)
164 ; CHECK-NEXT: $x24 = LD $x2, 1960 :: (load (s64) from %stack.11)
165 ; CHECK-NEXT: $x25 = LD $x2, 1952 :: (load (s64) from %stack.12)
166 ; CHECK-NEXT: $x26 = LD $x2, 1944 :: (load (s64) from %stack.13)
167 ; CHECK-NEXT: $x27 = LD $x2, 1936 :: (load (s64) from %stack.14)
168 ; CHECK-NEXT: $x2 = frame-destroy ADDI $x2, 2032
169 ; CHECK-NEXT: PseudoRET
171 successors: %bb.1, %bb.2
174 dead renamable $x15 = PseudoVSETIVLI 1, 72, implicit-def $vl, implicit-def $vtype
175 renamable $v25 = PseudoVMV_V_X_M1 undef $v25, killed renamable $x12, $noreg, 4, 0, implicit $vl, implicit $vtype
176 VS1R_V killed renamable $v25, %stack.1 :: (store unknown-size into %stack.1, align 8)
177 renamable $x1 = ADDI $x0, 255
178 renamable $x5 = nuw ADDI %stack.0, 256
179 renamable $x6 = ADDI %stack.0, 384
180 renamable $x7 = nuw ADDI %stack.0, 512
181 renamable $x10 = ADDI $x0, 128
182 renamable $x12 = nuw ADDI %stack.0, 128
183 renamable $x14 = COPY $x0
184 renamable $x17 = nuw ADDI %stack.0, 128
185 renamable $x18 = ADDI %stack.0, 1152
186 renamable $x19 = ADDI %stack.0, 1280
187 renamable $x20 = ADDI %stack.0, 1408
188 renamable $x21 = ADDI %stack.0, 1536
189 renamable $x22 = ADDI %stack.0, 1664
190 renamable $x23 = ADDI %stack.0, 1792
191 renamable $x24 = ADDI %stack.0, 1920
192 renamable $x25 = ADDI %stack.0, 0
193 renamable $x26 = ADDI %stack.0, 0
194 renamable $x27 = ADDI $x0, 2
195 renamable $x28 = ADDI %stack.0, 640
196 renamable $x29 = ADDI %stack.0, 768
197 renamable $x30 = ADDI %stack.0, 896
198 renamable $x31 = nuw ADDI %stack.0, 1024
199 renamable $x15 = ADDIW renamable $x14, 0
200 renamable $x11 = ANDI renamable $x15, 255
201 renamable $x13 = SLLI renamable $x11, 3
202 renamable $x13 = ADD renamable $x26, killed renamable $x13
203 renamable $x13 = LD killed renamable $x13, 0 :: (load (s64))
204 renamable $x16 = SUB killed renamable $x13, renamable $x13
205 dead renamable $x13 = PseudoVSETIVLI 1, 64, implicit-def $vl, implicit-def $vtype
206 renamable $x13 = nsw ADDI renamable $x16, -2
207 renamable $v0 = VL1RE8_V %stack.1 :: (load unknown-size from %stack.1, align 8)
208 renamable $v0 = PseudoVSLIDEDOWN_VX_M1 undef renamable $v0, killed renamable $v0, killed renamable $x13, $noreg, 3, 1, implicit $vl, implicit $vtype
209 renamable $x13 = PseudoVMV_X_S killed renamable $v0, 3, implicit $vl, implicit $vtype
210 BLT killed renamable $x16, renamable $x27, %bb.2
214 liveins: $x1, $x5, $x6, $x7, $x9, $x10, $x11, $x12, $x13, $x14, $x15, $x17, $x18, $x19, $x20, $x21, $x22, $x23, $x24, $x25, $x26, $x27, $x28, $x29, $x30, $x31
216 renamable $x10 = COPY killed renamable $x13