1 # NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2 # RUN: llc -mtriple=riscv64 -run-pass=instruction-select %s -o - \
6 define void @store_i8_i64(i8 %val, ptr %addr) { ret void }
7 define void @store_i16_i64(i16 %val, ptr %addr) { ret void }
8 define void @store_i32_i64(i32 %val, ptr %addr) { ret void }
9 define void @store_i64_i64(i32 %val, ptr %addr) { ret void }
10 define void @store_p0(ptr %val, ptr %addr) { ret void }
11 define void @truncstore_i8_i32(i8 %val, ptr %addr) { ret void }
12 define void @truncstore_i16_i32(i8 %val, ptr %addr) { ret void }
13 define void @store_i32_i32(i8 %val, ptr %addr) { ret void }
14 define void @store_fi_i64_i64(ptr %val) {
18 define void @store_fi_gep_i64_i64(ptr %val) {
19 %ptr0 = alloca [2 x i64]
22 define void @store_gep_i64_i64(i32 %val, ptr %addr) { ret void }
28 tracksRegLiveness: true
33 ; CHECK-LABEL: name: store_i8_i64
34 ; CHECK: liveins: $x10, $x11
36 ; CHECK-NEXT: [[COPY:%[0-9]+]]:gpr = COPY $x10
37 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:gpr = COPY $x11
38 ; CHECK-NEXT: SB [[COPY]], [[COPY1]], 0 :: (store (s8))
39 ; CHECK-NEXT: PseudoRET
40 %0:gprb(s64) = COPY $x10
41 %1:gprb(p0) = COPY $x11
42 G_STORE %0(s64), %1(p0) :: (store (s8))
50 tracksRegLiveness: true
55 ; CHECK-LABEL: name: store_i16_i64
56 ; CHECK: liveins: $x10, $x11
58 ; CHECK-NEXT: [[COPY:%[0-9]+]]:gpr = COPY $x10
59 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:gpr = COPY $x11
60 ; CHECK-NEXT: SH [[COPY]], [[COPY1]], 0 :: (store (s16))
61 ; CHECK-NEXT: PseudoRET
62 %0:gprb(s64) = COPY $x10
63 %1:gprb(p0) = COPY $x11
64 G_STORE %0(s64), %1(p0) :: (store (s16))
72 tracksRegLiveness: true
77 ; CHECK-LABEL: name: store_i32_i64
78 ; CHECK: liveins: $x10, $x11
80 ; CHECK-NEXT: [[COPY:%[0-9]+]]:gpr = COPY $x10
81 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:gpr = COPY $x11
82 ; CHECK-NEXT: SW [[COPY]], [[COPY1]], 0 :: (store (s32))
83 ; CHECK-NEXT: PseudoRET
84 %0:gprb(s64) = COPY $x10
85 %1:gprb(p0) = COPY $x11
86 G_STORE %0(s64), %1(p0) :: (store (s32))
94 tracksRegLiveness: true
99 ; CHECK-LABEL: name: store_i64_i64
100 ; CHECK: liveins: $x10, $x11
102 ; CHECK-NEXT: [[COPY:%[0-9]+]]:gpr = COPY $x10
103 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:gpr = COPY $x11
104 ; CHECK-NEXT: SD [[COPY]], [[COPY1]], 0 :: (store (s64))
105 ; CHECK-NEXT: PseudoRET
106 %0:gprb(s64) = COPY $x10
107 %1:gprb(p0) = COPY $x11
108 G_STORE %0(s64), %1(p0) :: (store (s64))
115 regBankSelected: true
116 tracksRegLiveness: true
121 ; CHECK-LABEL: name: store_p0
122 ; CHECK: liveins: $x10, $x11
124 ; CHECK-NEXT: [[COPY:%[0-9]+]]:gpr = COPY $x10
125 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:gpr = COPY $x11
126 ; CHECK-NEXT: SD [[COPY]], [[COPY1]], 0 :: (store (p0))
127 ; CHECK-NEXT: PseudoRET
128 %0:gprb(p0) = COPY $x10
129 %1:gprb(p0) = COPY $x11
130 G_STORE %0(p0), %1(p0) :: (store (p0))
135 name: truncstore_i8_i32
137 regBankSelected: true
138 tracksRegLiveness: true
141 liveins: $x10, $x11, $x12
143 ; CHECK-LABEL: name: truncstore_i8_i32
144 ; CHECK: liveins: $x10, $x11, $x12
146 ; CHECK-NEXT: [[COPY:%[0-9]+]]:gpr = COPY $x10
147 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:gpr = COPY $x11
148 ; CHECK-NEXT: [[COPY2:%[0-9]+]]:gpr = COPY $x12
149 ; CHECK-NEXT: [[ADDW:%[0-9]+]]:gpr = ADDW [[COPY1]], [[COPY2]]
150 ; CHECK-NEXT: SB [[ADDW]], [[COPY]], 0 :: (store (s8))
151 ; CHECK-NEXT: [[COPY3:%[0-9]+]]:gpr = COPY $x0
152 ; CHECK-NEXT: $x10 = COPY [[COPY3]]
153 ; CHECK-NEXT: PseudoRET implicit $x10
154 %0:gprb(p0) = COPY $x10
155 %3:gprb(s64) = COPY $x11
156 %4:gprb(s64) = COPY $x12
157 %9:gprb(s32) = G_TRUNC %3(s64)
158 %10:gprb(s32) = G_TRUNC %4(s64)
159 %11:gprb(s32) = G_ADD %9, %10
160 G_STORE %11(s32), %0(p0) :: (store (s8))
161 %7:gprb(s64) = G_CONSTANT i64 0
163 PseudoRET implicit $x10
167 name: truncstore_i16_i32
169 regBankSelected: true
170 tracksRegLiveness: true
173 liveins: $x10, $x11, $x12
175 ; CHECK-LABEL: name: truncstore_i16_i32
176 ; CHECK: liveins: $x10, $x11, $x12
178 ; CHECK-NEXT: [[COPY:%[0-9]+]]:gpr = COPY $x10
179 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:gpr = COPY $x11
180 ; CHECK-NEXT: [[COPY2:%[0-9]+]]:gpr = COPY $x12
181 ; CHECK-NEXT: [[ADDW:%[0-9]+]]:gpr = ADDW [[COPY1]], [[COPY2]]
182 ; CHECK-NEXT: SH [[ADDW]], [[COPY]], 0 :: (store (s16))
183 ; CHECK-NEXT: [[COPY3:%[0-9]+]]:gpr = COPY $x0
184 ; CHECK-NEXT: $x10 = COPY [[COPY3]]
185 ; CHECK-NEXT: PseudoRET implicit $x10
186 %0:gprb(p0) = COPY $x10
187 %3:gprb(s64) = COPY $x11
188 %4:gprb(s64) = COPY $x12
189 %9:gprb(s32) = G_TRUNC %3(s64)
190 %10:gprb(s32) = G_TRUNC %4(s64)
191 %11:gprb(s32) = G_ADD %9, %10
192 G_STORE %11(s32), %0(p0) :: (store (s16))
193 %7:gprb(s64) = G_CONSTANT i64 0
195 PseudoRET implicit $x10
201 regBankSelected: true
202 tracksRegLiveness: true
205 liveins: $x10, $x11, $x12
207 ; CHECK-LABEL: name: store_i32_i32
208 ; CHECK: liveins: $x10, $x11, $x12
210 ; CHECK-NEXT: [[COPY:%[0-9]+]]:gpr = COPY $x10
211 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:gpr = COPY $x11
212 ; CHECK-NEXT: [[COPY2:%[0-9]+]]:gpr = COPY $x12
213 ; CHECK-NEXT: [[ADDW:%[0-9]+]]:gpr = ADDW [[COPY1]], [[COPY2]]
214 ; CHECK-NEXT: SW [[ADDW]], [[COPY]], 0 :: (store (s32))
215 ; CHECK-NEXT: [[COPY3:%[0-9]+]]:gpr = COPY $x0
216 ; CHECK-NEXT: $x10 = COPY [[COPY3]]
217 ; CHECK-NEXT: PseudoRET implicit $x10
218 %0:gprb(p0) = COPY $x10
219 %3:gprb(s64) = COPY $x11
220 %4:gprb(s64) = COPY $x12
221 %9:gprb(s32) = G_TRUNC %3(s64)
222 %10:gprb(s32) = G_TRUNC %4(s64)
223 %11:gprb(s32) = G_ADD %9, %10
224 G_STORE %11(s32), %0(p0) :: (store (s32))
225 %7:gprb(s64) = G_CONSTANT i64 0
227 PseudoRET implicit $x10
231 name: store_fi_i64_i64
233 regBankSelected: true
234 tracksRegLiveness: true
237 - { id: 0, name: ptr0, offset: 0, size: 8, alignment: 8 }
243 ; CHECK-LABEL: name: store_fi_i64_i64
244 ; CHECK: liveins: $x10
246 ; CHECK-NEXT: [[COPY:%[0-9]+]]:gpr = COPY $x10
247 ; CHECK-NEXT: SD [[COPY]], %stack.0.ptr0, 0 :: (store (s64))
248 ; CHECK-NEXT: PseudoRET
249 %0:gprb(s64) = COPY $x10
250 %1:gprb(p0) = G_FRAME_INDEX %stack.0.ptr0
251 G_STORE %0(s64), %1(p0) :: (store (s64))
256 name: store_fi_gep_i64_i64
258 regBankSelected: true
259 tracksRegLiveness: true
262 - { id: 0, name: ptr0, offset: 0, size: 16, alignment: 8 }
268 ; CHECK-LABEL: name: store_fi_gep_i64_i64
269 ; CHECK: liveins: $x10
271 ; CHECK-NEXT: [[COPY:%[0-9]+]]:gpr = COPY $x10
272 ; CHECK-NEXT: SD [[COPY]], %stack.0.ptr0, 8 :: (store (s64))
273 ; CHECK-NEXT: PseudoRET
274 %0:gprb(s64) = COPY $x10
275 %1:gprb(p0) = G_FRAME_INDEX %stack.0.ptr0
276 %2:gprb(s64) = G_CONSTANT i64 8
277 %3:gprb(p0) = G_PTR_ADD %1(p0), %2(s64)
278 G_STORE %0(s64), %3(p0) :: (store (s64))
283 name: store_gep_i64_i64
285 regBankSelected: true
286 tracksRegLiveness: true
291 ; CHECK-LABEL: name: store_gep_i64_i64
292 ; CHECK: liveins: $x10, $x11
294 ; CHECK-NEXT: [[COPY:%[0-9]+]]:gpr = COPY $x10
295 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:gpr = COPY $x11
296 ; CHECK-NEXT: SD [[COPY]], [[COPY1]], 8 :: (store (s64))
297 ; CHECK-NEXT: PseudoRET
298 %0:gprb(s64) = COPY $x10
299 %1:gprb(p0) = COPY $x11
300 %2:gprb(s64) = G_CONSTANT i64 8
301 %3:gprb(p0) = G_PTR_ADD %1(p0), %2(s64)
302 G_STORE %0(s64), %3(p0) :: (store (s64))