1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc -O0 -mtriple=mipsel-linux-gnu -global-isel -verify-machineinstrs %s -o -| FileCheck %s -check-prefixes=MIPS32
4 define void @long_chain_ambiguous_i32_in_gpr(i1 %cnd0, i1 %cnd1, i1 %cnd2, i32* %a, i32* %b, i32* %c, i32* %result) {
5 ; MIPS32-LABEL: long_chain_ambiguous_i32_in_gpr:
6 ; MIPS32: # %bb.0: # %entry
7 ; MIPS32-NEXT: addiu $sp, $sp, -48
8 ; MIPS32-NEXT: .cfi_def_cfa_offset 48
9 ; MIPS32-NEXT: addiu $1, $sp, 64
10 ; MIPS32-NEXT: lw $1, 0($1)
11 ; MIPS32-NEXT: addiu $2, $sp, 68
12 ; MIPS32-NEXT: lw $2, 0($2)
13 ; MIPS32-NEXT: addiu $3, $sp, 72
14 ; MIPS32-NEXT: lw $3, 0($3)
15 ; MIPS32-NEXT: ori $8, $zero, 1
16 ; MIPS32-NEXT: and $8, $4, $8
17 ; MIPS32-NEXT: sw $1, 44($sp) # 4-byte Folded Spill
18 ; MIPS32-NEXT: sw $4, 40($sp) # 4-byte Folded Spill
19 ; MIPS32-NEXT: sw $5, 36($sp) # 4-byte Folded Spill
20 ; MIPS32-NEXT: sw $6, 32($sp) # 4-byte Folded Spill
21 ; MIPS32-NEXT: sw $7, 28($sp) # 4-byte Folded Spill
22 ; MIPS32-NEXT: sw $2, 24($sp) # 4-byte Folded Spill
23 ; MIPS32-NEXT: sw $3, 20($sp) # 4-byte Folded Spill
24 ; MIPS32-NEXT: bnez $8, $BB0_9
26 ; MIPS32-NEXT: # %bb.1: # %pre.PHI.1
27 ; MIPS32-NEXT: ori $1, $zero, 1
28 ; MIPS32-NEXT: lw $2, 36($sp) # 4-byte Folded Reload
29 ; MIPS32-NEXT: and $1, $2, $1
30 ; MIPS32-NEXT: bnez $1, $BB0_4
32 ; MIPS32-NEXT: # %bb.2: # %pre.PHI.1.0
33 ; MIPS32-NEXT: ori $1, $zero, 1
34 ; MIPS32-NEXT: lw $2, 32($sp) # 4-byte Folded Reload
35 ; MIPS32-NEXT: and $1, $2, $1
36 ; MIPS32-NEXT: bnez $1, $BB0_5
38 ; MIPS32-NEXT: # %bb.3: # %b.PHI.1.0
39 ; MIPS32-NEXT: lw $1, 28($sp) # 4-byte Folded Reload
40 ; MIPS32-NEXT: lw $2, 0($1)
41 ; MIPS32-NEXT: sw $2, 16($sp) # 4-byte Folded Spill
42 ; MIPS32-NEXT: j $BB0_6
44 ; MIPS32-NEXT: $BB0_4: # %b.PHI.1.1
45 ; MIPS32-NEXT: lw $1, 44($sp) # 4-byte Folded Reload
46 ; MIPS32-NEXT: lw $2, 0($1)
47 ; MIPS32-NEXT: sw $2, 16($sp) # 4-byte Folded Spill
48 ; MIPS32-NEXT: j $BB0_6
50 ; MIPS32-NEXT: $BB0_5: # %b.PHI.1.2
51 ; MIPS32-NEXT: lw $1, 24($sp) # 4-byte Folded Reload
52 ; MIPS32-NEXT: lw $2, 0($1)
53 ; MIPS32-NEXT: sw $2, 16($sp) # 4-byte Folded Spill
54 ; MIPS32-NEXT: $BB0_6: # %b.PHI.1
55 ; MIPS32-NEXT: lw $1, 16($sp) # 4-byte Folded Reload
56 ; MIPS32-NEXT: ori $2, $zero, 1
57 ; MIPS32-NEXT: lw $3, 32($sp) # 4-byte Folded Reload
58 ; MIPS32-NEXT: and $2, $3, $2
59 ; MIPS32-NEXT: move $4, $1
60 ; MIPS32-NEXT: sw $1, 12($sp) # 4-byte Folded Spill
61 ; MIPS32-NEXT: sw $4, 8($sp) # 4-byte Folded Spill
62 ; MIPS32-NEXT: bnez $2, $BB0_8
64 ; MIPS32-NEXT: # %bb.7: # %b.PHI.1
65 ; MIPS32-NEXT: j $BB0_15
67 ; MIPS32-NEXT: $BB0_8: # %b.PHI.1.end
68 ; MIPS32-NEXT: lw $1, 12($sp) # 4-byte Folded Reload
69 ; MIPS32-NEXT: lw $2, 20($sp) # 4-byte Folded Reload
70 ; MIPS32-NEXT: sw $1, 0($2)
71 ; MIPS32-NEXT: addiu $sp, $sp, 48
74 ; MIPS32-NEXT: $BB0_9: # %pre.PHI.2
75 ; MIPS32-NEXT: ori $1, $zero, 1
76 ; MIPS32-NEXT: lw $2, 40($sp) # 4-byte Folded Reload
77 ; MIPS32-NEXT: and $1, $2, $1
78 ; MIPS32-NEXT: bnez $1, $BB0_11
80 ; MIPS32-NEXT: # %bb.10: # %pre.PHI.2
81 ; MIPS32-NEXT: j $BB0_12
83 ; MIPS32-NEXT: $BB0_11: # %b.PHI.2.0
84 ; MIPS32-NEXT: lw $1, 28($sp) # 4-byte Folded Reload
85 ; MIPS32-NEXT: lw $2, 0($1)
86 ; MIPS32-NEXT: sw $2, 4($sp) # 4-byte Folded Spill
87 ; MIPS32-NEXT: j $BB0_13
89 ; MIPS32-NEXT: $BB0_12: # %b.PHI.2.1
90 ; MIPS32-NEXT: lw $1, 44($sp) # 4-byte Folded Reload
91 ; MIPS32-NEXT: lw $2, 0($1)
92 ; MIPS32-NEXT: sw $2, 4($sp) # 4-byte Folded Spill
93 ; MIPS32-NEXT: $BB0_13: # %b.PHI.2
94 ; MIPS32-NEXT: lw $1, 4($sp) # 4-byte Folded Reload
95 ; MIPS32-NEXT: ori $2, $zero, 1
96 ; MIPS32-NEXT: lw $3, 36($sp) # 4-byte Folded Reload
97 ; MIPS32-NEXT: and $2, $3, $2
98 ; MIPS32-NEXT: move $4, $1
99 ; MIPS32-NEXT: sw $1, 0($sp) # 4-byte Folded Spill
100 ; MIPS32-NEXT: sw $4, 8($sp) # 4-byte Folded Spill
101 ; MIPS32-NEXT: bnez $2, $BB0_15
103 ; MIPS32-NEXT: # %bb.14: # %b.PHI.2.end
104 ; MIPS32-NEXT: lw $1, 0($sp) # 4-byte Folded Reload
105 ; MIPS32-NEXT: lw $2, 20($sp) # 4-byte Folded Reload
106 ; MIPS32-NEXT: sw $1, 0($2)
107 ; MIPS32-NEXT: addiu $sp, $sp, 48
108 ; MIPS32-NEXT: jr $ra
110 ; MIPS32-NEXT: $BB0_15: # %b.PHI.3
111 ; MIPS32-NEXT: lw $1, 8($sp) # 4-byte Folded Reload
112 ; MIPS32-NEXT: lw $2, 8($sp) # 4-byte Folded Reload
113 ; MIPS32-NEXT: ori $3, $zero, 1
114 ; MIPS32-NEXT: lw $4, 32($sp) # 4-byte Folded Reload
115 ; MIPS32-NEXT: and $5, $4, $3
116 ; MIPS32-NEXT: movn $1, $2, $5
117 ; MIPS32-NEXT: lw $5, 36($sp) # 4-byte Folded Reload
118 ; MIPS32-NEXT: and $3, $5, $3
119 ; MIPS32-NEXT: move $6, $2
120 ; MIPS32-NEXT: movn $6, $1, $3
121 ; MIPS32-NEXT: lw $1, 20($sp) # 4-byte Folded Reload
122 ; MIPS32-NEXT: sw $6, 0($1)
123 ; MIPS32-NEXT: sw $2, 0($1)
124 ; MIPS32-NEXT: addiu $sp, $sp, 48
125 ; MIPS32-NEXT: jr $ra
128 br i1 %cnd0, label %pre.PHI.2, label %pre.PHI.1
131 br i1 %cnd1, label %b.PHI.1.1, label %pre.PHI.1.0
134 br i1 %cnd2, label %b.PHI.1.2, label %b.PHI.1.0
137 %phi1.0 = load i32, i32* %a
141 %phi1.1 = load i32, i32* %b
145 %phi1.2 = load i32, i32* %c
149 %phi1 = phi i32 [ %phi1.0, %b.PHI.1.0 ], [ %phi1.1, %b.PHI.1.1 ], [ %phi1.2, %b.PHI.1.2 ]
150 br i1 %cnd2, label %b.PHI.1.end, label %b.PHI.3
153 store i32 %phi1, i32* %result
157 br i1 %cnd0, label %b.PHI.2.0, label %b.PHI.2.1
160 %phi2.0 = load i32, i32* %a
164 %phi2.1 = load i32, i32* %b
168 %phi2 = phi i32 [ %phi2.0, %b.PHI.2.0 ], [ %phi2.1, %b.PHI.2.1 ]
169 br i1 %cnd1, label %b.PHI.3, label %b.PHI.2.end
172 store i32 %phi2, i32* %result
176 %phi3 = phi i32 [ %phi2, %b.PHI.2], [ %phi1, %b.PHI.1 ]
177 %phi4 = phi i32 [ %phi2, %b.PHI.2], [ %phi1, %b.PHI.1 ]
178 %sel_1.2 = select i1 %cnd2, i32 %phi3, i32 %phi4
179 %sel_3_1.2 = select i1 %cnd1, i32 %sel_1.2, i32 %phi3
180 store i32 %sel_3_1.2, i32* %result
181 store i32 %phi3, i32* %result
186 define void @long_chain_i32_in_gpr(i1 %cnd0, i1 %cnd1, i1 %cnd2, i32* %a, i32* %b, i32* %c, i32* %result) {
187 ; MIPS32-LABEL: long_chain_i32_in_gpr:
188 ; MIPS32: # %bb.0: # %entry
189 ; MIPS32-NEXT: addiu $sp, $sp, -56
190 ; MIPS32-NEXT: .cfi_def_cfa_offset 56
191 ; MIPS32-NEXT: addiu $1, $sp, 72
192 ; MIPS32-NEXT: lw $1, 0($1)
193 ; MIPS32-NEXT: addiu $2, $sp, 76
194 ; MIPS32-NEXT: lw $2, 0($2)
195 ; MIPS32-NEXT: addiu $3, $sp, 80
196 ; MIPS32-NEXT: lw $3, 0($3)
197 ; MIPS32-NEXT: ori $8, $zero, 0
198 ; MIPS32-NEXT: ori $9, $zero, 1
199 ; MIPS32-NEXT: and $9, $4, $9
200 ; MIPS32-NEXT: sw $1, 52($sp) # 4-byte Folded Spill
201 ; MIPS32-NEXT: sw $4, 48($sp) # 4-byte Folded Spill
202 ; MIPS32-NEXT: sw $5, 44($sp) # 4-byte Folded Spill
203 ; MIPS32-NEXT: sw $6, 40($sp) # 4-byte Folded Spill
204 ; MIPS32-NEXT: sw $7, 36($sp) # 4-byte Folded Spill
205 ; MIPS32-NEXT: sw $2, 32($sp) # 4-byte Folded Spill
206 ; MIPS32-NEXT: sw $3, 28($sp) # 4-byte Folded Spill
207 ; MIPS32-NEXT: sw $8, 24($sp) # 4-byte Folded Spill
208 ; MIPS32-NEXT: bnez $9, $BB1_9
210 ; MIPS32-NEXT: # %bb.1: # %pre.PHI.1
211 ; MIPS32-NEXT: ori $1, $zero, 1
212 ; MIPS32-NEXT: lw $2, 44($sp) # 4-byte Folded Reload
213 ; MIPS32-NEXT: and $1, $2, $1
214 ; MIPS32-NEXT: bnez $1, $BB1_4
216 ; MIPS32-NEXT: # %bb.2: # %pre.PHI.1.0
217 ; MIPS32-NEXT: ori $1, $zero, 1
218 ; MIPS32-NEXT: lw $2, 40($sp) # 4-byte Folded Reload
219 ; MIPS32-NEXT: and $1, $2, $1
220 ; MIPS32-NEXT: bnez $1, $BB1_5
222 ; MIPS32-NEXT: # %bb.3: # %b.PHI.1.0
223 ; MIPS32-NEXT: lw $1, 36($sp) # 4-byte Folded Reload
224 ; MIPS32-NEXT: lw $2, 0($1)
225 ; MIPS32-NEXT: sw $2, 20($sp) # 4-byte Folded Spill
226 ; MIPS32-NEXT: j $BB1_6
228 ; MIPS32-NEXT: $BB1_4: # %b.PHI.1.1
229 ; MIPS32-NEXT: lw $1, 52($sp) # 4-byte Folded Reload
230 ; MIPS32-NEXT: lw $2, 0($1)
231 ; MIPS32-NEXT: sw $2, 20($sp) # 4-byte Folded Spill
232 ; MIPS32-NEXT: j $BB1_6
234 ; MIPS32-NEXT: $BB1_5: # %b.PHI.1.2
235 ; MIPS32-NEXT: lw $1, 32($sp) # 4-byte Folded Reload
236 ; MIPS32-NEXT: lw $2, 0($1)
237 ; MIPS32-NEXT: sw $2, 20($sp) # 4-byte Folded Spill
238 ; MIPS32-NEXT: $BB1_6: # %b.PHI.1
239 ; MIPS32-NEXT: lw $1, 20($sp) # 4-byte Folded Reload
240 ; MIPS32-NEXT: ori $2, $zero, 1
241 ; MIPS32-NEXT: lw $3, 40($sp) # 4-byte Folded Reload
242 ; MIPS32-NEXT: and $2, $3, $2
243 ; MIPS32-NEXT: move $4, $1
244 ; MIPS32-NEXT: lw $5, 24($sp) # 4-byte Folded Reload
245 ; MIPS32-NEXT: sw $1, 16($sp) # 4-byte Folded Spill
246 ; MIPS32-NEXT: sw $4, 12($sp) # 4-byte Folded Spill
247 ; MIPS32-NEXT: sw $5, 8($sp) # 4-byte Folded Spill
248 ; MIPS32-NEXT: bnez $2, $BB1_8
250 ; MIPS32-NEXT: # %bb.7: # %b.PHI.1
251 ; MIPS32-NEXT: j $BB1_15
253 ; MIPS32-NEXT: $BB1_8: # %b.PHI.1.end
254 ; MIPS32-NEXT: lw $1, 16($sp) # 4-byte Folded Reload
255 ; MIPS32-NEXT: lw $2, 28($sp) # 4-byte Folded Reload
256 ; MIPS32-NEXT: sw $1, 0($2)
257 ; MIPS32-NEXT: addiu $sp, $sp, 56
258 ; MIPS32-NEXT: jr $ra
260 ; MIPS32-NEXT: $BB1_9: # %pre.PHI.2
261 ; MIPS32-NEXT: ori $1, $zero, 1
262 ; MIPS32-NEXT: lw $2, 48($sp) # 4-byte Folded Reload
263 ; MIPS32-NEXT: and $1, $2, $1
264 ; MIPS32-NEXT: bnez $1, $BB1_11
266 ; MIPS32-NEXT: # %bb.10: # %pre.PHI.2
267 ; MIPS32-NEXT: j $BB1_12
269 ; MIPS32-NEXT: $BB1_11: # %b.PHI.2.0
270 ; MIPS32-NEXT: lw $1, 36($sp) # 4-byte Folded Reload
271 ; MIPS32-NEXT: lw $2, 0($1)
272 ; MIPS32-NEXT: sw $2, 4($sp) # 4-byte Folded Spill
273 ; MIPS32-NEXT: j $BB1_13
275 ; MIPS32-NEXT: $BB1_12: # %b.PHI.2.1
276 ; MIPS32-NEXT: lw $1, 52($sp) # 4-byte Folded Reload
277 ; MIPS32-NEXT: lw $2, 0($1)
278 ; MIPS32-NEXT: sw $2, 4($sp) # 4-byte Folded Spill
279 ; MIPS32-NEXT: $BB1_13: # %b.PHI.2
280 ; MIPS32-NEXT: lw $1, 4($sp) # 4-byte Folded Reload
281 ; MIPS32-NEXT: ori $2, $zero, 1
282 ; MIPS32-NEXT: lw $3, 44($sp) # 4-byte Folded Reload
283 ; MIPS32-NEXT: and $2, $3, $2
284 ; MIPS32-NEXT: move $4, $1
285 ; MIPS32-NEXT: move $5, $1
286 ; MIPS32-NEXT: sw $1, 0($sp) # 4-byte Folded Spill
287 ; MIPS32-NEXT: sw $4, 12($sp) # 4-byte Folded Spill
288 ; MIPS32-NEXT: sw $5, 8($sp) # 4-byte Folded Spill
289 ; MIPS32-NEXT: bnez $2, $BB1_15
291 ; MIPS32-NEXT: # %bb.14: # %b.PHI.2.end
292 ; MIPS32-NEXT: lw $1, 0($sp) # 4-byte Folded Reload
293 ; MIPS32-NEXT: lw $2, 28($sp) # 4-byte Folded Reload
294 ; MIPS32-NEXT: sw $1, 0($2)
295 ; MIPS32-NEXT: addiu $sp, $sp, 56
296 ; MIPS32-NEXT: jr $ra
298 ; MIPS32-NEXT: $BB1_15: # %b.PHI.3
299 ; MIPS32-NEXT: lw $1, 8($sp) # 4-byte Folded Reload
300 ; MIPS32-NEXT: lw $2, 12($sp) # 4-byte Folded Reload
301 ; MIPS32-NEXT: ori $3, $zero, 1
302 ; MIPS32-NEXT: lw $4, 40($sp) # 4-byte Folded Reload
303 ; MIPS32-NEXT: and $5, $4, $3
304 ; MIPS32-NEXT: movn $1, $2, $5
305 ; MIPS32-NEXT: lw $5, 44($sp) # 4-byte Folded Reload
306 ; MIPS32-NEXT: and $3, $5, $3
307 ; MIPS32-NEXT: move $6, $2
308 ; MIPS32-NEXT: movn $6, $1, $3
309 ; MIPS32-NEXT: lw $1, 28($sp) # 4-byte Folded Reload
310 ; MIPS32-NEXT: sw $6, 0($1)
311 ; MIPS32-NEXT: sw $2, 0($1)
312 ; MIPS32-NEXT: addiu $sp, $sp, 56
313 ; MIPS32-NEXT: jr $ra
316 br i1 %cnd0, label %pre.PHI.2, label %pre.PHI.1
319 br i1 %cnd1, label %b.PHI.1.1, label %pre.PHI.1.0
322 br i1 %cnd2, label %b.PHI.1.2, label %b.PHI.1.0
325 %phi1.0 = load i32, i32* %a
329 %phi1.1 = load i32, i32* %b
333 %phi1.2 = load i32, i32* %c
337 %phi1 = phi i32 [ %phi1.0, %b.PHI.1.0 ], [ %phi1.1, %b.PHI.1.1 ], [ %phi1.2, %b.PHI.1.2 ]
338 br i1 %cnd2, label %b.PHI.1.end, label %b.PHI.3
341 store i32 %phi1, i32* %result
345 br i1 %cnd0, label %b.PHI.2.0, label %b.PHI.2.1
348 %phi2.0 = load i32, i32* %a
352 %phi2.1 = load i32, i32* %b
356 %phi2 = phi i32 [ %phi2.0, %b.PHI.2.0 ], [ %phi2.1, %b.PHI.2.1 ]
357 br i1 %cnd1, label %b.PHI.3, label %b.PHI.2.end
360 store i32 %phi2, i32* %result
364 %phi3 = phi i32 [ %phi2, %b.PHI.2], [ %phi1, %b.PHI.1 ]
365 %phi4 = phi i32 [ %phi2, %b.PHI.2], [ 0, %b.PHI.1 ]
366 %sel_1.2 = select i1 %cnd2, i32 %phi3, i32 %phi4
367 %sel_3_1.2 = select i1 %cnd1, i32 %sel_1.2, i32 %phi3
368 store i32 %sel_3_1.2, i32* %result
369 store i32 %phi3, i32* %result
373 define void @long_chain_ambiguous_float_in_fpr(i1 %cnd0, i1 %cnd1, i1 %cnd2, float* %a, float* %b, float* %c, float* %result) {
374 ; MIPS32-LABEL: long_chain_ambiguous_float_in_fpr:
375 ; MIPS32: # %bb.0: # %entry
376 ; MIPS32-NEXT: addiu $sp, $sp, -48
377 ; MIPS32-NEXT: .cfi_def_cfa_offset 48
378 ; MIPS32-NEXT: addiu $1, $sp, 64
379 ; MIPS32-NEXT: lw $1, 0($1)
380 ; MIPS32-NEXT: addiu $2, $sp, 68
381 ; MIPS32-NEXT: lw $2, 0($2)
382 ; MIPS32-NEXT: addiu $3, $sp, 72
383 ; MIPS32-NEXT: lw $3, 0($3)
384 ; MIPS32-NEXT: ori $8, $zero, 1
385 ; MIPS32-NEXT: and $8, $4, $8
386 ; MIPS32-NEXT: sw $1, 44($sp) # 4-byte Folded Spill
387 ; MIPS32-NEXT: sw $4, 40($sp) # 4-byte Folded Spill
388 ; MIPS32-NEXT: sw $5, 36($sp) # 4-byte Folded Spill
389 ; MIPS32-NEXT: sw $6, 32($sp) # 4-byte Folded Spill
390 ; MIPS32-NEXT: sw $7, 28($sp) # 4-byte Folded Spill
391 ; MIPS32-NEXT: sw $2, 24($sp) # 4-byte Folded Spill
392 ; MIPS32-NEXT: sw $3, 20($sp) # 4-byte Folded Spill
393 ; MIPS32-NEXT: bnez $8, $BB2_9
395 ; MIPS32-NEXT: # %bb.1: # %pre.PHI.1
396 ; MIPS32-NEXT: ori $1, $zero, 1
397 ; MIPS32-NEXT: lw $2, 36($sp) # 4-byte Folded Reload
398 ; MIPS32-NEXT: and $1, $2, $1
399 ; MIPS32-NEXT: bnez $1, $BB2_4
401 ; MIPS32-NEXT: # %bb.2: # %pre.PHI.1.0
402 ; MIPS32-NEXT: ori $1, $zero, 1
403 ; MIPS32-NEXT: lw $2, 32($sp) # 4-byte Folded Reload
404 ; MIPS32-NEXT: and $1, $2, $1
405 ; MIPS32-NEXT: bnez $1, $BB2_5
407 ; MIPS32-NEXT: # %bb.3: # %b.PHI.1.0
408 ; MIPS32-NEXT: lw $1, 28($sp) # 4-byte Folded Reload
409 ; MIPS32-NEXT: lw $2, 0($1)
410 ; MIPS32-NEXT: sw $2, 16($sp) # 4-byte Folded Spill
411 ; MIPS32-NEXT: j $BB2_6
413 ; MIPS32-NEXT: $BB2_4: # %b.PHI.1.1
414 ; MIPS32-NEXT: lw $1, 44($sp) # 4-byte Folded Reload
415 ; MIPS32-NEXT: lw $2, 0($1)
416 ; MIPS32-NEXT: sw $2, 16($sp) # 4-byte Folded Spill
417 ; MIPS32-NEXT: j $BB2_6
419 ; MIPS32-NEXT: $BB2_5: # %b.PHI.1.2
420 ; MIPS32-NEXT: lw $1, 24($sp) # 4-byte Folded Reload
421 ; MIPS32-NEXT: lw $2, 0($1)
422 ; MIPS32-NEXT: sw $2, 16($sp) # 4-byte Folded Spill
423 ; MIPS32-NEXT: $BB2_6: # %b.PHI.1
424 ; MIPS32-NEXT: lw $1, 16($sp) # 4-byte Folded Reload
425 ; MIPS32-NEXT: ori $2, $zero, 1
426 ; MIPS32-NEXT: lw $3, 32($sp) # 4-byte Folded Reload
427 ; MIPS32-NEXT: and $2, $3, $2
428 ; MIPS32-NEXT: move $4, $1
429 ; MIPS32-NEXT: sw $1, 12($sp) # 4-byte Folded Spill
430 ; MIPS32-NEXT: sw $4, 8($sp) # 4-byte Folded Spill
431 ; MIPS32-NEXT: bnez $2, $BB2_8
433 ; MIPS32-NEXT: # %bb.7: # %b.PHI.1
434 ; MIPS32-NEXT: j $BB2_15
436 ; MIPS32-NEXT: $BB2_8: # %b.PHI.1.end
437 ; MIPS32-NEXT: lw $1, 12($sp) # 4-byte Folded Reload
438 ; MIPS32-NEXT: lw $2, 20($sp) # 4-byte Folded Reload
439 ; MIPS32-NEXT: sw $1, 0($2)
440 ; MIPS32-NEXT: addiu $sp, $sp, 48
441 ; MIPS32-NEXT: jr $ra
443 ; MIPS32-NEXT: $BB2_9: # %pre.PHI.2
444 ; MIPS32-NEXT: ori $1, $zero, 1
445 ; MIPS32-NEXT: lw $2, 40($sp) # 4-byte Folded Reload
446 ; MIPS32-NEXT: and $1, $2, $1
447 ; MIPS32-NEXT: bnez $1, $BB2_11
449 ; MIPS32-NEXT: # %bb.10: # %pre.PHI.2
450 ; MIPS32-NEXT: j $BB2_12
452 ; MIPS32-NEXT: $BB2_11: # %b.PHI.2.0
453 ; MIPS32-NEXT: lw $1, 28($sp) # 4-byte Folded Reload
454 ; MIPS32-NEXT: lw $2, 0($1)
455 ; MIPS32-NEXT: sw $2, 4($sp) # 4-byte Folded Spill
456 ; MIPS32-NEXT: j $BB2_13
458 ; MIPS32-NEXT: $BB2_12: # %b.PHI.2.1
459 ; MIPS32-NEXT: lw $1, 44($sp) # 4-byte Folded Reload
460 ; MIPS32-NEXT: lw $2, 0($1)
461 ; MIPS32-NEXT: sw $2, 4($sp) # 4-byte Folded Spill
462 ; MIPS32-NEXT: $BB2_13: # %b.PHI.2
463 ; MIPS32-NEXT: lw $1, 4($sp) # 4-byte Folded Reload
464 ; MIPS32-NEXT: ori $2, $zero, 1
465 ; MIPS32-NEXT: lw $3, 36($sp) # 4-byte Folded Reload
466 ; MIPS32-NEXT: and $2, $3, $2
467 ; MIPS32-NEXT: move $4, $1
468 ; MIPS32-NEXT: sw $1, 0($sp) # 4-byte Folded Spill
469 ; MIPS32-NEXT: sw $4, 8($sp) # 4-byte Folded Spill
470 ; MIPS32-NEXT: bnez $2, $BB2_15
472 ; MIPS32-NEXT: # %bb.14: # %b.PHI.2.end
473 ; MIPS32-NEXT: lw $1, 0($sp) # 4-byte Folded Reload
474 ; MIPS32-NEXT: lw $2, 20($sp) # 4-byte Folded Reload
475 ; MIPS32-NEXT: sw $1, 0($2)
476 ; MIPS32-NEXT: addiu $sp, $sp, 48
477 ; MIPS32-NEXT: jr $ra
479 ; MIPS32-NEXT: $BB2_15: # %b.PHI.3
480 ; MIPS32-NEXT: lw $1, 8($sp) # 4-byte Folded Reload
481 ; MIPS32-NEXT: lw $2, 8($sp) # 4-byte Folded Reload
482 ; MIPS32-NEXT: ori $3, $zero, 1
483 ; MIPS32-NEXT: lw $4, 32($sp) # 4-byte Folded Reload
484 ; MIPS32-NEXT: and $5, $4, $3
485 ; MIPS32-NEXT: movn $1, $2, $5
486 ; MIPS32-NEXT: lw $5, 36($sp) # 4-byte Folded Reload
487 ; MIPS32-NEXT: and $3, $5, $3
488 ; MIPS32-NEXT: move $6, $2
489 ; MIPS32-NEXT: movn $6, $1, $3
490 ; MIPS32-NEXT: lw $1, 20($sp) # 4-byte Folded Reload
491 ; MIPS32-NEXT: sw $6, 0($1)
492 ; MIPS32-NEXT: sw $2, 0($1)
493 ; MIPS32-NEXT: addiu $sp, $sp, 48
494 ; MIPS32-NEXT: jr $ra
497 br i1 %cnd0, label %pre.PHI.2, label %pre.PHI.1
500 br i1 %cnd1, label %b.PHI.1.1, label %pre.PHI.1.0
503 br i1 %cnd2, label %b.PHI.1.2, label %b.PHI.1.0
506 %phi1.0 = load float, float* %a
510 %phi1.1 = load float, float* %b
514 %phi1.2 = load float, float* %c
518 %phi1 = phi float [ %phi1.0, %b.PHI.1.0 ], [ %phi1.1, %b.PHI.1.1 ], [ %phi1.2, %b.PHI.1.2 ]
519 br i1 %cnd2, label %b.PHI.1.end, label %b.PHI.3
522 store float %phi1, float* %result
526 br i1 %cnd0, label %b.PHI.2.0, label %b.PHI.2.1
529 %phi2.0 = load float, float* %a
533 %phi2.1 = load float, float* %b
537 %phi2 = phi float [ %phi2.0, %b.PHI.2.0 ], [ %phi2.1, %b.PHI.2.1 ]
538 br i1 %cnd1, label %b.PHI.3, label %b.PHI.2.end
541 store float %phi2, float* %result
545 %phi3 = phi float [ %phi2, %b.PHI.2], [ %phi1, %b.PHI.1 ]
546 %phi4 = phi float [ %phi2, %b.PHI.2], [ %phi1, %b.PHI.1 ]
547 %sel_1.2 = select i1 %cnd2, float %phi3, float %phi4
548 %sel_3_1.2 = select i1 %cnd1, float %sel_1.2, float %phi3
549 store float %sel_3_1.2, float* %result
550 store float %phi3, float* %result
555 define void @long_chain_float_in_fpr(i1 %cnd0, i1 %cnd1, i1 %cnd2, float* %a, float* %b, float* %c, float* %result) {
556 ; MIPS32-LABEL: long_chain_float_in_fpr:
557 ; MIPS32: # %bb.0: # %entry
558 ; MIPS32-NEXT: addiu $sp, $sp, -56
559 ; MIPS32-NEXT: .cfi_def_cfa_offset 56
560 ; MIPS32-NEXT: addiu $1, $sp, 72
561 ; MIPS32-NEXT: lw $1, 0($1)
562 ; MIPS32-NEXT: addiu $2, $sp, 76
563 ; MIPS32-NEXT: lw $2, 0($2)
564 ; MIPS32-NEXT: addiu $3, $sp, 80
565 ; MIPS32-NEXT: lw $3, 0($3)
566 ; MIPS32-NEXT: ori $8, $zero, 0
567 ; MIPS32-NEXT: mtc1 $8, $f0
568 ; MIPS32-NEXT: ori $8, $zero, 1
569 ; MIPS32-NEXT: and $8, $4, $8
570 ; MIPS32-NEXT: sw $1, 52($sp) # 4-byte Folded Spill
571 ; MIPS32-NEXT: sw $4, 48($sp) # 4-byte Folded Spill
572 ; MIPS32-NEXT: sw $5, 44($sp) # 4-byte Folded Spill
573 ; MIPS32-NEXT: sw $6, 40($sp) # 4-byte Folded Spill
574 ; MIPS32-NEXT: sw $7, 36($sp) # 4-byte Folded Spill
575 ; MIPS32-NEXT: sw $2, 32($sp) # 4-byte Folded Spill
576 ; MIPS32-NEXT: sw $3, 28($sp) # 4-byte Folded Spill
577 ; MIPS32-NEXT: swc1 $f0, 24($sp) # 4-byte Folded Spill
578 ; MIPS32-NEXT: bnez $8, $BB3_9
580 ; MIPS32-NEXT: # %bb.1: # %pre.PHI.1
581 ; MIPS32-NEXT: ori $1, $zero, 1
582 ; MIPS32-NEXT: lw $2, 44($sp) # 4-byte Folded Reload
583 ; MIPS32-NEXT: and $1, $2, $1
584 ; MIPS32-NEXT: bnez $1, $BB3_4
586 ; MIPS32-NEXT: # %bb.2: # %pre.PHI.1.0
587 ; MIPS32-NEXT: ori $1, $zero, 1
588 ; MIPS32-NEXT: lw $2, 40($sp) # 4-byte Folded Reload
589 ; MIPS32-NEXT: and $1, $2, $1
590 ; MIPS32-NEXT: bnez $1, $BB3_5
592 ; MIPS32-NEXT: # %bb.3: # %b.PHI.1.0
593 ; MIPS32-NEXT: lw $1, 36($sp) # 4-byte Folded Reload
594 ; MIPS32-NEXT: lwc1 $f0, 0($1)
595 ; MIPS32-NEXT: swc1 $f0, 20($sp) # 4-byte Folded Spill
596 ; MIPS32-NEXT: j $BB3_6
598 ; MIPS32-NEXT: $BB3_4: # %b.PHI.1.1
599 ; MIPS32-NEXT: lw $1, 52($sp) # 4-byte Folded Reload
600 ; MIPS32-NEXT: lwc1 $f0, 0($1)
601 ; MIPS32-NEXT: swc1 $f0, 20($sp) # 4-byte Folded Spill
602 ; MIPS32-NEXT: j $BB3_6
604 ; MIPS32-NEXT: $BB3_5: # %b.PHI.1.2
605 ; MIPS32-NEXT: lw $1, 32($sp) # 4-byte Folded Reload
606 ; MIPS32-NEXT: lwc1 $f0, 0($1)
607 ; MIPS32-NEXT: swc1 $f0, 20($sp) # 4-byte Folded Spill
608 ; MIPS32-NEXT: $BB3_6: # %b.PHI.1
609 ; MIPS32-NEXT: lwc1 $f0, 20($sp) # 4-byte Folded Reload
610 ; MIPS32-NEXT: ori $1, $zero, 1
611 ; MIPS32-NEXT: lw $2, 40($sp) # 4-byte Folded Reload
612 ; MIPS32-NEXT: and $1, $2, $1
613 ; MIPS32-NEXT: mov.s $f1, $f0
614 ; MIPS32-NEXT: lwc1 $f2, 24($sp) # 4-byte Folded Reload
615 ; MIPS32-NEXT: swc1 $f0, 16($sp) # 4-byte Folded Spill
616 ; MIPS32-NEXT: swc1 $f1, 12($sp) # 4-byte Folded Spill
617 ; MIPS32-NEXT: swc1 $f2, 8($sp) # 4-byte Folded Spill
618 ; MIPS32-NEXT: bnez $1, $BB3_8
620 ; MIPS32-NEXT: # %bb.7: # %b.PHI.1
621 ; MIPS32-NEXT: j $BB3_15
623 ; MIPS32-NEXT: $BB3_8: # %b.PHI.1.end
624 ; MIPS32-NEXT: lwc1 $f0, 16($sp) # 4-byte Folded Reload
625 ; MIPS32-NEXT: lw $1, 28($sp) # 4-byte Folded Reload
626 ; MIPS32-NEXT: swc1 $f0, 0($1)
627 ; MIPS32-NEXT: addiu $sp, $sp, 56
628 ; MIPS32-NEXT: jr $ra
630 ; MIPS32-NEXT: $BB3_9: # %pre.PHI.2
631 ; MIPS32-NEXT: ori $1, $zero, 1
632 ; MIPS32-NEXT: lw $2, 48($sp) # 4-byte Folded Reload
633 ; MIPS32-NEXT: and $1, $2, $1
634 ; MIPS32-NEXT: bnez $1, $BB3_11
636 ; MIPS32-NEXT: # %bb.10: # %pre.PHI.2
637 ; MIPS32-NEXT: j $BB3_12
639 ; MIPS32-NEXT: $BB3_11: # %b.PHI.2.0
640 ; MIPS32-NEXT: lw $1, 36($sp) # 4-byte Folded Reload
641 ; MIPS32-NEXT: lwc1 $f0, 0($1)
642 ; MIPS32-NEXT: swc1 $f0, 4($sp) # 4-byte Folded Spill
643 ; MIPS32-NEXT: j $BB3_13
645 ; MIPS32-NEXT: $BB3_12: # %b.PHI.2.1
646 ; MIPS32-NEXT: lw $1, 52($sp) # 4-byte Folded Reload
647 ; MIPS32-NEXT: lwc1 $f0, 0($1)
648 ; MIPS32-NEXT: swc1 $f0, 4($sp) # 4-byte Folded Spill
649 ; MIPS32-NEXT: $BB3_13: # %b.PHI.2
650 ; MIPS32-NEXT: lwc1 $f0, 4($sp) # 4-byte Folded Reload
651 ; MIPS32-NEXT: ori $1, $zero, 1
652 ; MIPS32-NEXT: lw $2, 44($sp) # 4-byte Folded Reload
653 ; MIPS32-NEXT: and $1, $2, $1
654 ; MIPS32-NEXT: mov.s $f1, $f0
655 ; MIPS32-NEXT: mov.s $f2, $f0
656 ; MIPS32-NEXT: swc1 $f0, 0($sp) # 4-byte Folded Spill
657 ; MIPS32-NEXT: swc1 $f1, 12($sp) # 4-byte Folded Spill
658 ; MIPS32-NEXT: swc1 $f2, 8($sp) # 4-byte Folded Spill
659 ; MIPS32-NEXT: bnez $1, $BB3_15
661 ; MIPS32-NEXT: # %bb.14: # %b.PHI.2.end
662 ; MIPS32-NEXT: lwc1 $f0, 0($sp) # 4-byte Folded Reload
663 ; MIPS32-NEXT: lw $1, 28($sp) # 4-byte Folded Reload
664 ; MIPS32-NEXT: swc1 $f0, 0($1)
665 ; MIPS32-NEXT: addiu $sp, $sp, 56
666 ; MIPS32-NEXT: jr $ra
668 ; MIPS32-NEXT: $BB3_15: # %b.PHI.3
669 ; MIPS32-NEXT: lwc1 $f0, 8($sp) # 4-byte Folded Reload
670 ; MIPS32-NEXT: lwc1 $f1, 12($sp) # 4-byte Folded Reload
671 ; MIPS32-NEXT: ori $1, $zero, 1
672 ; MIPS32-NEXT: lw $2, 40($sp) # 4-byte Folded Reload
673 ; MIPS32-NEXT: and $3, $2, $1
674 ; MIPS32-NEXT: movn.s $f0, $f1, $3
675 ; MIPS32-NEXT: lw $3, 44($sp) # 4-byte Folded Reload
676 ; MIPS32-NEXT: and $1, $3, $1
677 ; MIPS32-NEXT: mov.s $f2, $f1
678 ; MIPS32-NEXT: movn.s $f2, $f0, $1
679 ; MIPS32-NEXT: lw $1, 28($sp) # 4-byte Folded Reload
680 ; MIPS32-NEXT: swc1 $f2, 0($1)
681 ; MIPS32-NEXT: swc1 $f1, 0($1)
682 ; MIPS32-NEXT: addiu $sp, $sp, 56
683 ; MIPS32-NEXT: jr $ra
686 br i1 %cnd0, label %pre.PHI.2, label %pre.PHI.1
689 br i1 %cnd1, label %b.PHI.1.1, label %pre.PHI.1.0
692 br i1 %cnd2, label %b.PHI.1.2, label %b.PHI.1.0
695 %phi1.0 = load float, float* %a
699 %phi1.1 = load float, float* %b
703 %phi1.2 = load float, float* %c
707 %phi1 = phi float [ %phi1.0, %b.PHI.1.0 ], [ %phi1.1, %b.PHI.1.1 ], [ %phi1.2, %b.PHI.1.2 ]
708 br i1 %cnd2, label %b.PHI.1.end, label %b.PHI.3
711 store float %phi1, float* %result
715 br i1 %cnd0, label %b.PHI.2.0, label %b.PHI.2.1
718 %phi2.0 = load float, float* %a
722 %phi2.1 = load float, float* %b
726 %phi2 = phi float [ %phi2.0, %b.PHI.2.0 ], [ %phi2.1, %b.PHI.2.1 ]
727 br i1 %cnd1, label %b.PHI.3, label %b.PHI.2.end
730 store float %phi2, float* %result
734 %phi3 = phi float [ %phi2, %b.PHI.2], [ %phi1, %b.PHI.1 ]
735 %phi4 = phi float [ %phi2, %b.PHI.2], [ 0.0, %b.PHI.1 ]
736 %sel_1.2 = select i1 %cnd2, float %phi3, float %phi4
737 %sel_3_1.2 = select i1 %cnd1, float %sel_1.2, float %phi3
738 store float %sel_3_1.2, float* %result
739 store float %phi3, float* %result