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, ptr %a, ptr %b, ptr %c, ptr %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: sw $4, 20($sp) # 4-byte Folded Spill
10 ; MIPS32-NEXT: sw $5, 24($sp) # 4-byte Folded Spill
11 ; MIPS32-NEXT: sw $6, 28($sp) # 4-byte Folded Spill
12 ; MIPS32-NEXT: sw $7, 32($sp) # 4-byte Folded Spill
13 ; MIPS32-NEXT: addiu $1, $sp, 64
14 ; MIPS32-NEXT: lw $1, 0($1)
15 ; MIPS32-NEXT: sw $1, 36($sp) # 4-byte Folded Spill
16 ; MIPS32-NEXT: addiu $1, $sp, 68
17 ; MIPS32-NEXT: lw $1, 0($1)
18 ; MIPS32-NEXT: sw $1, 40($sp) # 4-byte Folded Spill
19 ; MIPS32-NEXT: addiu $1, $sp, 72
20 ; MIPS32-NEXT: lw $1, 0($1)
21 ; MIPS32-NEXT: sw $1, 44($sp) # 4-byte Folded Spill
22 ; MIPS32-NEXT: andi $1, $4, 1
23 ; MIPS32-NEXT: bnez $1, $BB0_12
25 ; MIPS32-NEXT: # %bb.1: # %entry
26 ; MIPS32-NEXT: j $BB0_2
28 ; MIPS32-NEXT: $BB0_2: # %pre.PHI.1
29 ; MIPS32-NEXT: lw $1, 24($sp) # 4-byte Folded Reload
30 ; MIPS32-NEXT: andi $1, $1, 1
31 ; MIPS32-NEXT: bnez $1, $BB0_7
33 ; MIPS32-NEXT: # %bb.3: # %pre.PHI.1
34 ; MIPS32-NEXT: j $BB0_4
36 ; MIPS32-NEXT: $BB0_4: # %pre.PHI.1.0
37 ; MIPS32-NEXT: lw $1, 28($sp) # 4-byte Folded Reload
38 ; MIPS32-NEXT: andi $1, $1, 1
39 ; MIPS32-NEXT: bnez $1, $BB0_8
41 ; MIPS32-NEXT: # %bb.5: # %pre.PHI.1.0
42 ; MIPS32-NEXT: j $BB0_6
44 ; MIPS32-NEXT: $BB0_6: # %b.PHI.1.0
45 ; MIPS32-NEXT: lw $1, 32($sp) # 4-byte Folded Reload
46 ; MIPS32-NEXT: lw $1, 0($1)
47 ; MIPS32-NEXT: sw $1, 16($sp) # 4-byte Folded Spill
48 ; MIPS32-NEXT: j $BB0_9
50 ; MIPS32-NEXT: $BB0_7: # %b.PHI.1.1
51 ; MIPS32-NEXT: lw $1, 36($sp) # 4-byte Folded Reload
52 ; MIPS32-NEXT: lw $1, 0($1)
53 ; MIPS32-NEXT: sw $1, 16($sp) # 4-byte Folded Spill
54 ; MIPS32-NEXT: j $BB0_9
56 ; MIPS32-NEXT: $BB0_8: # %b.PHI.1.2
57 ; MIPS32-NEXT: lw $1, 40($sp) # 4-byte Folded Reload
58 ; MIPS32-NEXT: lw $1, 0($1)
59 ; MIPS32-NEXT: sw $1, 16($sp) # 4-byte Folded Spill
60 ; MIPS32-NEXT: j $BB0_9
62 ; MIPS32-NEXT: $BB0_9: # %b.PHI.1
63 ; MIPS32-NEXT: lw $1, 28($sp) # 4-byte Folded Reload
64 ; MIPS32-NEXT: lw $2, 16($sp) # 4-byte Folded Reload
65 ; MIPS32-NEXT: sw $2, 8($sp) # 4-byte Folded Spill
66 ; MIPS32-NEXT: andi $1, $1, 1
67 ; MIPS32-NEXT: sw $2, 12($sp) # 4-byte Folded Spill
68 ; MIPS32-NEXT: bnez $1, $BB0_11
70 ; MIPS32-NEXT: # %bb.10: # %b.PHI.1
71 ; MIPS32-NEXT: j $BB0_19
73 ; MIPS32-NEXT: $BB0_11: # %b.PHI.1.end
74 ; MIPS32-NEXT: lw $1, 8($sp) # 4-byte Folded Reload
75 ; MIPS32-NEXT: lw $2, 44($sp) # 4-byte Folded Reload
76 ; MIPS32-NEXT: sw $1, 0($2)
77 ; MIPS32-NEXT: addiu $sp, $sp, 48
80 ; MIPS32-NEXT: $BB0_12: # %pre.PHI.2
81 ; MIPS32-NEXT: lw $1, 20($sp) # 4-byte Folded Reload
82 ; MIPS32-NEXT: andi $1, $1, 1
83 ; MIPS32-NEXT: bnez $1, $BB0_14
85 ; MIPS32-NEXT: # %bb.13: # %pre.PHI.2
86 ; MIPS32-NEXT: j $BB0_15
88 ; MIPS32-NEXT: $BB0_14: # %b.PHI.2.0
89 ; MIPS32-NEXT: lw $1, 32($sp) # 4-byte Folded Reload
90 ; MIPS32-NEXT: lw $1, 0($1)
91 ; MIPS32-NEXT: sw $1, 4($sp) # 4-byte Folded Spill
92 ; MIPS32-NEXT: j $BB0_16
94 ; MIPS32-NEXT: $BB0_15: # %b.PHI.2.1
95 ; MIPS32-NEXT: lw $1, 36($sp) # 4-byte Folded Reload
96 ; MIPS32-NEXT: lw $1, 0($1)
97 ; MIPS32-NEXT: sw $1, 4($sp) # 4-byte Folded Spill
98 ; MIPS32-NEXT: j $BB0_16
100 ; MIPS32-NEXT: $BB0_16: # %b.PHI.2
101 ; MIPS32-NEXT: lw $1, 24($sp) # 4-byte Folded Reload
102 ; MIPS32-NEXT: lw $2, 4($sp) # 4-byte Folded Reload
103 ; MIPS32-NEXT: sw $2, 0($sp) # 4-byte Folded Spill
104 ; MIPS32-NEXT: andi $1, $1, 1
105 ; MIPS32-NEXT: sw $2, 12($sp) # 4-byte Folded Spill
106 ; MIPS32-NEXT: bnez $1, $BB0_19
108 ; MIPS32-NEXT: # %bb.17: # %b.PHI.2
109 ; MIPS32-NEXT: j $BB0_18
111 ; MIPS32-NEXT: $BB0_18: # %b.PHI.2.end
112 ; MIPS32-NEXT: lw $1, 0($sp) # 4-byte Folded Reload
113 ; MIPS32-NEXT: lw $2, 44($sp) # 4-byte Folded Reload
114 ; MIPS32-NEXT: sw $1, 0($2)
115 ; MIPS32-NEXT: addiu $sp, $sp, 48
116 ; MIPS32-NEXT: jr $ra
118 ; MIPS32-NEXT: $BB0_19: # %b.PHI.3
119 ; MIPS32-NEXT: lw $2, 44($sp) # 4-byte Folded Reload
120 ; MIPS32-NEXT: lw $3, 24($sp) # 4-byte Folded Reload
121 ; MIPS32-NEXT: lw $5, 28($sp) # 4-byte Folded Reload
122 ; MIPS32-NEXT: lw $1, 12($sp) # 4-byte Folded Reload
123 ; MIPS32-NEXT: move $4, $1
124 ; MIPS32-NEXT: andi $5, $5, 1
125 ; MIPS32-NEXT: movn $4, $1, $5
126 ; MIPS32-NEXT: andi $5, $3, 1
127 ; MIPS32-NEXT: move $3, $1
128 ; MIPS32-NEXT: movn $3, $4, $5
129 ; MIPS32-NEXT: sw $3, 0($2)
130 ; MIPS32-NEXT: sw $1, 0($2)
131 ; MIPS32-NEXT: addiu $sp, $sp, 48
132 ; MIPS32-NEXT: jr $ra
135 br i1 %cnd0, label %pre.PHI.2, label %pre.PHI.1
138 br i1 %cnd1, label %b.PHI.1.1, label %pre.PHI.1.0
141 br i1 %cnd2, label %b.PHI.1.2, label %b.PHI.1.0
144 %phi1.0 = load i32, ptr %a
148 %phi1.1 = load i32, ptr %b
152 %phi1.2 = load i32, ptr %c
156 %phi1 = phi i32 [ %phi1.0, %b.PHI.1.0 ], [ %phi1.1, %b.PHI.1.1 ], [ %phi1.2, %b.PHI.1.2 ]
157 br i1 %cnd2, label %b.PHI.1.end, label %b.PHI.3
160 store i32 %phi1, ptr %result
164 br i1 %cnd0, label %b.PHI.2.0, label %b.PHI.2.1
167 %phi2.0 = load i32, ptr %a
171 %phi2.1 = load i32, ptr %b
175 %phi2 = phi i32 [ %phi2.0, %b.PHI.2.0 ], [ %phi2.1, %b.PHI.2.1 ]
176 br i1 %cnd1, label %b.PHI.3, label %b.PHI.2.end
179 store i32 %phi2, ptr %result
183 %phi3 = phi i32 [ %phi2, %b.PHI.2], [ %phi1, %b.PHI.1 ]
184 %phi4 = phi i32 [ %phi2, %b.PHI.2], [ %phi1, %b.PHI.1 ]
185 %sel_1.2 = select i1 %cnd2, i32 %phi3, i32 %phi4
186 %sel_3_1.2 = select i1 %cnd1, i32 %sel_1.2, i32 %phi3
187 store i32 %sel_3_1.2, ptr %result
188 store i32 %phi3, ptr %result
193 define void @long_chain_i32_in_gpr(i1 %cnd0, i1 %cnd1, i1 %cnd2, ptr %a, ptr %b, ptr %c, ptr %result) {
194 ; MIPS32-LABEL: long_chain_i32_in_gpr:
195 ; MIPS32: # %bb.0: # %entry
196 ; MIPS32-NEXT: addiu $sp, $sp, -56
197 ; MIPS32-NEXT: .cfi_def_cfa_offset 56
198 ; MIPS32-NEXT: sw $4, 24($sp) # 4-byte Folded Spill
199 ; MIPS32-NEXT: sw $5, 28($sp) # 4-byte Folded Spill
200 ; MIPS32-NEXT: sw $6, 32($sp) # 4-byte Folded Spill
201 ; MIPS32-NEXT: sw $7, 36($sp) # 4-byte Folded Spill
202 ; MIPS32-NEXT: addiu $1, $sp, 72
203 ; MIPS32-NEXT: lw $1, 0($1)
204 ; MIPS32-NEXT: sw $1, 40($sp) # 4-byte Folded Spill
205 ; MIPS32-NEXT: addiu $1, $sp, 76
206 ; MIPS32-NEXT: lw $1, 0($1)
207 ; MIPS32-NEXT: sw $1, 44($sp) # 4-byte Folded Spill
208 ; MIPS32-NEXT: addiu $1, $sp, 80
209 ; MIPS32-NEXT: lw $1, 0($1)
210 ; MIPS32-NEXT: sw $1, 48($sp) # 4-byte Folded Spill
211 ; MIPS32-NEXT: ori $1, $zero, 0
212 ; MIPS32-NEXT: sw $1, 52($sp) # 4-byte Folded Spill
213 ; MIPS32-NEXT: andi $1, $4, 1
214 ; MIPS32-NEXT: bnez $1, $BB1_12
216 ; MIPS32-NEXT: # %bb.1: # %entry
217 ; MIPS32-NEXT: j $BB1_2
219 ; MIPS32-NEXT: $BB1_2: # %pre.PHI.1
220 ; MIPS32-NEXT: lw $1, 28($sp) # 4-byte Folded Reload
221 ; MIPS32-NEXT: andi $1, $1, 1
222 ; MIPS32-NEXT: bnez $1, $BB1_7
224 ; MIPS32-NEXT: # %bb.3: # %pre.PHI.1
225 ; MIPS32-NEXT: j $BB1_4
227 ; MIPS32-NEXT: $BB1_4: # %pre.PHI.1.0
228 ; MIPS32-NEXT: lw $1, 32($sp) # 4-byte Folded Reload
229 ; MIPS32-NEXT: andi $1, $1, 1
230 ; MIPS32-NEXT: bnez $1, $BB1_8
232 ; MIPS32-NEXT: # %bb.5: # %pre.PHI.1.0
233 ; MIPS32-NEXT: j $BB1_6
235 ; MIPS32-NEXT: $BB1_6: # %b.PHI.1.0
236 ; MIPS32-NEXT: lw $1, 36($sp) # 4-byte Folded Reload
237 ; MIPS32-NEXT: lw $1, 0($1)
238 ; MIPS32-NEXT: sw $1, 20($sp) # 4-byte Folded Spill
239 ; MIPS32-NEXT: j $BB1_9
241 ; MIPS32-NEXT: $BB1_7: # %b.PHI.1.1
242 ; MIPS32-NEXT: lw $1, 40($sp) # 4-byte Folded Reload
243 ; MIPS32-NEXT: lw $1, 0($1)
244 ; MIPS32-NEXT: sw $1, 20($sp) # 4-byte Folded Spill
245 ; MIPS32-NEXT: j $BB1_9
247 ; MIPS32-NEXT: $BB1_8: # %b.PHI.1.2
248 ; MIPS32-NEXT: lw $1, 44($sp) # 4-byte Folded Reload
249 ; MIPS32-NEXT: lw $1, 0($1)
250 ; MIPS32-NEXT: sw $1, 20($sp) # 4-byte Folded Spill
251 ; MIPS32-NEXT: j $BB1_9
253 ; MIPS32-NEXT: $BB1_9: # %b.PHI.1
254 ; MIPS32-NEXT: lw $2, 52($sp) # 4-byte Folded Reload
255 ; MIPS32-NEXT: lw $1, 32($sp) # 4-byte Folded Reload
256 ; MIPS32-NEXT: lw $3, 20($sp) # 4-byte Folded Reload
257 ; MIPS32-NEXT: sw $3, 8($sp) # 4-byte Folded Spill
258 ; MIPS32-NEXT: andi $1, $1, 1
259 ; MIPS32-NEXT: sw $3, 12($sp) # 4-byte Folded Spill
260 ; MIPS32-NEXT: sw $2, 16($sp) # 4-byte Folded Spill
261 ; MIPS32-NEXT: bnez $1, $BB1_11
263 ; MIPS32-NEXT: # %bb.10: # %b.PHI.1
264 ; MIPS32-NEXT: j $BB1_19
266 ; MIPS32-NEXT: $BB1_11: # %b.PHI.1.end
267 ; MIPS32-NEXT: lw $1, 8($sp) # 4-byte Folded Reload
268 ; MIPS32-NEXT: lw $2, 48($sp) # 4-byte Folded Reload
269 ; MIPS32-NEXT: sw $1, 0($2)
270 ; MIPS32-NEXT: addiu $sp, $sp, 56
271 ; MIPS32-NEXT: jr $ra
273 ; MIPS32-NEXT: $BB1_12: # %pre.PHI.2
274 ; MIPS32-NEXT: lw $1, 24($sp) # 4-byte Folded Reload
275 ; MIPS32-NEXT: andi $1, $1, 1
276 ; MIPS32-NEXT: bnez $1, $BB1_14
278 ; MIPS32-NEXT: # %bb.13: # %pre.PHI.2
279 ; MIPS32-NEXT: j $BB1_15
281 ; MIPS32-NEXT: $BB1_14: # %b.PHI.2.0
282 ; MIPS32-NEXT: lw $1, 36($sp) # 4-byte Folded Reload
283 ; MIPS32-NEXT: lw $1, 0($1)
284 ; MIPS32-NEXT: sw $1, 4($sp) # 4-byte Folded Spill
285 ; MIPS32-NEXT: j $BB1_16
287 ; MIPS32-NEXT: $BB1_15: # %b.PHI.2.1
288 ; MIPS32-NEXT: lw $1, 40($sp) # 4-byte Folded Reload
289 ; MIPS32-NEXT: lw $1, 0($1)
290 ; MIPS32-NEXT: sw $1, 4($sp) # 4-byte Folded Spill
291 ; MIPS32-NEXT: j $BB1_16
293 ; MIPS32-NEXT: $BB1_16: # %b.PHI.2
294 ; MIPS32-NEXT: lw $1, 28($sp) # 4-byte Folded Reload
295 ; MIPS32-NEXT: lw $2, 4($sp) # 4-byte Folded Reload
296 ; MIPS32-NEXT: sw $2, 0($sp) # 4-byte Folded Spill
297 ; MIPS32-NEXT: andi $1, $1, 1
298 ; MIPS32-NEXT: move $3, $2
299 ; MIPS32-NEXT: sw $3, 12($sp) # 4-byte Folded Spill
300 ; MIPS32-NEXT: sw $2, 16($sp) # 4-byte Folded Spill
301 ; MIPS32-NEXT: bnez $1, $BB1_19
303 ; MIPS32-NEXT: # %bb.17: # %b.PHI.2
304 ; MIPS32-NEXT: j $BB1_18
306 ; MIPS32-NEXT: $BB1_18: # %b.PHI.2.end
307 ; MIPS32-NEXT: lw $1, 0($sp) # 4-byte Folded Reload
308 ; MIPS32-NEXT: lw $2, 48($sp) # 4-byte Folded Reload
309 ; MIPS32-NEXT: sw $1, 0($2)
310 ; MIPS32-NEXT: addiu $sp, $sp, 56
311 ; MIPS32-NEXT: jr $ra
313 ; MIPS32-NEXT: $BB1_19: # %b.PHI.3
314 ; MIPS32-NEXT: lw $2, 48($sp) # 4-byte Folded Reload
315 ; MIPS32-NEXT: lw $3, 28($sp) # 4-byte Folded Reload
316 ; MIPS32-NEXT: lw $5, 32($sp) # 4-byte Folded Reload
317 ; MIPS32-NEXT: lw $1, 12($sp) # 4-byte Folded Reload
318 ; MIPS32-NEXT: lw $4, 16($sp) # 4-byte Folded Reload
319 ; MIPS32-NEXT: andi $5, $5, 1
320 ; MIPS32-NEXT: movn $4, $1, $5
321 ; MIPS32-NEXT: andi $5, $3, 1
322 ; MIPS32-NEXT: move $3, $1
323 ; MIPS32-NEXT: movn $3, $4, $5
324 ; MIPS32-NEXT: sw $3, 0($2)
325 ; MIPS32-NEXT: sw $1, 0($2)
326 ; MIPS32-NEXT: addiu $sp, $sp, 56
327 ; MIPS32-NEXT: jr $ra
330 br i1 %cnd0, label %pre.PHI.2, label %pre.PHI.1
333 br i1 %cnd1, label %b.PHI.1.1, label %pre.PHI.1.0
336 br i1 %cnd2, label %b.PHI.1.2, label %b.PHI.1.0
339 %phi1.0 = load i32, ptr %a
343 %phi1.1 = load i32, ptr %b
347 %phi1.2 = load i32, ptr %c
351 %phi1 = phi i32 [ %phi1.0, %b.PHI.1.0 ], [ %phi1.1, %b.PHI.1.1 ], [ %phi1.2, %b.PHI.1.2 ]
352 br i1 %cnd2, label %b.PHI.1.end, label %b.PHI.3
355 store i32 %phi1, ptr %result
359 br i1 %cnd0, label %b.PHI.2.0, label %b.PHI.2.1
362 %phi2.0 = load i32, ptr %a
366 %phi2.1 = load i32, ptr %b
370 %phi2 = phi i32 [ %phi2.0, %b.PHI.2.0 ], [ %phi2.1, %b.PHI.2.1 ]
371 br i1 %cnd1, label %b.PHI.3, label %b.PHI.2.end
374 store i32 %phi2, ptr %result
378 %phi3 = phi i32 [ %phi2, %b.PHI.2], [ %phi1, %b.PHI.1 ]
379 %phi4 = phi i32 [ %phi2, %b.PHI.2], [ 0, %b.PHI.1 ]
380 %sel_1.2 = select i1 %cnd2, i32 %phi3, i32 %phi4
381 %sel_3_1.2 = select i1 %cnd1, i32 %sel_1.2, i32 %phi3
382 store i32 %sel_3_1.2, ptr %result
383 store i32 %phi3, ptr %result
387 define void @long_chain_ambiguous_float_in_fpr(i1 %cnd0, i1 %cnd1, i1 %cnd2, ptr %a, ptr %b, ptr %c, ptr %result) {
388 ; MIPS32-LABEL: long_chain_ambiguous_float_in_fpr:
389 ; MIPS32: # %bb.0: # %entry
390 ; MIPS32-NEXT: addiu $sp, $sp, -48
391 ; MIPS32-NEXT: .cfi_def_cfa_offset 48
392 ; MIPS32-NEXT: sw $4, 20($sp) # 4-byte Folded Spill
393 ; MIPS32-NEXT: sw $5, 24($sp) # 4-byte Folded Spill
394 ; MIPS32-NEXT: sw $6, 28($sp) # 4-byte Folded Spill
395 ; MIPS32-NEXT: sw $7, 32($sp) # 4-byte Folded Spill
396 ; MIPS32-NEXT: addiu $1, $sp, 64
397 ; MIPS32-NEXT: lw $1, 0($1)
398 ; MIPS32-NEXT: sw $1, 36($sp) # 4-byte Folded Spill
399 ; MIPS32-NEXT: addiu $1, $sp, 68
400 ; MIPS32-NEXT: lw $1, 0($1)
401 ; MIPS32-NEXT: sw $1, 40($sp) # 4-byte Folded Spill
402 ; MIPS32-NEXT: addiu $1, $sp, 72
403 ; MIPS32-NEXT: lw $1, 0($1)
404 ; MIPS32-NEXT: sw $1, 44($sp) # 4-byte Folded Spill
405 ; MIPS32-NEXT: andi $1, $4, 1
406 ; MIPS32-NEXT: bnez $1, $BB2_12
408 ; MIPS32-NEXT: # %bb.1: # %entry
409 ; MIPS32-NEXT: j $BB2_2
411 ; MIPS32-NEXT: $BB2_2: # %pre.PHI.1
412 ; MIPS32-NEXT: lw $1, 24($sp) # 4-byte Folded Reload
413 ; MIPS32-NEXT: andi $1, $1, 1
414 ; MIPS32-NEXT: bnez $1, $BB2_7
416 ; MIPS32-NEXT: # %bb.3: # %pre.PHI.1
417 ; MIPS32-NEXT: j $BB2_4
419 ; MIPS32-NEXT: $BB2_4: # %pre.PHI.1.0
420 ; MIPS32-NEXT: lw $1, 28($sp) # 4-byte Folded Reload
421 ; MIPS32-NEXT: andi $1, $1, 1
422 ; MIPS32-NEXT: bnez $1, $BB2_8
424 ; MIPS32-NEXT: # %bb.5: # %pre.PHI.1.0
425 ; MIPS32-NEXT: j $BB2_6
427 ; MIPS32-NEXT: $BB2_6: # %b.PHI.1.0
428 ; MIPS32-NEXT: lw $1, 32($sp) # 4-byte Folded Reload
429 ; MIPS32-NEXT: lw $1, 0($1)
430 ; MIPS32-NEXT: sw $1, 16($sp) # 4-byte Folded Spill
431 ; MIPS32-NEXT: j $BB2_9
433 ; MIPS32-NEXT: $BB2_7: # %b.PHI.1.1
434 ; MIPS32-NEXT: lw $1, 36($sp) # 4-byte Folded Reload
435 ; MIPS32-NEXT: lw $1, 0($1)
436 ; MIPS32-NEXT: sw $1, 16($sp) # 4-byte Folded Spill
437 ; MIPS32-NEXT: j $BB2_9
439 ; MIPS32-NEXT: $BB2_8: # %b.PHI.1.2
440 ; MIPS32-NEXT: lw $1, 40($sp) # 4-byte Folded Reload
441 ; MIPS32-NEXT: lw $1, 0($1)
442 ; MIPS32-NEXT: sw $1, 16($sp) # 4-byte Folded Spill
443 ; MIPS32-NEXT: j $BB2_9
445 ; MIPS32-NEXT: $BB2_9: # %b.PHI.1
446 ; MIPS32-NEXT: lw $1, 28($sp) # 4-byte Folded Reload
447 ; MIPS32-NEXT: lw $2, 16($sp) # 4-byte Folded Reload
448 ; MIPS32-NEXT: sw $2, 8($sp) # 4-byte Folded Spill
449 ; MIPS32-NEXT: andi $1, $1, 1
450 ; MIPS32-NEXT: sw $2, 12($sp) # 4-byte Folded Spill
451 ; MIPS32-NEXT: bnez $1, $BB2_11
453 ; MIPS32-NEXT: # %bb.10: # %b.PHI.1
454 ; MIPS32-NEXT: j $BB2_19
456 ; MIPS32-NEXT: $BB2_11: # %b.PHI.1.end
457 ; MIPS32-NEXT: lw $1, 8($sp) # 4-byte Folded Reload
458 ; MIPS32-NEXT: lw $2, 44($sp) # 4-byte Folded Reload
459 ; MIPS32-NEXT: sw $1, 0($2)
460 ; MIPS32-NEXT: addiu $sp, $sp, 48
461 ; MIPS32-NEXT: jr $ra
463 ; MIPS32-NEXT: $BB2_12: # %pre.PHI.2
464 ; MIPS32-NEXT: lw $1, 20($sp) # 4-byte Folded Reload
465 ; MIPS32-NEXT: andi $1, $1, 1
466 ; MIPS32-NEXT: bnez $1, $BB2_14
468 ; MIPS32-NEXT: # %bb.13: # %pre.PHI.2
469 ; MIPS32-NEXT: j $BB2_15
471 ; MIPS32-NEXT: $BB2_14: # %b.PHI.2.0
472 ; MIPS32-NEXT: lw $1, 32($sp) # 4-byte Folded Reload
473 ; MIPS32-NEXT: lw $1, 0($1)
474 ; MIPS32-NEXT: sw $1, 4($sp) # 4-byte Folded Spill
475 ; MIPS32-NEXT: j $BB2_16
477 ; MIPS32-NEXT: $BB2_15: # %b.PHI.2.1
478 ; MIPS32-NEXT: lw $1, 36($sp) # 4-byte Folded Reload
479 ; MIPS32-NEXT: lw $1, 0($1)
480 ; MIPS32-NEXT: sw $1, 4($sp) # 4-byte Folded Spill
481 ; MIPS32-NEXT: j $BB2_16
483 ; MIPS32-NEXT: $BB2_16: # %b.PHI.2
484 ; MIPS32-NEXT: lw $1, 24($sp) # 4-byte Folded Reload
485 ; MIPS32-NEXT: lw $2, 4($sp) # 4-byte Folded Reload
486 ; MIPS32-NEXT: sw $2, 0($sp) # 4-byte Folded Spill
487 ; MIPS32-NEXT: andi $1, $1, 1
488 ; MIPS32-NEXT: sw $2, 12($sp) # 4-byte Folded Spill
489 ; MIPS32-NEXT: bnez $1, $BB2_19
491 ; MIPS32-NEXT: # %bb.17: # %b.PHI.2
492 ; MIPS32-NEXT: j $BB2_18
494 ; MIPS32-NEXT: $BB2_18: # %b.PHI.2.end
495 ; MIPS32-NEXT: lw $1, 0($sp) # 4-byte Folded Reload
496 ; MIPS32-NEXT: lw $2, 44($sp) # 4-byte Folded Reload
497 ; MIPS32-NEXT: sw $1, 0($2)
498 ; MIPS32-NEXT: addiu $sp, $sp, 48
499 ; MIPS32-NEXT: jr $ra
501 ; MIPS32-NEXT: $BB2_19: # %b.PHI.3
502 ; MIPS32-NEXT: lw $2, 44($sp) # 4-byte Folded Reload
503 ; MIPS32-NEXT: lw $3, 24($sp) # 4-byte Folded Reload
504 ; MIPS32-NEXT: lw $5, 28($sp) # 4-byte Folded Reload
505 ; MIPS32-NEXT: lw $1, 12($sp) # 4-byte Folded Reload
506 ; MIPS32-NEXT: move $4, $1
507 ; MIPS32-NEXT: andi $5, $5, 1
508 ; MIPS32-NEXT: movn $4, $1, $5
509 ; MIPS32-NEXT: andi $5, $3, 1
510 ; MIPS32-NEXT: move $3, $1
511 ; MIPS32-NEXT: movn $3, $4, $5
512 ; MIPS32-NEXT: sw $3, 0($2)
513 ; MIPS32-NEXT: sw $1, 0($2)
514 ; MIPS32-NEXT: addiu $sp, $sp, 48
515 ; MIPS32-NEXT: jr $ra
518 br i1 %cnd0, label %pre.PHI.2, label %pre.PHI.1
521 br i1 %cnd1, label %b.PHI.1.1, label %pre.PHI.1.0
524 br i1 %cnd2, label %b.PHI.1.2, label %b.PHI.1.0
527 %phi1.0 = load float, ptr %a
531 %phi1.1 = load float, ptr %b
535 %phi1.2 = load float, ptr %c
539 %phi1 = phi float [ %phi1.0, %b.PHI.1.0 ], [ %phi1.1, %b.PHI.1.1 ], [ %phi1.2, %b.PHI.1.2 ]
540 br i1 %cnd2, label %b.PHI.1.end, label %b.PHI.3
543 store float %phi1, ptr %result
547 br i1 %cnd0, label %b.PHI.2.0, label %b.PHI.2.1
550 %phi2.0 = load float, ptr %a
554 %phi2.1 = load float, ptr %b
558 %phi2 = phi float [ %phi2.0, %b.PHI.2.0 ], [ %phi2.1, %b.PHI.2.1 ]
559 br i1 %cnd1, label %b.PHI.3, label %b.PHI.2.end
562 store float %phi2, ptr %result
566 %phi3 = phi float [ %phi2, %b.PHI.2], [ %phi1, %b.PHI.1 ]
567 %phi4 = phi float [ %phi2, %b.PHI.2], [ %phi1, %b.PHI.1 ]
568 %sel_1.2 = select i1 %cnd2, float %phi3, float %phi4
569 %sel_3_1.2 = select i1 %cnd1, float %sel_1.2, float %phi3
570 store float %sel_3_1.2, ptr %result
571 store float %phi3, ptr %result
576 define void @long_chain_float_in_fpr(i1 %cnd0, i1 %cnd1, i1 %cnd2, ptr %a, ptr %b, ptr %c, ptr %result) {
577 ; MIPS32-LABEL: long_chain_float_in_fpr:
578 ; MIPS32: # %bb.0: # %entry
579 ; MIPS32-NEXT: addiu $sp, $sp, -56
580 ; MIPS32-NEXT: .cfi_def_cfa_offset 56
581 ; MIPS32-NEXT: sw $4, 24($sp) # 4-byte Folded Spill
582 ; MIPS32-NEXT: sw $5, 28($sp) # 4-byte Folded Spill
583 ; MIPS32-NEXT: sw $6, 32($sp) # 4-byte Folded Spill
584 ; MIPS32-NEXT: sw $7, 36($sp) # 4-byte Folded Spill
585 ; MIPS32-NEXT: addiu $1, $sp, 72
586 ; MIPS32-NEXT: lw $1, 0($1)
587 ; MIPS32-NEXT: sw $1, 40($sp) # 4-byte Folded Spill
588 ; MIPS32-NEXT: addiu $1, $sp, 76
589 ; MIPS32-NEXT: lw $1, 0($1)
590 ; MIPS32-NEXT: sw $1, 44($sp) # 4-byte Folded Spill
591 ; MIPS32-NEXT: addiu $1, $sp, 80
592 ; MIPS32-NEXT: lw $1, 0($1)
593 ; MIPS32-NEXT: sw $1, 48($sp) # 4-byte Folded Spill
594 ; MIPS32-NEXT: ori $1, $zero, 0
595 ; MIPS32-NEXT: mtc1 $1, $f0
596 ; MIPS32-NEXT: swc1 $f0, 52($sp) # 4-byte Folded Spill
597 ; MIPS32-NEXT: andi $1, $4, 1
598 ; MIPS32-NEXT: bnez $1, $BB3_12
600 ; MIPS32-NEXT: # %bb.1: # %entry
601 ; MIPS32-NEXT: j $BB3_2
603 ; MIPS32-NEXT: $BB3_2: # %pre.PHI.1
604 ; MIPS32-NEXT: lw $1, 28($sp) # 4-byte Folded Reload
605 ; MIPS32-NEXT: andi $1, $1, 1
606 ; MIPS32-NEXT: bnez $1, $BB3_7
608 ; MIPS32-NEXT: # %bb.3: # %pre.PHI.1
609 ; MIPS32-NEXT: j $BB3_4
611 ; MIPS32-NEXT: $BB3_4: # %pre.PHI.1.0
612 ; MIPS32-NEXT: lw $1, 32($sp) # 4-byte Folded Reload
613 ; MIPS32-NEXT: andi $1, $1, 1
614 ; MIPS32-NEXT: bnez $1, $BB3_8
616 ; MIPS32-NEXT: # %bb.5: # %pre.PHI.1.0
617 ; MIPS32-NEXT: j $BB3_6
619 ; MIPS32-NEXT: $BB3_6: # %b.PHI.1.0
620 ; MIPS32-NEXT: lw $1, 36($sp) # 4-byte Folded Reload
621 ; MIPS32-NEXT: lwc1 $f0, 0($1)
622 ; MIPS32-NEXT: swc1 $f0, 20($sp) # 4-byte Folded Spill
623 ; MIPS32-NEXT: j $BB3_9
625 ; MIPS32-NEXT: $BB3_7: # %b.PHI.1.1
626 ; MIPS32-NEXT: lw $1, 40($sp) # 4-byte Folded Reload
627 ; MIPS32-NEXT: lwc1 $f0, 0($1)
628 ; MIPS32-NEXT: swc1 $f0, 20($sp) # 4-byte Folded Spill
629 ; MIPS32-NEXT: j $BB3_9
631 ; MIPS32-NEXT: $BB3_8: # %b.PHI.1.2
632 ; MIPS32-NEXT: lw $1, 44($sp) # 4-byte Folded Reload
633 ; MIPS32-NEXT: lwc1 $f0, 0($1)
634 ; MIPS32-NEXT: swc1 $f0, 20($sp) # 4-byte Folded Spill
635 ; MIPS32-NEXT: j $BB3_9
637 ; MIPS32-NEXT: $BB3_9: # %b.PHI.1
638 ; MIPS32-NEXT: lwc1 $f0, 52($sp) # 4-byte Folded Reload
639 ; MIPS32-NEXT: lw $1, 32($sp) # 4-byte Folded Reload
640 ; MIPS32-NEXT: lwc1 $f1, 20($sp) # 4-byte Folded Reload
641 ; MIPS32-NEXT: swc1 $f1, 8($sp) # 4-byte Folded Spill
642 ; MIPS32-NEXT: andi $1, $1, 1
643 ; MIPS32-NEXT: swc1 $f1, 12($sp) # 4-byte Folded Spill
644 ; MIPS32-NEXT: swc1 $f0, 16($sp) # 4-byte Folded Spill
645 ; MIPS32-NEXT: bnez $1, $BB3_11
647 ; MIPS32-NEXT: # %bb.10: # %b.PHI.1
648 ; MIPS32-NEXT: j $BB3_19
650 ; MIPS32-NEXT: $BB3_11: # %b.PHI.1.end
651 ; MIPS32-NEXT: lwc1 $f0, 8($sp) # 4-byte Folded Reload
652 ; MIPS32-NEXT: lw $1, 48($sp) # 4-byte Folded Reload
653 ; MIPS32-NEXT: swc1 $f0, 0($1)
654 ; MIPS32-NEXT: addiu $sp, $sp, 56
655 ; MIPS32-NEXT: jr $ra
657 ; MIPS32-NEXT: $BB3_12: # %pre.PHI.2
658 ; MIPS32-NEXT: lw $1, 24($sp) # 4-byte Folded Reload
659 ; MIPS32-NEXT: andi $1, $1, 1
660 ; MIPS32-NEXT: bnez $1, $BB3_14
662 ; MIPS32-NEXT: # %bb.13: # %pre.PHI.2
663 ; MIPS32-NEXT: j $BB3_15
665 ; MIPS32-NEXT: $BB3_14: # %b.PHI.2.0
666 ; MIPS32-NEXT: lw $1, 36($sp) # 4-byte Folded Reload
667 ; MIPS32-NEXT: lwc1 $f0, 0($1)
668 ; MIPS32-NEXT: swc1 $f0, 4($sp) # 4-byte Folded Spill
669 ; MIPS32-NEXT: j $BB3_16
671 ; MIPS32-NEXT: $BB3_15: # %b.PHI.2.1
672 ; MIPS32-NEXT: lw $1, 40($sp) # 4-byte Folded Reload
673 ; MIPS32-NEXT: lwc1 $f0, 0($1)
674 ; MIPS32-NEXT: swc1 $f0, 4($sp) # 4-byte Folded Spill
675 ; MIPS32-NEXT: j $BB3_16
677 ; MIPS32-NEXT: $BB3_16: # %b.PHI.2
678 ; MIPS32-NEXT: lw $1, 28($sp) # 4-byte Folded Reload
679 ; MIPS32-NEXT: lwc1 $f0, 4($sp) # 4-byte Folded Reload
680 ; MIPS32-NEXT: swc1 $f0, 0($sp) # 4-byte Folded Spill
681 ; MIPS32-NEXT: andi $1, $1, 1
682 ; MIPS32-NEXT: mov.s $f1, $f0
683 ; MIPS32-NEXT: swc1 $f1, 12($sp) # 4-byte Folded Spill
684 ; MIPS32-NEXT: swc1 $f0, 16($sp) # 4-byte Folded Spill
685 ; MIPS32-NEXT: bnez $1, $BB3_19
687 ; MIPS32-NEXT: # %bb.17: # %b.PHI.2
688 ; MIPS32-NEXT: j $BB3_18
690 ; MIPS32-NEXT: $BB3_18: # %b.PHI.2.end
691 ; MIPS32-NEXT: lwc1 $f0, 0($sp) # 4-byte Folded Reload
692 ; MIPS32-NEXT: lw $1, 48($sp) # 4-byte Folded Reload
693 ; MIPS32-NEXT: swc1 $f0, 0($1)
694 ; MIPS32-NEXT: addiu $sp, $sp, 56
695 ; MIPS32-NEXT: jr $ra
697 ; MIPS32-NEXT: $BB3_19: # %b.PHI.3
698 ; MIPS32-NEXT: lw $1, 48($sp) # 4-byte Folded Reload
699 ; MIPS32-NEXT: lw $2, 28($sp) # 4-byte Folded Reload
700 ; MIPS32-NEXT: lw $3, 32($sp) # 4-byte Folded Reload
701 ; MIPS32-NEXT: lwc1 $f0, 12($sp) # 4-byte Folded Reload
702 ; MIPS32-NEXT: lwc1 $f2, 16($sp) # 4-byte Folded Reload
703 ; MIPS32-NEXT: andi $3, $3, 1
704 ; MIPS32-NEXT: movn.s $f2, $f0, $3
705 ; MIPS32-NEXT: andi $2, $2, 1
706 ; MIPS32-NEXT: mov.s $f1, $f0
707 ; MIPS32-NEXT: movn.s $f1, $f2, $2
708 ; MIPS32-NEXT: swc1 $f1, 0($1)
709 ; MIPS32-NEXT: swc1 $f0, 0($1)
710 ; MIPS32-NEXT: addiu $sp, $sp, 56
711 ; MIPS32-NEXT: jr $ra
714 br i1 %cnd0, label %pre.PHI.2, label %pre.PHI.1
717 br i1 %cnd1, label %b.PHI.1.1, label %pre.PHI.1.0
720 br i1 %cnd2, label %b.PHI.1.2, label %b.PHI.1.0
723 %phi1.0 = load float, ptr %a
727 %phi1.1 = load float, ptr %b
731 %phi1.2 = load float, ptr %c
735 %phi1 = phi float [ %phi1.0, %b.PHI.1.0 ], [ %phi1.1, %b.PHI.1.1 ], [ %phi1.2, %b.PHI.1.2 ]
736 br i1 %cnd2, label %b.PHI.1.end, label %b.PHI.3
739 store float %phi1, ptr %result
743 br i1 %cnd0, label %b.PHI.2.0, label %b.PHI.2.1
746 %phi2.0 = load float, ptr %a
750 %phi2.1 = load float, ptr %b
754 %phi2 = phi float [ %phi2.0, %b.PHI.2.0 ], [ %phi2.1, %b.PHI.2.1 ]
755 br i1 %cnd1, label %b.PHI.3, label %b.PHI.2.end
758 store float %phi2, ptr %result
762 %phi3 = phi float [ %phi2, %b.PHI.2], [ %phi1, %b.PHI.1 ]
763 %phi4 = phi float [ %phi2, %b.PHI.2], [ 0.0, %b.PHI.1 ]
764 %sel_1.2 = select i1 %cnd2, float %phi3, float %phi4
765 %sel_3_1.2 = select i1 %cnd1, float %sel_1.2, float %phi3
766 store float %sel_3_1.2, ptr %result
767 store float %phi3, ptr %result