1 # NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2 # RUN: llc -mtriple=riscv32 -run-pass=instruction-select %s -o - \
3 # RUN: -disable-gisel-legality-check | FileCheck %s
9 tracksRegLiveness: true
14 ; CHECK-LABEL: name: load_i8
15 ; CHECK: liveins: $x10
17 ; CHECK-NEXT: [[COPY:%[0-9]+]]:gpr = COPY $x10
18 ; CHECK-NEXT: [[LBU:%[0-9]+]]:gpr = LBU [[COPY]], 0 :: (load (s8))
19 ; CHECK-NEXT: $x10 = COPY [[LBU]]
20 ; CHECK-NEXT: PseudoRET implicit $x10
21 %0:gprb(p0) = COPY $x10
22 %1:gprb(s32) = G_LOAD %0(p0) :: (load (s8))
24 PseudoRET implicit $x10
31 tracksRegLiveness: true
36 ; CHECK-LABEL: name: load_i16
37 ; CHECK: liveins: $x10
39 ; CHECK-NEXT: [[COPY:%[0-9]+]]:gpr = COPY $x10
40 ; CHECK-NEXT: [[LH:%[0-9]+]]:gpr = LH [[COPY]], 0 :: (load (s16))
41 ; CHECK-NEXT: $x10 = COPY [[LH]]
42 ; CHECK-NEXT: PseudoRET implicit $x10
43 %0:gprb(p0) = COPY $x10
44 %1:gprb(s32) = G_LOAD %0(p0) :: (load (s16))
46 PseudoRET implicit $x10
53 tracksRegLiveness: true
58 ; CHECK-LABEL: name: load_i8_i16
59 ; CHECK: liveins: $x10
61 ; CHECK-NEXT: [[COPY:%[0-9]+]]:gpr = COPY $x10
62 ; CHECK-NEXT: [[LBU:%[0-9]+]]:gpr = LBU [[COPY]], 0 :: (load (s8))
63 ; CHECK-NEXT: $x10 = COPY [[LBU]]
64 ; CHECK-NEXT: PseudoRET implicit $x10
65 %0:gprb(p0) = COPY $x10
66 %1:gprb(s16) = G_LOAD %0(p0) :: (load (s8))
67 %2:gprb(s32) = G_ANYEXT %1
69 PseudoRET implicit $x10
76 tracksRegLiveness: true
81 ; CHECK-LABEL: name: load_i16_i16
82 ; CHECK: liveins: $x10
84 ; CHECK-NEXT: [[COPY:%[0-9]+]]:gpr = COPY $x10
85 ; CHECK-NEXT: [[LH:%[0-9]+]]:gpr = LH [[COPY]], 0 :: (load (s16))
86 ; CHECK-NEXT: $x10 = COPY [[LH]]
87 ; CHECK-NEXT: PseudoRET implicit $x10
88 %0:gprb(p0) = COPY $x10
89 %1:gprb(s16) = G_LOAD %0(p0) :: (load (s16))
90 %2:gprb(s32) = G_ANYEXT %1
92 PseudoRET implicit $x10
99 tracksRegLiveness: true
104 ; CHECK-LABEL: name: load_i32
105 ; CHECK: liveins: $x10
107 ; CHECK-NEXT: [[COPY:%[0-9]+]]:gpr = COPY $x10
108 ; CHECK-NEXT: [[LW:%[0-9]+]]:gpr = LW [[COPY]], 0 :: (load (s32))
109 ; CHECK-NEXT: $x10 = COPY [[LW]]
110 ; CHECK-NEXT: PseudoRET implicit $x10
111 %0:gprb(p0) = COPY $x10
112 %1:gprb(s32) = G_LOAD %0(p0) :: (load (s32))
114 PseudoRET implicit $x10
120 regBankSelected: true
121 tracksRegLiveness: true
126 ; CHECK-LABEL: name: zextload_i8
127 ; CHECK: liveins: $x10
129 ; CHECK-NEXT: [[COPY:%[0-9]+]]:gpr = COPY $x10
130 ; CHECK-NEXT: [[LBU:%[0-9]+]]:gpr = LBU [[COPY]], 0 :: (load (s8))
131 ; CHECK-NEXT: $x10 = COPY [[LBU]]
132 ; CHECK-NEXT: PseudoRET implicit $x10
133 %0:gprb(p0) = COPY $x10
134 %1:gprb(s32) = G_ZEXTLOAD %0(p0) :: (load (s8))
136 PseudoRET implicit $x10
142 regBankSelected: true
143 tracksRegLiveness: true
148 ; CHECK-LABEL: name: zextload_i16
149 ; CHECK: liveins: $x10
151 ; CHECK-NEXT: [[COPY:%[0-9]+]]:gpr = COPY $x10
152 ; CHECK-NEXT: [[LHU:%[0-9]+]]:gpr = LHU [[COPY]], 0 :: (load (s16))
153 ; CHECK-NEXT: $x10 = COPY [[LHU]]
154 ; CHECK-NEXT: PseudoRET implicit $x10
155 %0:gprb(p0) = COPY $x10
156 %1:gprb(s32) = G_ZEXTLOAD %0(p0) :: (load (s16))
158 PseudoRET implicit $x10
164 regBankSelected: true
165 tracksRegLiveness: true
170 ; CHECK-LABEL: name: sextload_i8
171 ; CHECK: liveins: $x10
173 ; CHECK-NEXT: [[COPY:%[0-9]+]]:gpr = COPY $x10
174 ; CHECK-NEXT: [[LB:%[0-9]+]]:gpr = LB [[COPY]], 0 :: (load (s8))
175 ; CHECK-NEXT: $x10 = COPY [[LB]]
176 ; CHECK-NEXT: PseudoRET implicit $x10
177 %0:gprb(p0) = COPY $x10
178 %1:gprb(s32) = G_SEXTLOAD %0(p0) :: (load (s8))
180 PseudoRET implicit $x10
186 regBankSelected: true
187 tracksRegLiveness: true
192 ; CHECK-LABEL: name: sextload_i16
193 ; CHECK: liveins: $x10
195 ; CHECK-NEXT: [[COPY:%[0-9]+]]:gpr = COPY $x10
196 ; CHECK-NEXT: [[LH:%[0-9]+]]:gpr = LH [[COPY]], 0 :: (load (s16))
197 ; CHECK-NEXT: $x10 = COPY [[LH]]
198 ; CHECK-NEXT: PseudoRET implicit $x10
199 %0:gprb(p0) = COPY $x10
200 %1:gprb(s32) = G_SEXTLOAD %0(p0) :: (load (s16))
202 PseudoRET implicit $x10
208 regBankSelected: true
209 tracksRegLiveness: true
214 ; CHECK-LABEL: name: load_p0
215 ; CHECK: liveins: $x10
217 ; CHECK-NEXT: [[COPY:%[0-9]+]]:gpr = COPY $x10
218 ; CHECK-NEXT: [[LW:%[0-9]+]]:gpr = LW [[COPY]], 0 :: (load (p0))
219 ; CHECK-NEXT: $x10 = COPY [[LW]]
220 ; CHECK-NEXT: PseudoRET implicit $x10
221 %0:gprb(p0) = COPY $x10
222 %1:gprb(p0) = G_LOAD %0(p0) :: (load (p0))
224 PseudoRET implicit $x10
230 regBankSelected: true
231 tracksRegLiveness: true
234 - { id: 0, offset: 0, size: 4, alignment: 4 }
238 ; CHECK-LABEL: name: load_fi_i32
239 ; CHECK: [[LW:%[0-9]+]]:gpr = LW %stack.0, 0 :: (load (s32))
240 ; CHECK-NEXT: $x10 = COPY [[LW]]
241 ; CHECK-NEXT: PseudoRET implicit $x10
242 %0:gprb(p0) = G_FRAME_INDEX %stack.0
243 %1:gprb(s32) = G_LOAD %0(p0) :: (load (s32))
245 PseudoRET implicit $x10
249 name: load_fi_gep_i32
251 regBankSelected: true
252 tracksRegLiveness: true
255 - { id: 0, offset: 0, size: 8, alignment: 4 }
259 ; CHECK-LABEL: name: load_fi_gep_i32
260 ; CHECK: [[LW:%[0-9]+]]:gpr = LW %stack.0, 4 :: (load (s32))
261 ; CHECK-NEXT: $x10 = COPY [[LW]]
262 ; CHECK-NEXT: PseudoRET implicit $x10
263 %0:gprb(p0) = G_FRAME_INDEX %stack.0
264 %1:gprb(s32) = G_CONSTANT i32 4
265 %2:gprb(p0) = G_PTR_ADD %0(p0), %1(s32)
266 %3:gprb(s32) = G_LOAD %2(p0) :: (load (s32))
268 PseudoRET implicit $x10
274 regBankSelected: true
275 tracksRegLiveness: true
280 ; CHECK-LABEL: name: load_gep_i32
281 ; CHECK: liveins: $x10
283 ; CHECK-NEXT: [[COPY:%[0-9]+]]:gpr = COPY $x10
284 ; CHECK-NEXT: [[LW:%[0-9]+]]:gpr = LW [[COPY]], 4 :: (load (s32))
285 ; CHECK-NEXT: $x10 = COPY [[LW]]
286 ; CHECK-NEXT: PseudoRET implicit $x10
287 %0:gprb(p0) = COPY $x10
288 %1:gprb(s32) = G_CONSTANT i32 4
289 %2:gprb(p0) = G_PTR_ADD %0(p0), %1(s32)
290 %3:gprb(s32) = G_LOAD %2(p0) :: (load (s32))
292 PseudoRET implicit $x10