1 # NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2 # RUN: llc -O0 -mtriple=mipsel-linux-gnu -run-pass=legalizer -verify-machineinstrs %s -o - | FileCheck %s -check-prefixes=MIPS32
5 define void @load1_s8_to_zextLoad1_s32(ptr %px) {entry: ret void}
6 define void @load2_s16_to_zextLoad2_s32(ptr %px) {entry: ret void}
7 define void @load1_s8_to_zextLoad1_s16(ptr %px) {entry: ret void}
8 define void @load1_s8_to_zextLoad1_s16_to_zextLoad1_s32(ptr %px) {entry: ret void}
9 define void @load4_s32_to_zextLoad4_s64(ptr %px) {entry: ret void}
10 define void @load1_s8_to_sextLoad1_s32(ptr %px) {entry: ret void}
11 define void @load2_s16_to_sextLoad2_s32(ptr %px) {entry: ret void}
12 define void @load1_s8_to_sextLoad1_s16(ptr %px) {entry: ret void}
13 define void @load1_s8_to_sextLoad1_s16_to_sextLoad1_s32(ptr %px) {entry: ret void}
14 define void @load4_s32_to_sextLoad4_s64(ptr %px) {entry: ret void}
18 name: load1_s8_to_zextLoad1_s32
20 tracksRegLiveness: true
25 ; MIPS32-LABEL: name: load1_s8_to_zextLoad1_s32
26 ; MIPS32: liveins: $a0
27 ; MIPS32: [[COPY:%[0-9]+]]:_(p0) = COPY $a0
28 ; MIPS32: [[ZEXTLOAD:%[0-9]+]]:_(s32) = G_ZEXTLOAD [[COPY]](p0) :: (load (s8) from %ir.px)
29 ; MIPS32: $v0 = COPY [[ZEXTLOAD]](s32)
30 ; MIPS32: RetRA implicit $v0
32 %2:_(s32) = G_ZEXTLOAD %0(p0) :: (load (s8) from %ir.px)
38 name: load2_s16_to_zextLoad2_s32
40 tracksRegLiveness: true
45 ; MIPS32-LABEL: name: load2_s16_to_zextLoad2_s32
46 ; MIPS32: liveins: $a0
47 ; MIPS32: [[COPY:%[0-9]+]]:_(p0) = COPY $a0
48 ; MIPS32: [[ZEXTLOAD:%[0-9]+]]:_(s32) = G_ZEXTLOAD [[COPY]](p0) :: (load (s16) from %ir.px)
49 ; MIPS32: $v0 = COPY [[ZEXTLOAD]](s32)
50 ; MIPS32: RetRA implicit $v0
52 %2:_(s32) = G_ZEXTLOAD %0(p0) :: (load (s16) from %ir.px)
58 name: load1_s8_to_zextLoad1_s16
60 tracksRegLiveness: true
65 ; MIPS32-LABEL: name: load1_s8_to_zextLoad1_s16
66 ; MIPS32: liveins: $a0
67 ; MIPS32: [[COPY:%[0-9]+]]:_(p0) = COPY $a0
68 ; MIPS32: [[ZEXTLOAD:%[0-9]+]]:_(s32) = G_ZEXTLOAD [[COPY]](p0) :: (load (s8) from %ir.px)
69 ; MIPS32: $v0 = COPY [[ZEXTLOAD]](s32)
70 ; MIPS32: RetRA implicit $v0
72 %2:_(s16) = G_ZEXTLOAD %0(p0) :: (load (s8) from %ir.px)
73 %3:_(s32) = G_ANYEXT %2(s16)
79 name: load1_s8_to_zextLoad1_s16_to_zextLoad1_s32
81 tracksRegLiveness: true
86 ; MIPS32-LABEL: name: load1_s8_to_zextLoad1_s16_to_zextLoad1_s32
87 ; MIPS32: liveins: $a0
88 ; MIPS32: [[COPY:%[0-9]+]]:_(p0) = COPY $a0
89 ; MIPS32: [[ZEXTLOAD:%[0-9]+]]:_(s32) = G_ZEXTLOAD [[COPY]](p0) :: (load (s8) from %ir.px)
90 ; MIPS32: $v0 = COPY [[ZEXTLOAD]](s32)
91 ; MIPS32: RetRA implicit $v0
93 %3:_(s32) = G_ZEXTLOAD %0(p0) :: (load (s8) from %ir.px)
99 name: load4_s32_to_zextLoad4_s64
101 tracksRegLiveness: true
106 ; MIPS32-LABEL: name: load4_s32_to_zextLoad4_s64
107 ; MIPS32: liveins: $a0
108 ; MIPS32: [[COPY:%[0-9]+]]:_(p0) = COPY $a0
109 ; MIPS32: [[LOAD:%[0-9]+]]:_(s32) = G_LOAD [[COPY]](p0) :: (load (s32) from %ir.px)
110 ; MIPS32: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 0
111 ; MIPS32: $v0 = COPY [[LOAD]](s32)
112 ; MIPS32: $v1 = COPY [[C]](s32)
113 ; MIPS32: RetRA implicit $v0, implicit $v1
115 %2:_(s64) = G_ZEXTLOAD %0(p0) :: (load (s32) from %ir.px)
116 %3:_(s32), %4:_(s32) = G_UNMERGE_VALUES %2(s64)
119 RetRA implicit $v0, implicit $v1
123 name: load1_s8_to_sextLoad1_s32
125 tracksRegLiveness: true
130 ; MIPS32-LABEL: name: load1_s8_to_sextLoad1_s32
131 ; MIPS32: liveins: $a0
132 ; MIPS32: [[COPY:%[0-9]+]]:_(p0) = COPY $a0
133 ; MIPS32: [[SEXTLOAD:%[0-9]+]]:_(s32) = G_SEXTLOAD [[COPY]](p0) :: (load (s8) from %ir.px)
134 ; MIPS32: $v0 = COPY [[SEXTLOAD]](s32)
135 ; MIPS32: RetRA implicit $v0
137 %2:_(s32) = G_SEXTLOAD %0(p0) :: (load (s8) from %ir.px)
143 name: load2_s16_to_sextLoad2_s32
145 tracksRegLiveness: true
150 ; MIPS32-LABEL: name: load2_s16_to_sextLoad2_s32
151 ; MIPS32: liveins: $a0
152 ; MIPS32: [[COPY:%[0-9]+]]:_(p0) = COPY $a0
153 ; MIPS32: [[SEXTLOAD:%[0-9]+]]:_(s32) = G_SEXTLOAD [[COPY]](p0) :: (load (s16) from %ir.px)
154 ; MIPS32: $v0 = COPY [[SEXTLOAD]](s32)
155 ; MIPS32: RetRA implicit $v0
157 %2:_(s32) = G_SEXTLOAD %0(p0) :: (load (s16) from %ir.px)
163 name: load1_s8_to_sextLoad1_s16
165 tracksRegLiveness: true
170 ; MIPS32-LABEL: name: load1_s8_to_sextLoad1_s16
171 ; MIPS32: liveins: $a0
172 ; MIPS32: [[COPY:%[0-9]+]]:_(p0) = COPY $a0
173 ; MIPS32: [[SEXTLOAD:%[0-9]+]]:_(s32) = G_SEXTLOAD [[COPY]](p0) :: (load (s8) from %ir.px)
174 ; MIPS32: $v0 = COPY [[SEXTLOAD]](s32)
175 ; MIPS32: RetRA implicit $v0
177 %2:_(s16) = G_SEXTLOAD %0(p0) :: (load (s8) from %ir.px)
178 %3:_(s32) = G_ANYEXT %2(s16)
184 name: load1_s8_to_sextLoad1_s16_to_sextLoad1_s32
186 tracksRegLiveness: true
191 ; MIPS32-LABEL: name: load1_s8_to_sextLoad1_s16_to_sextLoad1_s32
192 ; MIPS32: liveins: $a0
193 ; MIPS32: [[COPY:%[0-9]+]]:_(p0) = COPY $a0
194 ; MIPS32: [[SEXTLOAD:%[0-9]+]]:_(s32) = G_SEXTLOAD [[COPY]](p0) :: (load (s8) from %ir.px)
195 ; MIPS32: $v0 = COPY [[SEXTLOAD]](s32)
196 ; MIPS32: RetRA implicit $v0
198 %3:_(s32) = G_SEXTLOAD %0(p0) :: (load (s8) from %ir.px)
204 name: load4_s32_to_sextLoad4_s64
206 tracksRegLiveness: true
211 ; MIPS32-LABEL: name: load4_s32_to_sextLoad4_s64
212 ; MIPS32: liveins: $a0
213 ; MIPS32: [[COPY:%[0-9]+]]:_(p0) = COPY $a0
214 ; MIPS32: [[LOAD:%[0-9]+]]:_(s32) = G_LOAD [[COPY]](p0) :: (load (s32) from %ir.px)
215 ; MIPS32: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 31
216 ; MIPS32: [[ASHR:%[0-9]+]]:_(s32) = G_ASHR [[LOAD]], [[C]](s32)
217 ; MIPS32: $v0 = COPY [[LOAD]](s32)
218 ; MIPS32: $v1 = COPY [[ASHR]](s32)
219 ; MIPS32: RetRA implicit $v0, implicit $v1
221 %2:_(s64) = G_SEXTLOAD %0(p0) :: (load (s32) from %ir.px)
222 %3:_(s32), %4:_(s32) = G_UNMERGE_VALUES %2(s64)
225 RetRA implicit $v0, implicit $v1