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 i1 @test_i1(i1 %cnd, i1 %a, i1 %b) {
7 br i1 %cnd, label %cond.true, label %cond.false
9 cond.true: ; preds = %entry
12 cond.false: ; preds = %entry
15 cond.end: ; preds = %cond.false, %cond.true
16 %cond = phi i1 [ %a, %cond.true ], [ %b, %cond.false ]
20 define i8 @test_i8(i1 %cnd, i8 %a, i8 %b) {
22 br i1 %cnd, label %cond.true, label %cond.false
24 cond.true: ; preds = %entry
27 cond.false: ; preds = %entry
30 cond.end: ; preds = %cond.false, %cond.true
31 %cond = phi i8 [ %a, %cond.true ], [ %b, %cond.false ]
35 define i16 @test_i16(i1 %cnd, i16 %a, i16 %b) {
37 br i1 %cnd, label %cond.true, label %cond.false
39 cond.true: ; preds = %entry
42 cond.false: ; preds = %entry
45 cond.end: ; preds = %cond.false, %cond.true
46 %cond = phi i16 [ %a, %cond.true ], [ %b, %cond.false ]
50 define i32 @test_i32(i1 %cnd, i32 %a, i32 %b) {
52 br i1 %cnd, label %cond.true, label %cond.false
54 cond.true: ; preds = %entry
57 cond.false: ; preds = %entry
60 cond.end: ; preds = %cond.false, %cond.true
61 %cond = phi i32 [ %a, %cond.true ], [ %b, %cond.false ]
69 tracksRegLiveness: true
71 ; MIPS32-LABEL: name: test_i1
73 ; MIPS32: successors: %bb.1(0x40000000), %bb.2(0x40000000)
74 ; MIPS32: liveins: $a0, $a1, $a2
75 ; MIPS32: [[COPY:%[0-9]+]]:_(s32) = COPY $a0
76 ; MIPS32: [[COPY1:%[0-9]+]]:_(s32) = COPY $a1
77 ; MIPS32: [[COPY2:%[0-9]+]]:_(s32) = COPY $a2
78 ; MIPS32: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 1
79 ; MIPS32: [[COPY3:%[0-9]+]]:_(s32) = COPY [[COPY]](s32)
80 ; MIPS32: [[AND:%[0-9]+]]:_(s32) = G_AND [[COPY3]], [[C]]
81 ; MIPS32: G_BRCOND [[AND]](s32), %bb.1
83 ; MIPS32: bb.1.cond.true:
84 ; MIPS32: successors: %bb.3(0x80000000)
85 ; MIPS32: [[COPY4:%[0-9]+]]:_(s32) = COPY [[COPY1]](s32)
87 ; MIPS32: bb.2.cond.false:
88 ; MIPS32: successors: %bb.3(0x80000000)
89 ; MIPS32: [[COPY5:%[0-9]+]]:_(s32) = COPY [[COPY2]](s32)
90 ; MIPS32: bb.3.cond.end:
91 ; MIPS32: [[PHI:%[0-9]+]]:_(s32) = G_PHI [[COPY4]](s32), %bb.1, [[COPY5]](s32), %bb.2
92 ; MIPS32: [[COPY6:%[0-9]+]]:_(s32) = COPY [[PHI]](s32)
93 ; MIPS32: $v0 = COPY [[COPY6]](s32)
94 ; MIPS32: RetRA implicit $v0
96 liveins: $a0, $a1, $a2
99 %0:_(s1) = G_TRUNC %3(s32)
101 %1:_(s1) = G_TRUNC %4(s32)
103 %2:_(s1) = G_TRUNC %5(s32)
104 G_BRCOND %0(s1), %bb.2
113 %6:_(s1) = G_PHI %1(s1), %bb.2, %2(s1), %bb.3
114 %7:_(s32) = G_ANYEXT %6(s1)
122 tracksRegLiveness: true
124 ; MIPS32-LABEL: name: test_i8
125 ; MIPS32: bb.0.entry:
126 ; MIPS32: successors: %bb.1(0x40000000), %bb.2(0x40000000)
127 ; MIPS32: liveins: $a0, $a1, $a2
128 ; MIPS32: [[COPY:%[0-9]+]]:_(s32) = COPY $a0
129 ; MIPS32: [[COPY1:%[0-9]+]]:_(s32) = COPY $a1
130 ; MIPS32: [[COPY2:%[0-9]+]]:_(s32) = COPY $a2
131 ; MIPS32: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 1
132 ; MIPS32: [[COPY3:%[0-9]+]]:_(s32) = COPY [[COPY]](s32)
133 ; MIPS32: [[AND:%[0-9]+]]:_(s32) = G_AND [[COPY3]], [[C]]
134 ; MIPS32: G_BRCOND [[AND]](s32), %bb.1
136 ; MIPS32: bb.1.cond.true:
137 ; MIPS32: successors: %bb.3(0x80000000)
138 ; MIPS32: [[COPY4:%[0-9]+]]:_(s32) = COPY [[COPY1]](s32)
140 ; MIPS32: bb.2.cond.false:
141 ; MIPS32: successors: %bb.3(0x80000000)
142 ; MIPS32: [[COPY5:%[0-9]+]]:_(s32) = COPY [[COPY2]](s32)
143 ; MIPS32: bb.3.cond.end:
144 ; MIPS32: [[PHI:%[0-9]+]]:_(s32) = G_PHI [[COPY4]](s32), %bb.1, [[COPY5]](s32), %bb.2
145 ; MIPS32: [[COPY6:%[0-9]+]]:_(s32) = COPY [[PHI]](s32)
146 ; MIPS32: $v0 = COPY [[COPY6]](s32)
147 ; MIPS32: RetRA implicit $v0
149 liveins: $a0, $a1, $a2
152 %0:_(s1) = G_TRUNC %3(s32)
154 %1:_(s8) = G_TRUNC %4(s32)
156 %2:_(s8) = G_TRUNC %5(s32)
157 G_BRCOND %0(s1), %bb.2
166 %6:_(s8) = G_PHI %1(s8), %bb.2, %2(s8), %bb.3
167 %7:_(s32) = G_ANYEXT %6(s8)
175 tracksRegLiveness: true
177 ; MIPS32-LABEL: name: test_i16
178 ; MIPS32: bb.0.entry:
179 ; MIPS32: successors: %bb.1(0x40000000), %bb.2(0x40000000)
180 ; MIPS32: liveins: $a0, $a1, $a2
181 ; MIPS32: [[COPY:%[0-9]+]]:_(s32) = COPY $a0
182 ; MIPS32: [[COPY1:%[0-9]+]]:_(s32) = COPY $a1
183 ; MIPS32: [[COPY2:%[0-9]+]]:_(s32) = COPY $a2
184 ; MIPS32: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 1
185 ; MIPS32: [[COPY3:%[0-9]+]]:_(s32) = COPY [[COPY]](s32)
186 ; MIPS32: [[AND:%[0-9]+]]:_(s32) = G_AND [[COPY3]], [[C]]
187 ; MIPS32: G_BRCOND [[AND]](s32), %bb.1
189 ; MIPS32: bb.1.cond.true:
190 ; MIPS32: successors: %bb.3(0x80000000)
191 ; MIPS32: [[COPY4:%[0-9]+]]:_(s32) = COPY [[COPY1]](s32)
193 ; MIPS32: bb.2.cond.false:
194 ; MIPS32: successors: %bb.3(0x80000000)
195 ; MIPS32: [[COPY5:%[0-9]+]]:_(s32) = COPY [[COPY2]](s32)
196 ; MIPS32: bb.3.cond.end:
197 ; MIPS32: [[PHI:%[0-9]+]]:_(s32) = G_PHI [[COPY4]](s32), %bb.1, [[COPY5]](s32), %bb.2
198 ; MIPS32: [[COPY6:%[0-9]+]]:_(s32) = COPY [[PHI]](s32)
199 ; MIPS32: $v0 = COPY [[COPY6]](s32)
200 ; MIPS32: RetRA implicit $v0
202 liveins: $a0, $a1, $a2
205 %0:_(s1) = G_TRUNC %3(s32)
207 %1:_(s16) = G_TRUNC %4(s32)
209 %2:_(s16) = G_TRUNC %5(s32)
210 G_BRCOND %0(s1), %bb.2
219 %6:_(s16) = G_PHI %1(s16), %bb.2, %2(s16), %bb.3
220 %7:_(s32) = G_ANYEXT %6(s16)
228 tracksRegLiveness: true
230 ; MIPS32-LABEL: name: test_i32
231 ; MIPS32: bb.0.entry:
232 ; MIPS32: successors: %bb.1(0x40000000), %bb.2(0x40000000)
233 ; MIPS32: liveins: $a0, $a1, $a2
234 ; MIPS32: [[COPY:%[0-9]+]]:_(s32) = COPY $a0
235 ; MIPS32: [[COPY1:%[0-9]+]]:_(s32) = COPY $a1
236 ; MIPS32: [[COPY2:%[0-9]+]]:_(s32) = COPY $a2
237 ; MIPS32: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 1
238 ; MIPS32: [[COPY3:%[0-9]+]]:_(s32) = COPY [[COPY]](s32)
239 ; MIPS32: [[AND:%[0-9]+]]:_(s32) = G_AND [[COPY3]], [[C]]
240 ; MIPS32: G_BRCOND [[AND]](s32), %bb.1
242 ; MIPS32: bb.1.cond.true:
243 ; MIPS32: successors: %bb.3(0x80000000)
245 ; MIPS32: bb.2.cond.false:
246 ; MIPS32: successors: %bb.3(0x80000000)
247 ; MIPS32: bb.3.cond.end:
248 ; MIPS32: [[PHI:%[0-9]+]]:_(s32) = G_PHI [[COPY1]](s32), %bb.1, [[COPY2]](s32), %bb.2
249 ; MIPS32: $v0 = COPY [[PHI]](s32)
250 ; MIPS32: RetRA implicit $v0
252 liveins: $a0, $a1, $a2
255 %0:_(s1) = G_TRUNC %3(s32)
258 G_BRCOND %0(s1), %bb.2
267 %4:_(s32) = G_PHI %1(s32), %bb.2, %2(s32), %bb.3