1 # NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2 # RUN: llc -mtriple=riscv32 -run-pass=legalizer %s -o - \
11 ; CHECK-LABEL: name: zextload_i8_i16
12 ; CHECK: liveins: $x10
14 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(p0) = COPY $x10
15 ; CHECK-NEXT: [[ZEXTLOAD:%[0-9]+]]:_(s32) = G_ZEXTLOAD [[COPY]](p0) :: (load (s8))
16 ; CHECK-NEXT: $x10 = COPY [[ZEXTLOAD]](s32)
17 ; CHECK-NEXT: PseudoRET implicit $x10
19 %2:_(s16) = G_ZEXTLOAD %0(p0) :: (load (s8))
20 %3:_(s32) = G_ANYEXT %2(s16)
22 PseudoRET implicit $x10
31 ; CHECK-LABEL: name: zextload_i8_i32
32 ; CHECK: liveins: $x10
34 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(p0) = COPY $x10
35 ; CHECK-NEXT: [[ZEXTLOAD:%[0-9]+]]:_(s32) = G_ZEXTLOAD [[COPY]](p0) :: (load (s8))
36 ; CHECK-NEXT: $x10 = COPY [[ZEXTLOAD]](s32)
37 ; CHECK-NEXT: PseudoRET implicit $x10
39 %2:_(s32) = G_ZEXTLOAD %0(p0) :: (load (s8))
41 PseudoRET implicit $x10
45 name: zextload_i16_i32
50 ; CHECK-LABEL: name: zextload_i16_i32
51 ; CHECK: liveins: $x10
53 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(p0) = COPY $x10
54 ; CHECK-NEXT: [[ZEXTLOAD:%[0-9]+]]:_(s32) = G_ZEXTLOAD [[COPY]](p0) :: (load (s16))
55 ; CHECK-NEXT: $x10 = COPY [[ZEXTLOAD]](s32)
56 ; CHECK-NEXT: PseudoRET implicit $x10
58 %2:_(s32) = G_ZEXTLOAD %0(p0) :: (load (s16))
60 PseudoRET implicit $x10
69 ; CHECK-LABEL: name: zextload_i8_i64
70 ; CHECK: liveins: $x10
72 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(p0) = COPY $x10
73 ; CHECK-NEXT: [[ZEXTLOAD:%[0-9]+]]:_(s32) = G_ZEXTLOAD [[COPY]](p0) :: (load (s8))
74 ; CHECK-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 0
75 ; CHECK-NEXT: $x10 = COPY [[ZEXTLOAD]](s32)
76 ; CHECK-NEXT: $x11 = COPY [[C]](s32)
77 ; CHECK-NEXT: PseudoRET implicit $x10, implicit $x11
79 %2:_(s64) = G_ZEXTLOAD %0(p0) :: (load (s8))
80 %3:_(s32), %4:_(s32) = G_UNMERGE_VALUES %2(s64)
83 PseudoRET implicit $x10, implicit $x11
87 name: zextload_i16_i64
92 ; CHECK-LABEL: name: zextload_i16_i64
93 ; CHECK: liveins: $x10
95 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(p0) = COPY $x10
96 ; CHECK-NEXT: [[ZEXTLOAD:%[0-9]+]]:_(s32) = G_ZEXTLOAD [[COPY]](p0) :: (load (s16))
97 ; CHECK-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 0
98 ; CHECK-NEXT: $x10 = COPY [[ZEXTLOAD]](s32)
99 ; CHECK-NEXT: $x11 = COPY [[C]](s32)
100 ; CHECK-NEXT: PseudoRET implicit $x10, implicit $x11
102 %2:_(s64) = G_ZEXTLOAD %0(p0) :: (load (s16))
103 %3:_(s32), %4:_(s32) = G_UNMERGE_VALUES %2(s64)
106 PseudoRET implicit $x10, implicit $x11
110 name: zextload_i32_i64
115 ; CHECK-LABEL: name: zextload_i32_i64
116 ; CHECK: liveins: $x10
118 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(p0) = COPY $x10
119 ; CHECK-NEXT: [[LOAD:%[0-9]+]]:_(s32) = G_LOAD [[COPY]](p0) :: (load (s32))
120 ; CHECK-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 0
121 ; CHECK-NEXT: $x10 = COPY [[LOAD]](s32)
122 ; CHECK-NEXT: $x11 = COPY [[C]](s32)
123 ; CHECK-NEXT: PseudoRET implicit $x10, implicit $x11
125 %2:_(s64) = G_ZEXTLOAD %0(p0) :: (load (s32))
126 %3:_(s32), %4:_(s32) = G_UNMERGE_VALUES %2(s64)
129 PseudoRET implicit $x10, implicit $x11
133 name: sextload_i8_i16
138 ; CHECK-LABEL: name: sextload_i8_i16
139 ; CHECK: liveins: $x10
141 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(p0) = COPY $x10
142 ; CHECK-NEXT: [[SEXTLOAD:%[0-9]+]]:_(s32) = G_SEXTLOAD [[COPY]](p0) :: (load (s8))
143 ; CHECK-NEXT: $x10 = COPY [[SEXTLOAD]](s32)
144 ; CHECK-NEXT: PseudoRET implicit $x10
146 %2:_(s16) = G_SEXTLOAD %0(p0) :: (load (s8))
147 %3:_(s32) = G_ANYEXT %2(s16)
149 PseudoRET implicit $x10
153 name: sextload_i8_i32
158 ; CHECK-LABEL: name: sextload_i8_i32
159 ; CHECK: liveins: $x10
161 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(p0) = COPY $x10
162 ; CHECK-NEXT: [[SEXTLOAD:%[0-9]+]]:_(s32) = G_SEXTLOAD [[COPY]](p0) :: (load (s8))
163 ; CHECK-NEXT: $x10 = COPY [[SEXTLOAD]](s32)
164 ; CHECK-NEXT: PseudoRET implicit $x10
166 %2:_(s32) = G_SEXTLOAD %0(p0) :: (load (s8))
168 PseudoRET implicit $x10
172 name: sextload_i16_i32
177 ; CHECK-LABEL: name: sextload_i16_i32
178 ; CHECK: liveins: $x10
180 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(p0) = COPY $x10
181 ; CHECK-NEXT: [[SEXTLOAD:%[0-9]+]]:_(s32) = G_SEXTLOAD [[COPY]](p0) :: (load (s16))
182 ; CHECK-NEXT: $x10 = COPY [[SEXTLOAD]](s32)
183 ; CHECK-NEXT: PseudoRET implicit $x10
185 %2:_(s32) = G_SEXTLOAD %0(p0) :: (load (s16))
187 PseudoRET implicit $x10
191 name: sextload_i8_i64
196 ; CHECK-LABEL: name: sextload_i8_i64
197 ; CHECK: liveins: $x10
199 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(p0) = COPY $x10
200 ; CHECK-NEXT: [[SEXTLOAD:%[0-9]+]]:_(s32) = G_SEXTLOAD [[COPY]](p0) :: (load (s8))
201 ; CHECK-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 31
202 ; CHECK-NEXT: [[ASHR:%[0-9]+]]:_(s32) = G_ASHR [[SEXTLOAD]], [[C]](s32)
203 ; CHECK-NEXT: $x10 = COPY [[SEXTLOAD]](s32)
204 ; CHECK-NEXT: $x11 = COPY [[ASHR]](s32)
205 ; CHECK-NEXT: PseudoRET implicit $x10, implicit $x11
207 %2:_(s64) = G_SEXTLOAD %0(p0) :: (load (s8))
208 %3:_(s32), %4:_(s32) = G_UNMERGE_VALUES %2(s64)
211 PseudoRET implicit $x10, implicit $x11
215 name: sextload_i16_i64
220 ; CHECK-LABEL: name: sextload_i16_i64
221 ; CHECK: liveins: $x10
223 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(p0) = COPY $x10
224 ; CHECK-NEXT: [[SEXTLOAD:%[0-9]+]]:_(s32) = G_SEXTLOAD [[COPY]](p0) :: (load (s16))
225 ; CHECK-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 31
226 ; CHECK-NEXT: [[ASHR:%[0-9]+]]:_(s32) = G_ASHR [[SEXTLOAD]], [[C]](s32)
227 ; CHECK-NEXT: $x10 = COPY [[SEXTLOAD]](s32)
228 ; CHECK-NEXT: $x11 = COPY [[ASHR]](s32)
229 ; CHECK-NEXT: PseudoRET implicit $x10, implicit $x11
231 %2:_(s64) = G_SEXTLOAD %0(p0) :: (load (s16))
232 %3:_(s32), %4:_(s32) = G_UNMERGE_VALUES %2(s64)
235 PseudoRET implicit $x10, implicit $x11
239 name: sextload_i32_i64
244 ; CHECK-LABEL: name: sextload_i32_i64
245 ; CHECK: liveins: $x10
247 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(p0) = COPY $x10
248 ; CHECK-NEXT: [[LOAD:%[0-9]+]]:_(s32) = G_LOAD [[COPY]](p0) :: (load (s32))
249 ; CHECK-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 31
250 ; CHECK-NEXT: [[ASHR:%[0-9]+]]:_(s32) = G_ASHR [[LOAD]], [[C]](s32)
251 ; CHECK-NEXT: $x10 = COPY [[LOAD]](s32)
252 ; CHECK-NEXT: $x11 = COPY [[ASHR]](s32)
253 ; CHECK-NEXT: PseudoRET implicit $x10, implicit $x11
255 %2:_(s64) = G_SEXTLOAD %0(p0) :: (load (s32))
256 %3:_(s32), %4:_(s32) = G_UNMERGE_VALUES %2(s64)
259 PseudoRET implicit $x10, implicit $x11