1 # NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2 # RUN: llc -mtriple=riscv64 -run-pass=regbankselect \
3 # RUN: -simplify-mir -verify-machineinstrs %s \
4 # RUN: -o - | FileCheck -check-prefix=RV64I %s
9 tracksRegLiveness: true
14 ; RV64I-LABEL: name: load_i8
15 ; RV64I: liveins: $x10
17 ; RV64I-NEXT: [[COPY:%[0-9]+]]:gprb(p0) = COPY $x10
18 ; RV64I-NEXT: [[LOAD:%[0-9]+]]:gprb(s32) = G_LOAD [[COPY]](p0) :: (load (s8))
19 ; RV64I-NEXT: [[ANYEXT:%[0-9]+]]:gprb(s64) = G_ANYEXT [[LOAD]](s32)
20 ; RV64I-NEXT: $x10 = COPY [[ANYEXT]](s64)
21 ; RV64I-NEXT: PseudoRET implicit $x10
23 %3:_(s32) = G_LOAD %0(p0) :: (load (s8))
24 %2:_(s64) = G_ANYEXT %3(s32)
26 PseudoRET implicit $x10
32 tracksRegLiveness: true
37 ; RV64I-LABEL: name: load_i16
38 ; RV64I: liveins: $x10
40 ; RV64I-NEXT: [[COPY:%[0-9]+]]:gprb(p0) = COPY $x10
41 ; RV64I-NEXT: [[LOAD:%[0-9]+]]:gprb(s32) = G_LOAD [[COPY]](p0) :: (load (s16))
42 ; RV64I-NEXT: [[ANYEXT:%[0-9]+]]:gprb(s64) = G_ANYEXT [[LOAD]](s32)
43 ; RV64I-NEXT: $x10 = COPY [[ANYEXT]](s64)
44 ; RV64I-NEXT: PseudoRET implicit $x10
46 %3:_(s32) = G_LOAD %0(p0) :: (load (s16))
47 %2:_(s64) = G_ANYEXT %3(s32)
49 PseudoRET implicit $x10
55 tracksRegLiveness: true
60 ; RV64I-LABEL: name: load_i32
61 ; RV64I: liveins: $x10
63 ; RV64I-NEXT: [[COPY:%[0-9]+]]:gprb(p0) = COPY $x10
64 ; RV64I-NEXT: [[LOAD:%[0-9]+]]:gprb(s32) = G_LOAD [[COPY]](p0) :: (load (s32))
65 ; RV64I-NEXT: [[ANYEXT:%[0-9]+]]:gprb(s64) = G_ANYEXT [[LOAD]](s32)
66 ; RV64I-NEXT: $x10 = COPY [[ANYEXT]](s64)
67 ; RV64I-NEXT: PseudoRET implicit $x10
69 %1:_(s32) = G_LOAD %0(p0) :: (load (s32))
70 %2:_(s64) = G_ANYEXT %1(s32)
72 PseudoRET implicit $x10
78 tracksRegLiveness: true
83 ; RV64I-LABEL: name: load_i64
84 ; RV64I: liveins: $x10
86 ; RV64I-NEXT: [[COPY:%[0-9]+]]:gprb(p0) = COPY $x10
87 ; RV64I-NEXT: [[LOAD:%[0-9]+]]:gprb(s64) = G_LOAD [[COPY]](p0) :: (load (s64))
88 ; RV64I-NEXT: $x10 = COPY [[LOAD]](s64)
89 ; RV64I-NEXT: PseudoRET implicit $x10
91 %1:_(s64) = G_LOAD %0(p0) :: (load (s64))
93 PseudoRET implicit $x10
99 tracksRegLiveness: true
104 ; RV64I-LABEL: name: load_ptr
105 ; RV64I: liveins: $x10
107 ; RV64I-NEXT: [[COPY:%[0-9]+]]:gprb(p0) = COPY $x10
108 ; RV64I-NEXT: [[LOAD:%[0-9]+]]:gprb(p0) = G_LOAD [[COPY]](p0) :: (load (p0))
109 ; RV64I-NEXT: $x10 = COPY [[LOAD]](p0)
110 ; RV64I-NEXT: PseudoRET implicit $x10
112 %1:_(p0) = G_LOAD %0(p0) :: (load (p0))
114 PseudoRET implicit $x10
120 tracksRegLiveness: true
125 ; RV64I-LABEL: name: zextload_i8
126 ; RV64I: liveins: $x10
128 ; RV64I-NEXT: [[COPY:%[0-9]+]]:gprb(p0) = COPY $x10
129 ; RV64I-NEXT: [[ZEXTLOAD:%[0-9]+]]:gprb(s64) = G_ZEXTLOAD [[COPY]](p0) :: (load (s8))
130 ; RV64I-NEXT: $x10 = COPY [[ZEXTLOAD]](s64)
131 ; RV64I-NEXT: PseudoRET implicit $x10
133 %3:_(s64) = G_ZEXTLOAD %0(p0) :: (load (s8))
135 PseudoRET implicit $x10
141 tracksRegLiveness: true
146 ; RV64I-LABEL: name: zextload_i16
147 ; RV64I: liveins: $x10
149 ; RV64I-NEXT: [[COPY:%[0-9]+]]:gprb(p0) = COPY $x10
150 ; RV64I-NEXT: [[ZEXTLOAD:%[0-9]+]]:gprb(s64) = G_ZEXTLOAD [[COPY]](p0) :: (load (s16))
151 ; RV64I-NEXT: $x10 = COPY [[ZEXTLOAD]](s64)
152 ; RV64I-NEXT: PseudoRET implicit $x10
154 %3:_(s64) = G_ZEXTLOAD %0(p0) :: (load (s16))
156 PseudoRET implicit $x10
162 tracksRegLiveness: true
167 ; RV64I-LABEL: name: zextload_i32
168 ; RV64I: liveins: $x10
170 ; RV64I-NEXT: [[COPY:%[0-9]+]]:gprb(p0) = COPY $x10
171 ; RV64I-NEXT: [[ZEXTLOAD:%[0-9]+]]:gprb(s64) = G_ZEXTLOAD [[COPY]](p0) :: (load (s32))
172 ; RV64I-NEXT: $x10 = COPY [[ZEXTLOAD]](s64)
173 ; RV64I-NEXT: PseudoRET implicit $x10
175 %1:_(s64) = G_ZEXTLOAD %0(p0) :: (load (s32))
177 PseudoRET implicit $x10
183 tracksRegLiveness: true
188 ; RV64I-LABEL: name: sextload_i8
189 ; RV64I: liveins: $x10
191 ; RV64I-NEXT: [[COPY:%[0-9]+]]:gprb(p0) = COPY $x10
192 ; RV64I-NEXT: [[SEXTLOAD:%[0-9]+]]:gprb(s64) = G_SEXTLOAD [[COPY]](p0) :: (load (s8))
193 ; RV64I-NEXT: $x10 = COPY [[SEXTLOAD]](s64)
194 ; RV64I-NEXT: PseudoRET implicit $x10
196 %3:_(s64) = G_SEXTLOAD %0(p0) :: (load (s8))
198 PseudoRET implicit $x10
204 tracksRegLiveness: true
209 ; RV64I-LABEL: name: sextload_i16
210 ; RV64I: liveins: $x10
212 ; RV64I-NEXT: [[COPY:%[0-9]+]]:gprb(p0) = COPY $x10
213 ; RV64I-NEXT: [[SEXTLOAD:%[0-9]+]]:gprb(s64) = G_SEXTLOAD [[COPY]](p0) :: (load (s16))
214 ; RV64I-NEXT: $x10 = COPY [[SEXTLOAD]](s64)
215 ; RV64I-NEXT: PseudoRET implicit $x10
217 %3:_(s64) = G_SEXTLOAD %0(p0) :: (load (s16))
219 PseudoRET implicit $x10
225 tracksRegLiveness: true
230 ; RV64I-LABEL: name: sextload_i32
231 ; RV64I: liveins: $x10
233 ; RV64I-NEXT: [[COPY:%[0-9]+]]:gprb(p0) = COPY $x10
234 ; RV64I-NEXT: [[SEXTLOAD:%[0-9]+]]:gprb(s64) = G_SEXTLOAD [[COPY]](p0) :: (load (s32))
235 ; RV64I-NEXT: $x10 = COPY [[SEXTLOAD]](s64)
236 ; RV64I-NEXT: PseudoRET implicit $x10
238 %1:_(s64) = G_SEXTLOAD %0(p0) :: (load (s32))
240 PseudoRET implicit $x10