1 # NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2 # RUN: llc -mtriple=riscv64 -run-pass=regbankselect \
3 # RUN: -disable-gisel-legality-check -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
126 %3:_(s32) = G_ZEXTLOAD %0(p0) :: (load (s8))
127 %2:_(s64) = G_ANYEXT %3(s32)
129 PseudoRET implicit $x10
135 tracksRegLiveness: true
140 ; RV64I-LABEL: name: zextload_i16
141 ; RV64I: liveins: $x10
143 ; RV64I-NEXT: [[COPY:%[0-9]+]]:gprb(p0) = COPY $x10
144 ; RV64I-NEXT: [[ZEXTLOAD:%[0-9]+]]:gprb(s32) = G_ZEXTLOAD [[COPY]](p0) :: (load (s16))
145 ; RV64I-NEXT: [[ANYEXT:%[0-9]+]]:gprb(s64) = G_ANYEXT [[ZEXTLOAD]](s32)
146 ; RV64I-NEXT: $x10 = COPY [[ANYEXT]](s64)
147 ; RV64I-NEXT: PseudoRET implicit $x10
149 %3:_(s32) = G_ZEXTLOAD %0(p0) :: (load (s16))
150 %2:_(s64) = G_ANYEXT %3(s32)
152 PseudoRET implicit $x10
158 tracksRegLiveness: true
163 ; RV64I-LABEL: name: zextload_i32
164 ; RV64I: liveins: $x10
166 ; RV64I-NEXT: [[COPY:%[0-9]+]]:gprb(p0) = COPY $x10
167 ; RV64I-NEXT: [[ZEXTLOAD:%[0-9]+]]:gprb(s64) = G_ZEXTLOAD [[COPY]](p0) :: (load (s32))
168 ; RV64I-NEXT: $x10 = COPY [[ZEXTLOAD]](s64)
169 ; RV64I-NEXT: PseudoRET implicit $x10
171 %1:_(s64) = G_ZEXTLOAD %0(p0) :: (load (s32))
173 PseudoRET implicit $x10
179 tracksRegLiveness: true
185 %3:_(s32) = G_SEXTLOAD %0(p0) :: (load (s8))
186 %2:_(s64) = G_ANYEXT %3(s32)
188 PseudoRET implicit $x10
194 tracksRegLiveness: true
199 ; RV64I-LABEL: name: sextload_i16
200 ; RV64I: liveins: $x10
202 ; RV64I-NEXT: [[COPY:%[0-9]+]]:gprb(p0) = COPY $x10
203 ; RV64I-NEXT: [[SEXTLOAD:%[0-9]+]]:gprb(s32) = G_SEXTLOAD [[COPY]](p0) :: (load (s16))
204 ; RV64I-NEXT: [[ANYEXT:%[0-9]+]]:gprb(s64) = G_ANYEXT [[SEXTLOAD]](s32)
205 ; RV64I-NEXT: $x10 = COPY [[ANYEXT]](s64)
206 ; RV64I-NEXT: PseudoRET implicit $x10
208 %3:_(s32) = G_SEXTLOAD %0(p0) :: (load (s16))
209 %2:_(s64) = G_ANYEXT %3(s32)
211 PseudoRET implicit $x10
217 tracksRegLiveness: true
222 ; RV64I-LABEL: name: sextload_i32
223 ; RV64I: liveins: $x10
225 ; RV64I-NEXT: [[COPY:%[0-9]+]]:gprb(p0) = COPY $x10
226 ; RV64I-NEXT: [[SEXTLOAD:%[0-9]+]]:gprb(s64) = G_SEXTLOAD [[COPY]](p0) :: (load (s32))
227 ; RV64I-NEXT: $x10 = COPY [[SEXTLOAD]](s64)
228 ; RV64I-NEXT: PseudoRET implicit $x10
230 %1:_(s64) = G_SEXTLOAD %0(p0) :: (load (s32))
232 PseudoRET implicit $x10