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 1 from %ir.px)
29 ; MIPS32: $v0 = COPY [[ZEXTLOAD]](s32)
30 ; MIPS32: RetRA implicit $v0
32 %2:_(s32) = G_ZEXTLOAD %0(p0) :: (load 1 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 2 from %ir.px)
49 ; MIPS32: $v0 = COPY [[ZEXTLOAD]](s32)
50 ; MIPS32: RetRA implicit $v0
52 %2:_(s32) = G_ZEXTLOAD %0(p0) :: (load 2 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 1 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 1 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 1 from %ir.px)
91 ; MIPS32: $v0 = COPY [[ZEXTLOAD]](s32)
92 ; MIPS32: RetRA implicit $v0
94 %3:_(s32) = G_ZEXTLOAD %0(p0) :: (load 1 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 4 from %ir.px)
111 ; MIPS32: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 0
112 ; MIPS32: [[MV:%[0-9]+]]:_(s64) = G_MERGE_VALUES [[LOAD]](s32), [[C]](s32)
113 ; MIPS32: [[UV:%[0-9]+]]:_(s32), [[UV1:%[0-9]+]]:_(s32) = G_UNMERGE_VALUES [[MV]](s64)
114 ; MIPS32: $v0 = COPY [[UV]](s32)
115 ; MIPS32: $v1 = COPY [[UV1]](s32)
116 ; MIPS32: RetRA implicit $v0, implicit $v1
118 %2:_(s64) = G_ZEXTLOAD %0(p0) :: (load 4 from %ir.px)
119 %3:_(s32), %4:_(s32) = G_UNMERGE_VALUES %2(s64)
122 RetRA implicit $v0, implicit $v1
126 name: load1_s8_to_sextLoad1_s32
128 tracksRegLiveness: true
133 ; MIPS32-LABEL: name: load1_s8_to_sextLoad1_s32
134 ; MIPS32: liveins: $a0
135 ; MIPS32: [[COPY:%[0-9]+]]:_(p0) = COPY $a0
136 ; MIPS32: [[SEXTLOAD:%[0-9]+]]:_(s32) = G_SEXTLOAD [[COPY]](p0) :: (load 1 from %ir.px)
137 ; MIPS32: $v0 = COPY [[SEXTLOAD]](s32)
138 ; MIPS32: RetRA implicit $v0
140 %2:_(s32) = G_SEXTLOAD %0(p0) :: (load 1 from %ir.px)
146 name: load2_s16_to_sextLoad2_s32
148 tracksRegLiveness: true
153 ; MIPS32-LABEL: name: load2_s16_to_sextLoad2_s32
154 ; MIPS32: liveins: $a0
155 ; MIPS32: [[COPY:%[0-9]+]]:_(p0) = COPY $a0
156 ; MIPS32: [[SEXTLOAD:%[0-9]+]]:_(s32) = G_SEXTLOAD [[COPY]](p0) :: (load 2 from %ir.px)
157 ; MIPS32: $v0 = COPY [[SEXTLOAD]](s32)
158 ; MIPS32: RetRA implicit $v0
160 %2:_(s32) = G_SEXTLOAD %0(p0) :: (load 2 from %ir.px)
166 name: load1_s8_to_sextLoad1_s16
168 tracksRegLiveness: true
173 ; MIPS32-LABEL: name: load1_s8_to_sextLoad1_s16
174 ; MIPS32: liveins: $a0
175 ; MIPS32: [[COPY:%[0-9]+]]:_(p0) = COPY $a0
176 ; MIPS32: [[SEXTLOAD:%[0-9]+]]:_(s32) = G_SEXTLOAD [[COPY]](p0) :: (load 1 from %ir.px)
177 ; MIPS32: [[COPY1:%[0-9]+]]:_(s32) = COPY [[SEXTLOAD]](s32)
178 ; MIPS32: $v0 = COPY [[COPY1]](s32)
179 ; MIPS32: RetRA implicit $v0
181 %2:_(s16) = G_SEXTLOAD %0(p0) :: (load 1 from %ir.px)
182 %3:_(s32) = G_ANYEXT %2(s16)
188 name: load1_s8_to_sextLoad1_s16_to_sextLoad1_s32
190 tracksRegLiveness: true
195 ; MIPS32-LABEL: name: load1_s8_to_sextLoad1_s16_to_sextLoad1_s32
196 ; MIPS32: liveins: $a0
197 ; MIPS32: [[COPY:%[0-9]+]]:_(p0) = COPY $a0
198 ; MIPS32: [[SEXTLOAD:%[0-9]+]]:_(s32) = G_SEXTLOAD [[COPY]](p0) :: (load 1 from %ir.px)
199 ; MIPS32: $v0 = COPY [[SEXTLOAD]](s32)
200 ; MIPS32: RetRA implicit $v0
202 %3:_(s32) = G_SEXTLOAD %0(p0) :: (load 1 from %ir.px)
208 name: load4_s32_to_sextLoad4_s64
210 tracksRegLiveness: true
215 ; MIPS32-LABEL: name: load4_s32_to_sextLoad4_s64
216 ; MIPS32: liveins: $a0
217 ; MIPS32: [[COPY:%[0-9]+]]:_(p0) = COPY $a0
218 ; MIPS32: [[LOAD:%[0-9]+]]:_(s32) = G_LOAD [[COPY]](p0) :: (load 4 from %ir.px)
219 ; MIPS32: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 31
220 ; MIPS32: [[C1:%[0-9]+]]:_(s32) = G_CONSTANT i32 0
221 ; MIPS32: [[COPY1:%[0-9]+]]:_(s32) = COPY [[C]](s32)
222 ; MIPS32: [[ASHR:%[0-9]+]]:_(s32) = G_ASHR [[LOAD]], [[COPY1]](s32)
223 ; MIPS32: [[MV:%[0-9]+]]:_(s64) = G_MERGE_VALUES [[LOAD]](s32), [[ASHR]](s32)
224 ; MIPS32: [[UV:%[0-9]+]]:_(s32), [[UV1:%[0-9]+]]:_(s32) = G_UNMERGE_VALUES [[MV]](s64)
225 ; MIPS32: $v0 = COPY [[UV]](s32)
226 ; MIPS32: $v1 = COPY [[UV1]](s32)
227 ; MIPS32: RetRA implicit $v0, implicit $v1
229 %2:_(s64) = G_SEXTLOAD %0(p0) :: (load 4 from %ir.px)
230 %3:_(s32), %4:_(s32) = G_UNMERGE_VALUES %2(s64)
233 RetRA implicit $v0, implicit $v1