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(i8* %px) {entry: ret void}
6 define void @load2_s16_to_zextLoad2_s32(i16* %px) {entry: ret void}
7 define void @load1_s8_to_zextLoad1_s16(i8* %px) {entry: ret void}
8 define void @load1_s8_to_zextLoad1_s16_to_zextLoad1_s32(i8* %px) {entry: ret void}
9 define void @load4_s32_to_zextLoad4_s64(i8* %px) {entry: ret void}
10 define void @load1_s8_to_sextLoad1_s32(i8* %px) {entry: ret void}
11 define void @load2_s16_to_sextLoad2_s32(i16* %px) {entry: ret void}
12 define void @load1_s8_to_sextLoad1_s16(i8* %px) {entry: ret void}
13 define void @load1_s8_to_sextLoad1_s16_to_sextLoad1_s32(i8* %px) {entry: ret void}
14 define void @load4_s32_to_sextLoad4_s64(i8* %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: [[COPY1:%[0-9]+]]:_(s32) = COPY [[ZEXTLOAD]](s32)
70 ; MIPS32: $v0 = COPY [[COPY1]](s32)
71 ; MIPS32: RetRA implicit $v0
73 %2:_(s16) = G_ZEXTLOAD %0(p0) :: (load (s8) from %ir.px)
74 %3:_(s32) = G_ANYEXT %2(s16)
80 name: load1_s8_to_zextLoad1_s16_to_zextLoad1_s32
82 tracksRegLiveness: true
87 ; MIPS32-LABEL: name: load1_s8_to_zextLoad1_s16_to_zextLoad1_s32
88 ; MIPS32: liveins: $a0
89 ; MIPS32: [[COPY:%[0-9]+]]:_(p0) = COPY $a0
90 ; MIPS32: [[ZEXTLOAD:%[0-9]+]]:_(s32) = G_ZEXTLOAD [[COPY]](p0) :: (load (s8) from %ir.px)
91 ; MIPS32: $v0 = COPY [[ZEXTLOAD]](s32)
92 ; MIPS32: RetRA implicit $v0
94 %3:_(s32) = G_ZEXTLOAD %0(p0) :: (load (s8) from %ir.px)
100 name: load4_s32_to_zextLoad4_s64
102 tracksRegLiveness: true
107 ; MIPS32-LABEL: name: load4_s32_to_zextLoad4_s64
108 ; MIPS32: liveins: $a0
109 ; MIPS32: [[COPY:%[0-9]+]]:_(p0) = COPY $a0
110 ; MIPS32: [[LOAD:%[0-9]+]]:_(s32) = G_LOAD [[COPY]](p0) :: (load (s32) from %ir.px)
111 ; MIPS32: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 0
112 ; MIPS32: $v0 = COPY [[LOAD]](s32)
113 ; MIPS32: $v1 = COPY [[C]](s32)
114 ; MIPS32: RetRA implicit $v0, implicit $v1
116 %2:_(s64) = G_ZEXTLOAD %0(p0) :: (load (s32) from %ir.px)
117 %3:_(s32), %4:_(s32) = G_UNMERGE_VALUES %2(s64)
120 RetRA implicit $v0, implicit $v1
124 name: load1_s8_to_sextLoad1_s32
126 tracksRegLiveness: true
131 ; MIPS32-LABEL: name: load1_s8_to_sextLoad1_s32
132 ; MIPS32: liveins: $a0
133 ; MIPS32: [[COPY:%[0-9]+]]:_(p0) = COPY $a0
134 ; MIPS32: [[SEXTLOAD:%[0-9]+]]:_(s32) = G_SEXTLOAD [[COPY]](p0) :: (load (s8) from %ir.px)
135 ; MIPS32: $v0 = COPY [[SEXTLOAD]](s32)
136 ; MIPS32: RetRA implicit $v0
138 %2:_(s32) = G_SEXTLOAD %0(p0) :: (load (s8) from %ir.px)
144 name: load2_s16_to_sextLoad2_s32
146 tracksRegLiveness: true
151 ; MIPS32-LABEL: name: load2_s16_to_sextLoad2_s32
152 ; MIPS32: liveins: $a0
153 ; MIPS32: [[COPY:%[0-9]+]]:_(p0) = COPY $a0
154 ; MIPS32: [[SEXTLOAD:%[0-9]+]]:_(s32) = G_SEXTLOAD [[COPY]](p0) :: (load (s16) from %ir.px)
155 ; MIPS32: $v0 = COPY [[SEXTLOAD]](s32)
156 ; MIPS32: RetRA implicit $v0
158 %2:_(s32) = G_SEXTLOAD %0(p0) :: (load (s16) from %ir.px)
164 name: load1_s8_to_sextLoad1_s16
166 tracksRegLiveness: true
171 ; MIPS32-LABEL: name: load1_s8_to_sextLoad1_s16
172 ; MIPS32: liveins: $a0
173 ; MIPS32: [[COPY:%[0-9]+]]:_(p0) = COPY $a0
174 ; MIPS32: [[SEXTLOAD:%[0-9]+]]:_(s32) = G_SEXTLOAD [[COPY]](p0) :: (load (s8) from %ir.px)
175 ; MIPS32: [[COPY1:%[0-9]+]]:_(s32) = COPY [[SEXTLOAD]](s32)
176 ; MIPS32: $v0 = COPY [[COPY1]](s32)
177 ; MIPS32: RetRA implicit $v0
179 %2:_(s16) = G_SEXTLOAD %0(p0) :: (load (s8) from %ir.px)
180 %3:_(s32) = G_ANYEXT %2(s16)
186 name: load1_s8_to_sextLoad1_s16_to_sextLoad1_s32
188 tracksRegLiveness: true
193 ; MIPS32-LABEL: name: load1_s8_to_sextLoad1_s16_to_sextLoad1_s32
194 ; MIPS32: liveins: $a0
195 ; MIPS32: [[COPY:%[0-9]+]]:_(p0) = COPY $a0
196 ; MIPS32: [[SEXTLOAD:%[0-9]+]]:_(s32) = G_SEXTLOAD [[COPY]](p0) :: (load (s8) from %ir.px)
197 ; MIPS32: $v0 = COPY [[SEXTLOAD]](s32)
198 ; MIPS32: RetRA implicit $v0
200 %3:_(s32) = G_SEXTLOAD %0(p0) :: (load (s8) from %ir.px)
206 name: load4_s32_to_sextLoad4_s64
208 tracksRegLiveness: true
213 ; MIPS32-LABEL: name: load4_s32_to_sextLoad4_s64
214 ; MIPS32: liveins: $a0
215 ; MIPS32: [[COPY:%[0-9]+]]:_(p0) = COPY $a0
216 ; MIPS32: [[LOAD:%[0-9]+]]:_(s32) = G_LOAD [[COPY]](p0) :: (load (s32) from %ir.px)
217 ; MIPS32: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 31
218 ; MIPS32: [[C1:%[0-9]+]]:_(s32) = G_CONSTANT i32 0
219 ; MIPS32: [[ASHR:%[0-9]+]]:_(s32) = G_ASHR [[LOAD]], [[C]](s32)
220 ; MIPS32: $v0 = COPY [[LOAD]](s32)
221 ; MIPS32: $v1 = COPY [[ASHR]](s32)
222 ; MIPS32: RetRA implicit $v0, implicit $v1
224 %2:_(s64) = G_SEXTLOAD %0(p0) :: (load (s32) from %ir.px)
225 %3:_(s32), %4:_(s32) = G_UNMERGE_VALUES %2(s64)
228 RetRA implicit $v0, implicit $v1