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_i64_in_fpr(i1 %cnd0, i1 %cnd1, i1 %cnd2, ptr %a, ptr %b, ptr %c, ptr %result) {
5 ; MIPS32-LABEL: long_chain_ambiguous_i64_in_fpr:
6 ; MIPS32: # %bb.0: # %entry
7 ; MIPS32-NEXT: addiu $sp, $sp, -72
8 ; MIPS32-NEXT: .cfi_def_cfa_offset 72
9 ; MIPS32-NEXT: sw $4, 44($sp) # 4-byte Folded Spill
10 ; MIPS32-NEXT: sw $5, 48($sp) # 4-byte Folded Spill
11 ; MIPS32-NEXT: sw $6, 52($sp) # 4-byte Folded Spill
12 ; MIPS32-NEXT: sw $7, 56($sp) # 4-byte Folded Spill
13 ; MIPS32-NEXT: addiu $1, $sp, 88
14 ; MIPS32-NEXT: lw $1, 0($1)
15 ; MIPS32-NEXT: sw $1, 60($sp) # 4-byte Folded Spill
16 ; MIPS32-NEXT: addiu $1, $sp, 92
17 ; MIPS32-NEXT: lw $1, 0($1)
18 ; MIPS32-NEXT: sw $1, 64($sp) # 4-byte Folded Spill
19 ; MIPS32-NEXT: addiu $1, $sp, 96
20 ; MIPS32-NEXT: lw $1, 0($1)
21 ; MIPS32-NEXT: sw $1, 68($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, 48($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, 52($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, 56($sp) # 4-byte Folded Reload
46 ; MIPS32-NEXT: ldc1 $f0, 0($1)
47 ; MIPS32-NEXT: sdc1 $f0, 32($sp) # 8-byte Folded Spill
48 ; MIPS32-NEXT: j $BB0_9
50 ; MIPS32-NEXT: $BB0_7: # %b.PHI.1.1
51 ; MIPS32-NEXT: lw $1, 60($sp) # 4-byte Folded Reload
52 ; MIPS32-NEXT: ldc1 $f0, 0($1)
53 ; MIPS32-NEXT: sdc1 $f0, 32($sp) # 8-byte Folded Spill
54 ; MIPS32-NEXT: j $BB0_9
56 ; MIPS32-NEXT: $BB0_8: # %b.PHI.1.2
57 ; MIPS32-NEXT: lw $1, 64($sp) # 4-byte Folded Reload
58 ; MIPS32-NEXT: ldc1 $f0, 0($1)
59 ; MIPS32-NEXT: sdc1 $f0, 32($sp) # 8-byte Folded Spill
60 ; MIPS32-NEXT: j $BB0_9
62 ; MIPS32-NEXT: $BB0_9: # %b.PHI.1
63 ; MIPS32-NEXT: lw $1, 52($sp) # 4-byte Folded Reload
64 ; MIPS32-NEXT: ldc1 $f0, 32($sp) # 8-byte Folded Reload
65 ; MIPS32-NEXT: sdc1 $f0, 16($sp) # 8-byte Folded Spill
66 ; MIPS32-NEXT: andi $1, $1, 1
67 ; MIPS32-NEXT: sdc1 $f0, 24($sp) # 8-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: ldc1 $f0, 16($sp) # 8-byte Folded Reload
75 ; MIPS32-NEXT: lw $1, 68($sp) # 4-byte Folded Reload
76 ; MIPS32-NEXT: sdc1 $f0, 0($1)
77 ; MIPS32-NEXT: addiu $sp, $sp, 72
80 ; MIPS32-NEXT: $BB0_12: # %pre.PHI.2
81 ; MIPS32-NEXT: lw $1, 44($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, 56($sp) # 4-byte Folded Reload
90 ; MIPS32-NEXT: ldc1 $f0, 0($1)
91 ; MIPS32-NEXT: sdc1 $f0, 8($sp) # 8-byte Folded Spill
92 ; MIPS32-NEXT: j $BB0_16
94 ; MIPS32-NEXT: $BB0_15: # %b.PHI.2.1
95 ; MIPS32-NEXT: lw $1, 60($sp) # 4-byte Folded Reload
96 ; MIPS32-NEXT: ldc1 $f0, 0($1)
97 ; MIPS32-NEXT: sdc1 $f0, 8($sp) # 8-byte Folded Spill
98 ; MIPS32-NEXT: j $BB0_16
100 ; MIPS32-NEXT: $BB0_16: # %b.PHI.2
101 ; MIPS32-NEXT: lw $1, 48($sp) # 4-byte Folded Reload
102 ; MIPS32-NEXT: ldc1 $f0, 8($sp) # 8-byte Folded Reload
103 ; MIPS32-NEXT: sdc1 $f0, 0($sp) # 8-byte Folded Spill
104 ; MIPS32-NEXT: andi $1, $1, 1
105 ; MIPS32-NEXT: sdc1 $f0, 24($sp) # 8-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: ldc1 $f0, 0($sp) # 8-byte Folded Reload
113 ; MIPS32-NEXT: lw $1, 68($sp) # 4-byte Folded Reload
114 ; MIPS32-NEXT: sdc1 $f0, 0($1)
115 ; MIPS32-NEXT: addiu $sp, $sp, 72
116 ; MIPS32-NEXT: jr $ra
118 ; MIPS32-NEXT: $BB0_19: # %b.PHI.3
119 ; MIPS32-NEXT: lw $1, 68($sp) # 4-byte Folded Reload
120 ; MIPS32-NEXT: lw $2, 48($sp) # 4-byte Folded Reload
121 ; MIPS32-NEXT: lw $3, 52($sp) # 4-byte Folded Reload
122 ; MIPS32-NEXT: ldc1 $f0, 24($sp) # 8-byte Folded Reload
123 ; MIPS32-NEXT: mov.d $f4, $f0
124 ; MIPS32-NEXT: andi $3, $3, 1
125 ; MIPS32-NEXT: movn.d $f4, $f0, $3
126 ; MIPS32-NEXT: andi $2, $2, 1
127 ; MIPS32-NEXT: mov.d $f2, $f0
128 ; MIPS32-NEXT: movn.d $f2, $f4, $2
129 ; MIPS32-NEXT: sdc1 $f2, 0($1)
130 ; MIPS32-NEXT: sdc1 $f0, 0($1)
131 ; MIPS32-NEXT: addiu $sp, $sp, 72
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 i64, ptr %a
148 %phi1.1 = load i64, ptr %b
152 %phi1.2 = load i64, ptr %c
156 %phi1 = phi i64 [ %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 i64 %phi1, ptr %result
164 br i1 %cnd0, label %b.PHI.2.0, label %b.PHI.2.1
167 %phi2.0 = load i64, ptr %a
171 %phi2.1 = load i64, ptr %b
175 %phi2 = phi i64 [ %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 i64 %phi2, ptr %result
183 %phi3 = phi i64 [ %phi2, %b.PHI.2], [ %phi1, %b.PHI.1 ]
184 %phi4 = phi i64 [ %phi2, %b.PHI.2], [ %phi1, %b.PHI.1 ]
185 %sel_1.2 = select i1 %cnd2, i64 %phi3, i64 %phi4
186 %sel_3_1.2 = select i1 %cnd1, i64 %sel_1.2, i64 %phi3
187 store i64 %sel_3_1.2, ptr %result
188 store i64 %phi3, ptr %result
193 define void @long_chain_i64_in_gpr(i1 %cnd0, i1 %cnd1, i1 %cnd2, ptr %a, ptr %b, ptr %c, ptr %result) {
194 ; MIPS32-LABEL: long_chain_i64_in_gpr:
195 ; MIPS32: # %bb.0: # %entry
196 ; MIPS32-NEXT: addiu $sp, $sp, -80
197 ; MIPS32-NEXT: .cfi_def_cfa_offset 80
198 ; MIPS32-NEXT: sw $4, 48($sp) # 4-byte Folded Spill
199 ; MIPS32-NEXT: sw $5, 52($sp) # 4-byte Folded Spill
200 ; MIPS32-NEXT: sw $6, 56($sp) # 4-byte Folded Spill
201 ; MIPS32-NEXT: sw $7, 60($sp) # 4-byte Folded Spill
202 ; MIPS32-NEXT: addiu $1, $sp, 96
203 ; MIPS32-NEXT: lw $1, 0($1)
204 ; MIPS32-NEXT: sw $1, 64($sp) # 4-byte Folded Spill
205 ; MIPS32-NEXT: addiu $1, $sp, 100
206 ; MIPS32-NEXT: lw $1, 0($1)
207 ; MIPS32-NEXT: sw $1, 68($sp) # 4-byte Folded Spill
208 ; MIPS32-NEXT: addiu $1, $sp, 104
209 ; MIPS32-NEXT: lw $1, 0($1)
210 ; MIPS32-NEXT: sw $1, 72($sp) # 4-byte Folded Spill
211 ; MIPS32-NEXT: ori $1, $zero, 0
212 ; MIPS32-NEXT: sw $1, 76($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, 52($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, 56($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, 60($sp) # 4-byte Folded Reload
237 ; MIPS32-NEXT: lw $2, 0($1)
238 ; MIPS32-NEXT: lw $1, 4($1)
239 ; MIPS32-NEXT: sw $2, 40($sp) # 4-byte Folded Spill
240 ; MIPS32-NEXT: sw $1, 44($sp) # 4-byte Folded Spill
241 ; MIPS32-NEXT: j $BB1_9
243 ; MIPS32-NEXT: $BB1_7: # %b.PHI.1.1
244 ; MIPS32-NEXT: lw $1, 64($sp) # 4-byte Folded Reload
245 ; MIPS32-NEXT: lw $2, 0($1)
246 ; MIPS32-NEXT: lw $1, 4($1)
247 ; MIPS32-NEXT: sw $2, 40($sp) # 4-byte Folded Spill
248 ; MIPS32-NEXT: sw $1, 44($sp) # 4-byte Folded Spill
249 ; MIPS32-NEXT: j $BB1_9
251 ; MIPS32-NEXT: $BB1_8: # %b.PHI.1.2
252 ; MIPS32-NEXT: lw $1, 68($sp) # 4-byte Folded Reload
253 ; MIPS32-NEXT: lw $2, 0($1)
254 ; MIPS32-NEXT: lw $1, 4($1)
255 ; MIPS32-NEXT: sw $2, 40($sp) # 4-byte Folded Spill
256 ; MIPS32-NEXT: sw $1, 44($sp) # 4-byte Folded Spill
257 ; MIPS32-NEXT: j $BB1_9
259 ; MIPS32-NEXT: $BB1_9: # %b.PHI.1
260 ; MIPS32-NEXT: lw $2, 76($sp) # 4-byte Folded Reload
261 ; MIPS32-NEXT: lw $1, 56($sp) # 4-byte Folded Reload
262 ; MIPS32-NEXT: lw $4, 40($sp) # 4-byte Folded Reload
263 ; MIPS32-NEXT: lw $3, 44($sp) # 4-byte Folded Reload
264 ; MIPS32-NEXT: sw $3, 16($sp) # 4-byte Folded Spill
265 ; MIPS32-NEXT: sw $4, 20($sp) # 4-byte Folded Spill
266 ; MIPS32-NEXT: andi $1, $1, 1
267 ; MIPS32-NEXT: sw $4, 24($sp) # 4-byte Folded Spill
268 ; MIPS32-NEXT: sw $3, 28($sp) # 4-byte Folded Spill
269 ; MIPS32-NEXT: move $3, $2
270 ; MIPS32-NEXT: sw $3, 32($sp) # 4-byte Folded Spill
271 ; MIPS32-NEXT: sw $2, 36($sp) # 4-byte Folded Spill
272 ; MIPS32-NEXT: bnez $1, $BB1_11
274 ; MIPS32-NEXT: # %bb.10: # %b.PHI.1
275 ; MIPS32-NEXT: j $BB1_19
277 ; MIPS32-NEXT: $BB1_11: # %b.PHI.1.end
278 ; MIPS32-NEXT: lw $1, 16($sp) # 4-byte Folded Reload
279 ; MIPS32-NEXT: lw $2, 72($sp) # 4-byte Folded Reload
280 ; MIPS32-NEXT: lw $3, 20($sp) # 4-byte Folded Reload
281 ; MIPS32-NEXT: sw $3, 0($2)
282 ; MIPS32-NEXT: sw $1, 4($2)
283 ; MIPS32-NEXT: addiu $sp, $sp, 80
284 ; MIPS32-NEXT: jr $ra
286 ; MIPS32-NEXT: $BB1_12: # %pre.PHI.2
287 ; MIPS32-NEXT: lw $1, 48($sp) # 4-byte Folded Reload
288 ; MIPS32-NEXT: andi $1, $1, 1
289 ; MIPS32-NEXT: bnez $1, $BB1_14
291 ; MIPS32-NEXT: # %bb.13: # %pre.PHI.2
292 ; MIPS32-NEXT: j $BB1_15
294 ; MIPS32-NEXT: $BB1_14: # %b.PHI.2.0
295 ; MIPS32-NEXT: lw $1, 60($sp) # 4-byte Folded Reload
296 ; MIPS32-NEXT: lw $2, 0($1)
297 ; MIPS32-NEXT: lw $1, 4($1)
298 ; MIPS32-NEXT: sw $2, 8($sp) # 4-byte Folded Spill
299 ; MIPS32-NEXT: sw $1, 12($sp) # 4-byte Folded Spill
300 ; MIPS32-NEXT: j $BB1_16
302 ; MIPS32-NEXT: $BB1_15: # %b.PHI.2.1
303 ; MIPS32-NEXT: lw $1, 64($sp) # 4-byte Folded Reload
304 ; MIPS32-NEXT: lw $2, 0($1)
305 ; MIPS32-NEXT: lw $1, 4($1)
306 ; MIPS32-NEXT: sw $2, 8($sp) # 4-byte Folded Spill
307 ; MIPS32-NEXT: sw $1, 12($sp) # 4-byte Folded Spill
308 ; MIPS32-NEXT: j $BB1_16
310 ; MIPS32-NEXT: $BB1_16: # %b.PHI.2
311 ; MIPS32-NEXT: lw $1, 52($sp) # 4-byte Folded Reload
312 ; MIPS32-NEXT: lw $3, 8($sp) # 4-byte Folded Reload
313 ; MIPS32-NEXT: lw $2, 12($sp) # 4-byte Folded Reload
314 ; MIPS32-NEXT: sw $2, 0($sp) # 4-byte Folded Spill
315 ; MIPS32-NEXT: sw $3, 4($sp) # 4-byte Folded Spill
316 ; MIPS32-NEXT: andi $1, $1, 1
317 ; MIPS32-NEXT: move $4, $3
318 ; MIPS32-NEXT: sw $4, 24($sp) # 4-byte Folded Spill
319 ; MIPS32-NEXT: move $4, $2
320 ; MIPS32-NEXT: sw $4, 28($sp) # 4-byte Folded Spill
321 ; MIPS32-NEXT: sw $3, 32($sp) # 4-byte Folded Spill
322 ; MIPS32-NEXT: sw $2, 36($sp) # 4-byte Folded Spill
323 ; MIPS32-NEXT: bnez $1, $BB1_19
325 ; MIPS32-NEXT: # %bb.17: # %b.PHI.2
326 ; MIPS32-NEXT: j $BB1_18
328 ; MIPS32-NEXT: $BB1_18: # %b.PHI.2.end
329 ; MIPS32-NEXT: lw $1, 0($sp) # 4-byte Folded Reload
330 ; MIPS32-NEXT: lw $2, 72($sp) # 4-byte Folded Reload
331 ; MIPS32-NEXT: lw $3, 4($sp) # 4-byte Folded Reload
332 ; MIPS32-NEXT: sw $3, 0($2)
333 ; MIPS32-NEXT: sw $1, 4($2)
334 ; MIPS32-NEXT: addiu $sp, $sp, 80
335 ; MIPS32-NEXT: jr $ra
337 ; MIPS32-NEXT: $BB1_19: # %b.PHI.3
338 ; MIPS32-NEXT: lw $2, 72($sp) # 4-byte Folded Reload
339 ; MIPS32-NEXT: lw $5, 52($sp) # 4-byte Folded Reload
340 ; MIPS32-NEXT: lw $7, 56($sp) # 4-byte Folded Reload
341 ; MIPS32-NEXT: lw $3, 24($sp) # 4-byte Folded Reload
342 ; MIPS32-NEXT: lw $1, 28($sp) # 4-byte Folded Reload
343 ; MIPS32-NEXT: lw $4, 32($sp) # 4-byte Folded Reload
344 ; MIPS32-NEXT: lw $6, 36($sp) # 4-byte Folded Reload
345 ; MIPS32-NEXT: andi $7, $7, 1
346 ; MIPS32-NEXT: movn $4, $3, $7
347 ; MIPS32-NEXT: movn $6, $1, $7
348 ; MIPS32-NEXT: andi $7, $5, 1
349 ; MIPS32-NEXT: move $5, $3
350 ; MIPS32-NEXT: movn $5, $4, $7
351 ; MIPS32-NEXT: move $4, $1
352 ; MIPS32-NEXT: movn $4, $6, $7
353 ; MIPS32-NEXT: sw $5, 0($2)
354 ; MIPS32-NEXT: sw $4, 4($2)
355 ; MIPS32-NEXT: sw $3, 0($2)
356 ; MIPS32-NEXT: sw $1, 4($2)
357 ; MIPS32-NEXT: addiu $sp, $sp, 80
358 ; MIPS32-NEXT: jr $ra
361 br i1 %cnd0, label %pre.PHI.2, label %pre.PHI.1
364 br i1 %cnd1, label %b.PHI.1.1, label %pre.PHI.1.0
367 br i1 %cnd2, label %b.PHI.1.2, label %b.PHI.1.0
370 %phi1.0 = load i64, ptr %a
374 %phi1.1 = load i64, ptr %b
378 %phi1.2 = load i64, ptr %c
382 %phi1 = phi i64 [ %phi1.0, %b.PHI.1.0 ], [ %phi1.1, %b.PHI.1.1 ], [ %phi1.2, %b.PHI.1.2 ]
383 br i1 %cnd2, label %b.PHI.1.end, label %b.PHI.3
386 store i64 %phi1, ptr %result
390 br i1 %cnd0, label %b.PHI.2.0, label %b.PHI.2.1
393 %phi2.0 = load i64, ptr %a
397 %phi2.1 = load i64, ptr %b
401 %phi2 = phi i64 [ %phi2.0, %b.PHI.2.0 ], [ %phi2.1, %b.PHI.2.1 ]
402 br i1 %cnd1, label %b.PHI.3, label %b.PHI.2.end
405 store i64 %phi2, ptr %result
409 %phi3 = phi i64 [ %phi2, %b.PHI.2], [ %phi1, %b.PHI.1 ]
410 %phi4 = phi i64 [ %phi2, %b.PHI.2], [ 0, %b.PHI.1 ]
411 %sel_1.2 = select i1 %cnd2, i64 %phi3, i64 %phi4
412 %sel_3_1.2 = select i1 %cnd1, i64 %sel_1.2, i64 %phi3
413 store i64 %sel_3_1.2, ptr %result
414 store i64 %phi3, ptr %result
418 define void @long_chain_ambiguous_double_in_fpr(i1 %cnd0, i1 %cnd1, i1 %cnd2, ptr %a, ptr %b, ptr %c, ptr %result) {
419 ; MIPS32-LABEL: long_chain_ambiguous_double_in_fpr:
420 ; MIPS32: # %bb.0: # %entry
421 ; MIPS32-NEXT: addiu $sp, $sp, -72
422 ; MIPS32-NEXT: .cfi_def_cfa_offset 72
423 ; MIPS32-NEXT: sw $4, 44($sp) # 4-byte Folded Spill
424 ; MIPS32-NEXT: sw $5, 48($sp) # 4-byte Folded Spill
425 ; MIPS32-NEXT: sw $6, 52($sp) # 4-byte Folded Spill
426 ; MIPS32-NEXT: sw $7, 56($sp) # 4-byte Folded Spill
427 ; MIPS32-NEXT: addiu $1, $sp, 88
428 ; MIPS32-NEXT: lw $1, 0($1)
429 ; MIPS32-NEXT: sw $1, 60($sp) # 4-byte Folded Spill
430 ; MIPS32-NEXT: addiu $1, $sp, 92
431 ; MIPS32-NEXT: lw $1, 0($1)
432 ; MIPS32-NEXT: sw $1, 64($sp) # 4-byte Folded Spill
433 ; MIPS32-NEXT: addiu $1, $sp, 96
434 ; MIPS32-NEXT: lw $1, 0($1)
435 ; MIPS32-NEXT: sw $1, 68($sp) # 4-byte Folded Spill
436 ; MIPS32-NEXT: andi $1, $4, 1
437 ; MIPS32-NEXT: bnez $1, $BB2_12
439 ; MIPS32-NEXT: # %bb.1: # %entry
440 ; MIPS32-NEXT: j $BB2_2
442 ; MIPS32-NEXT: $BB2_2: # %pre.PHI.1
443 ; MIPS32-NEXT: lw $1, 48($sp) # 4-byte Folded Reload
444 ; MIPS32-NEXT: andi $1, $1, 1
445 ; MIPS32-NEXT: bnez $1, $BB2_7
447 ; MIPS32-NEXT: # %bb.3: # %pre.PHI.1
448 ; MIPS32-NEXT: j $BB2_4
450 ; MIPS32-NEXT: $BB2_4: # %pre.PHI.1.0
451 ; MIPS32-NEXT: lw $1, 52($sp) # 4-byte Folded Reload
452 ; MIPS32-NEXT: andi $1, $1, 1
453 ; MIPS32-NEXT: bnez $1, $BB2_8
455 ; MIPS32-NEXT: # %bb.5: # %pre.PHI.1.0
456 ; MIPS32-NEXT: j $BB2_6
458 ; MIPS32-NEXT: $BB2_6: # %b.PHI.1.0
459 ; MIPS32-NEXT: lw $1, 56($sp) # 4-byte Folded Reload
460 ; MIPS32-NEXT: ldc1 $f0, 0($1)
461 ; MIPS32-NEXT: sdc1 $f0, 32($sp) # 8-byte Folded Spill
462 ; MIPS32-NEXT: j $BB2_9
464 ; MIPS32-NEXT: $BB2_7: # %b.PHI.1.1
465 ; MIPS32-NEXT: lw $1, 60($sp) # 4-byte Folded Reload
466 ; MIPS32-NEXT: ldc1 $f0, 0($1)
467 ; MIPS32-NEXT: sdc1 $f0, 32($sp) # 8-byte Folded Spill
468 ; MIPS32-NEXT: j $BB2_9
470 ; MIPS32-NEXT: $BB2_8: # %b.PHI.1.2
471 ; MIPS32-NEXT: lw $1, 64($sp) # 4-byte Folded Reload
472 ; MIPS32-NEXT: ldc1 $f0, 0($1)
473 ; MIPS32-NEXT: sdc1 $f0, 32($sp) # 8-byte Folded Spill
474 ; MIPS32-NEXT: j $BB2_9
476 ; MIPS32-NEXT: $BB2_9: # %b.PHI.1
477 ; MIPS32-NEXT: lw $1, 52($sp) # 4-byte Folded Reload
478 ; MIPS32-NEXT: ldc1 $f0, 32($sp) # 8-byte Folded Reload
479 ; MIPS32-NEXT: sdc1 $f0, 16($sp) # 8-byte Folded Spill
480 ; MIPS32-NEXT: andi $1, $1, 1
481 ; MIPS32-NEXT: sdc1 $f0, 24($sp) # 8-byte Folded Spill
482 ; MIPS32-NEXT: bnez $1, $BB2_11
484 ; MIPS32-NEXT: # %bb.10: # %b.PHI.1
485 ; MIPS32-NEXT: j $BB2_19
487 ; MIPS32-NEXT: $BB2_11: # %b.PHI.1.end
488 ; MIPS32-NEXT: ldc1 $f0, 16($sp) # 8-byte Folded Reload
489 ; MIPS32-NEXT: lw $1, 68($sp) # 4-byte Folded Reload
490 ; MIPS32-NEXT: sdc1 $f0, 0($1)
491 ; MIPS32-NEXT: addiu $sp, $sp, 72
492 ; MIPS32-NEXT: jr $ra
494 ; MIPS32-NEXT: $BB2_12: # %pre.PHI.2
495 ; MIPS32-NEXT: lw $1, 44($sp) # 4-byte Folded Reload
496 ; MIPS32-NEXT: andi $1, $1, 1
497 ; MIPS32-NEXT: bnez $1, $BB2_14
499 ; MIPS32-NEXT: # %bb.13: # %pre.PHI.2
500 ; MIPS32-NEXT: j $BB2_15
502 ; MIPS32-NEXT: $BB2_14: # %b.PHI.2.0
503 ; MIPS32-NEXT: lw $1, 56($sp) # 4-byte Folded Reload
504 ; MIPS32-NEXT: ldc1 $f0, 0($1)
505 ; MIPS32-NEXT: sdc1 $f0, 8($sp) # 8-byte Folded Spill
506 ; MIPS32-NEXT: j $BB2_16
508 ; MIPS32-NEXT: $BB2_15: # %b.PHI.2.1
509 ; MIPS32-NEXT: lw $1, 60($sp) # 4-byte Folded Reload
510 ; MIPS32-NEXT: ldc1 $f0, 0($1)
511 ; MIPS32-NEXT: sdc1 $f0, 8($sp) # 8-byte Folded Spill
512 ; MIPS32-NEXT: j $BB2_16
514 ; MIPS32-NEXT: $BB2_16: # %b.PHI.2
515 ; MIPS32-NEXT: lw $1, 48($sp) # 4-byte Folded Reload
516 ; MIPS32-NEXT: ldc1 $f0, 8($sp) # 8-byte Folded Reload
517 ; MIPS32-NEXT: sdc1 $f0, 0($sp) # 8-byte Folded Spill
518 ; MIPS32-NEXT: andi $1, $1, 1
519 ; MIPS32-NEXT: sdc1 $f0, 24($sp) # 8-byte Folded Spill
520 ; MIPS32-NEXT: bnez $1, $BB2_19
522 ; MIPS32-NEXT: # %bb.17: # %b.PHI.2
523 ; MIPS32-NEXT: j $BB2_18
525 ; MIPS32-NEXT: $BB2_18: # %b.PHI.2.end
526 ; MIPS32-NEXT: ldc1 $f0, 0($sp) # 8-byte Folded Reload
527 ; MIPS32-NEXT: lw $1, 68($sp) # 4-byte Folded Reload
528 ; MIPS32-NEXT: sdc1 $f0, 0($1)
529 ; MIPS32-NEXT: addiu $sp, $sp, 72
530 ; MIPS32-NEXT: jr $ra
532 ; MIPS32-NEXT: $BB2_19: # %b.PHI.3
533 ; MIPS32-NEXT: lw $1, 68($sp) # 4-byte Folded Reload
534 ; MIPS32-NEXT: lw $2, 48($sp) # 4-byte Folded Reload
535 ; MIPS32-NEXT: lw $3, 52($sp) # 4-byte Folded Reload
536 ; MIPS32-NEXT: ldc1 $f0, 24($sp) # 8-byte Folded Reload
537 ; MIPS32-NEXT: mov.d $f4, $f0
538 ; MIPS32-NEXT: andi $3, $3, 1
539 ; MIPS32-NEXT: movn.d $f4, $f0, $3
540 ; MIPS32-NEXT: andi $2, $2, 1
541 ; MIPS32-NEXT: mov.d $f2, $f0
542 ; MIPS32-NEXT: movn.d $f2, $f4, $2
543 ; MIPS32-NEXT: sdc1 $f2, 0($1)
544 ; MIPS32-NEXT: sdc1 $f0, 0($1)
545 ; MIPS32-NEXT: addiu $sp, $sp, 72
546 ; MIPS32-NEXT: jr $ra
549 br i1 %cnd0, label %pre.PHI.2, label %pre.PHI.1
552 br i1 %cnd1, label %b.PHI.1.1, label %pre.PHI.1.0
555 br i1 %cnd2, label %b.PHI.1.2, label %b.PHI.1.0
558 %phi1.0 = load double, ptr %a
562 %phi1.1 = load double, ptr %b
566 %phi1.2 = load double, ptr %c
570 %phi1 = phi double [ %phi1.0, %b.PHI.1.0 ], [ %phi1.1, %b.PHI.1.1 ], [ %phi1.2, %b.PHI.1.2 ]
571 br i1 %cnd2, label %b.PHI.1.end, label %b.PHI.3
574 store double %phi1, ptr %result
578 br i1 %cnd0, label %b.PHI.2.0, label %b.PHI.2.1
581 %phi2.0 = load double, ptr %a
585 %phi2.1 = load double, ptr %b
589 %phi2 = phi double [ %phi2.0, %b.PHI.2.0 ], [ %phi2.1, %b.PHI.2.1 ]
590 br i1 %cnd1, label %b.PHI.3, label %b.PHI.2.end
593 store double %phi2, ptr %result
597 %phi3 = phi double [ %phi2, %b.PHI.2], [ %phi1, %b.PHI.1 ]
598 %phi4 = phi double [ %phi2, %b.PHI.2], [ %phi1, %b.PHI.1 ]
599 %sel_1.2 = select i1 %cnd2, double %phi3, double %phi4
600 %sel_3_1.2 = select i1 %cnd1, double %sel_1.2, double %phi3
601 store double %sel_3_1.2, ptr %result
602 store double %phi3, ptr %result
607 define void @long_chain_double_in_fpr(i1 %cnd0, i1 %cnd1, i1 %cnd2, ptr %a, ptr %b, ptr %c, ptr %result) {
608 ; MIPS32-LABEL: long_chain_double_in_fpr:
609 ; MIPS32: # %bb.0: # %entry
610 ; MIPS32-NEXT: addiu $sp, $sp, -88
611 ; MIPS32-NEXT: .cfi_def_cfa_offset 88
612 ; MIPS32-NEXT: sw $4, 52($sp) # 4-byte Folded Spill
613 ; MIPS32-NEXT: sw $5, 56($sp) # 4-byte Folded Spill
614 ; MIPS32-NEXT: sw $6, 60($sp) # 4-byte Folded Spill
615 ; MIPS32-NEXT: sw $7, 64($sp) # 4-byte Folded Spill
616 ; MIPS32-NEXT: addiu $1, $sp, 104
617 ; MIPS32-NEXT: lw $1, 0($1)
618 ; MIPS32-NEXT: sw $1, 68($sp) # 4-byte Folded Spill
619 ; MIPS32-NEXT: addiu $1, $sp, 108
620 ; MIPS32-NEXT: lw $1, 0($1)
621 ; MIPS32-NEXT: sw $1, 72($sp) # 4-byte Folded Spill
622 ; MIPS32-NEXT: addiu $1, $sp, 112
623 ; MIPS32-NEXT: lw $1, 0($1)
624 ; MIPS32-NEXT: sw $1, 76($sp) # 4-byte Folded Spill
625 ; MIPS32-NEXT: ori $2, $zero, 0
626 ; MIPS32-NEXT: ori $1, $zero, 0
627 ; MIPS32-NEXT: mtc1 $1, $f0
628 ; MIPS32-NEXT: mtc1 $2, $f1
629 ; MIPS32-NEXT: sdc1 $f0, 80($sp) # 8-byte Folded Spill
630 ; MIPS32-NEXT: andi $1, $4, 1
631 ; MIPS32-NEXT: bnez $1, $BB3_12
633 ; MIPS32-NEXT: # %bb.1: # %entry
634 ; MIPS32-NEXT: j $BB3_2
636 ; MIPS32-NEXT: $BB3_2: # %pre.PHI.1
637 ; MIPS32-NEXT: lw $1, 56($sp) # 4-byte Folded Reload
638 ; MIPS32-NEXT: andi $1, $1, 1
639 ; MIPS32-NEXT: bnez $1, $BB3_7
641 ; MIPS32-NEXT: # %bb.3: # %pre.PHI.1
642 ; MIPS32-NEXT: j $BB3_4
644 ; MIPS32-NEXT: $BB3_4: # %pre.PHI.1.0
645 ; MIPS32-NEXT: lw $1, 60($sp) # 4-byte Folded Reload
646 ; MIPS32-NEXT: andi $1, $1, 1
647 ; MIPS32-NEXT: bnez $1, $BB3_8
649 ; MIPS32-NEXT: # %bb.5: # %pre.PHI.1.0
650 ; MIPS32-NEXT: j $BB3_6
652 ; MIPS32-NEXT: $BB3_6: # %b.PHI.1.0
653 ; MIPS32-NEXT: lw $1, 64($sp) # 4-byte Folded Reload
654 ; MIPS32-NEXT: ldc1 $f0, 0($1)
655 ; MIPS32-NEXT: sdc1 $f0, 40($sp) # 8-byte Folded Spill
656 ; MIPS32-NEXT: j $BB3_9
658 ; MIPS32-NEXT: $BB3_7: # %b.PHI.1.1
659 ; MIPS32-NEXT: lw $1, 68($sp) # 4-byte Folded Reload
660 ; MIPS32-NEXT: ldc1 $f0, 0($1)
661 ; MIPS32-NEXT: sdc1 $f0, 40($sp) # 8-byte Folded Spill
662 ; MIPS32-NEXT: j $BB3_9
664 ; MIPS32-NEXT: $BB3_8: # %b.PHI.1.2
665 ; MIPS32-NEXT: lw $1, 72($sp) # 4-byte Folded Reload
666 ; MIPS32-NEXT: ldc1 $f0, 0($1)
667 ; MIPS32-NEXT: sdc1 $f0, 40($sp) # 8-byte Folded Spill
668 ; MIPS32-NEXT: j $BB3_9
670 ; MIPS32-NEXT: $BB3_9: # %b.PHI.1
671 ; MIPS32-NEXT: ldc1 $f0, 80($sp) # 8-byte Folded Reload
672 ; MIPS32-NEXT: lw $1, 60($sp) # 4-byte Folded Reload
673 ; MIPS32-NEXT: ldc1 $f2, 40($sp) # 8-byte Folded Reload
674 ; MIPS32-NEXT: sdc1 $f2, 16($sp) # 8-byte Folded Spill
675 ; MIPS32-NEXT: andi $1, $1, 1
676 ; MIPS32-NEXT: sdc1 $f2, 24($sp) # 8-byte Folded Spill
677 ; MIPS32-NEXT: sdc1 $f0, 32($sp) # 8-byte Folded Spill
678 ; MIPS32-NEXT: bnez $1, $BB3_11
680 ; MIPS32-NEXT: # %bb.10: # %b.PHI.1
681 ; MIPS32-NEXT: j $BB3_19
683 ; MIPS32-NEXT: $BB3_11: # %b.PHI.1.end
684 ; MIPS32-NEXT: ldc1 $f0, 16($sp) # 8-byte Folded Reload
685 ; MIPS32-NEXT: lw $1, 76($sp) # 4-byte Folded Reload
686 ; MIPS32-NEXT: sdc1 $f0, 0($1)
687 ; MIPS32-NEXT: addiu $sp, $sp, 88
688 ; MIPS32-NEXT: jr $ra
690 ; MIPS32-NEXT: $BB3_12: # %pre.PHI.2
691 ; MIPS32-NEXT: lw $1, 52($sp) # 4-byte Folded Reload
692 ; MIPS32-NEXT: andi $1, $1, 1
693 ; MIPS32-NEXT: bnez $1, $BB3_14
695 ; MIPS32-NEXT: # %bb.13: # %pre.PHI.2
696 ; MIPS32-NEXT: j $BB3_15
698 ; MIPS32-NEXT: $BB3_14: # %b.PHI.2.0
699 ; MIPS32-NEXT: lw $1, 64($sp) # 4-byte Folded Reload
700 ; MIPS32-NEXT: ldc1 $f0, 0($1)
701 ; MIPS32-NEXT: sdc1 $f0, 8($sp) # 8-byte Folded Spill
702 ; MIPS32-NEXT: j $BB3_16
704 ; MIPS32-NEXT: $BB3_15: # %b.PHI.2.1
705 ; MIPS32-NEXT: lw $1, 68($sp) # 4-byte Folded Reload
706 ; MIPS32-NEXT: ldc1 $f0, 0($1)
707 ; MIPS32-NEXT: sdc1 $f0, 8($sp) # 8-byte Folded Spill
708 ; MIPS32-NEXT: j $BB3_16
710 ; MIPS32-NEXT: $BB3_16: # %b.PHI.2
711 ; MIPS32-NEXT: lw $1, 56($sp) # 4-byte Folded Reload
712 ; MIPS32-NEXT: ldc1 $f0, 8($sp) # 8-byte Folded Reload
713 ; MIPS32-NEXT: sdc1 $f0, 0($sp) # 8-byte Folded Spill
714 ; MIPS32-NEXT: andi $1, $1, 1
715 ; MIPS32-NEXT: mov.d $f2, $f0
716 ; MIPS32-NEXT: sdc1 $f2, 24($sp) # 8-byte Folded Spill
717 ; MIPS32-NEXT: sdc1 $f0, 32($sp) # 8-byte Folded Spill
718 ; MIPS32-NEXT: bnez $1, $BB3_19
720 ; MIPS32-NEXT: # %bb.17: # %b.PHI.2
721 ; MIPS32-NEXT: j $BB3_18
723 ; MIPS32-NEXT: $BB3_18: # %b.PHI.2.end
724 ; MIPS32-NEXT: ldc1 $f0, 0($sp) # 8-byte Folded Reload
725 ; MIPS32-NEXT: lw $1, 76($sp) # 4-byte Folded Reload
726 ; MIPS32-NEXT: sdc1 $f0, 0($1)
727 ; MIPS32-NEXT: addiu $sp, $sp, 88
728 ; MIPS32-NEXT: jr $ra
730 ; MIPS32-NEXT: $BB3_19: # %b.PHI.3
731 ; MIPS32-NEXT: lw $1, 76($sp) # 4-byte Folded Reload
732 ; MIPS32-NEXT: lw $2, 56($sp) # 4-byte Folded Reload
733 ; MIPS32-NEXT: lw $3, 60($sp) # 4-byte Folded Reload
734 ; MIPS32-NEXT: ldc1 $f0, 24($sp) # 8-byte Folded Reload
735 ; MIPS32-NEXT: ldc1 $f4, 32($sp) # 8-byte Folded Reload
736 ; MIPS32-NEXT: andi $3, $3, 1
737 ; MIPS32-NEXT: movn.d $f4, $f0, $3
738 ; MIPS32-NEXT: andi $2, $2, 1
739 ; MIPS32-NEXT: mov.d $f2, $f0
740 ; MIPS32-NEXT: movn.d $f2, $f4, $2
741 ; MIPS32-NEXT: sdc1 $f2, 0($1)
742 ; MIPS32-NEXT: sdc1 $f0, 0($1)
743 ; MIPS32-NEXT: addiu $sp, $sp, 88
744 ; MIPS32-NEXT: jr $ra
747 br i1 %cnd0, label %pre.PHI.2, label %pre.PHI.1
750 br i1 %cnd1, label %b.PHI.1.1, label %pre.PHI.1.0
753 br i1 %cnd2, label %b.PHI.1.2, label %b.PHI.1.0
756 %phi1.0 = load double, ptr %a
760 %phi1.1 = load double, ptr %b
764 %phi1.2 = load double, ptr %c
768 %phi1 = phi double [ %phi1.0, %b.PHI.1.0 ], [ %phi1.1, %b.PHI.1.1 ], [ %phi1.2, %b.PHI.1.2 ]
769 br i1 %cnd2, label %b.PHI.1.end, label %b.PHI.3
772 store double %phi1, ptr %result
776 br i1 %cnd0, label %b.PHI.2.0, label %b.PHI.2.1
779 %phi2.0 = load double, ptr %a
783 %phi2.1 = load double, ptr %b
787 %phi2 = phi double [ %phi2.0, %b.PHI.2.0 ], [ %phi2.1, %b.PHI.2.1 ]
788 br i1 %cnd1, label %b.PHI.3, label %b.PHI.2.end
791 store double %phi2, ptr %result
795 %phi3 = phi double [ %phi2, %b.PHI.2], [ %phi1, %b.PHI.1 ]
796 %phi4 = phi double [ %phi2, %b.PHI.2], [ 0.0, %b.PHI.1 ]
797 %sel_1.2 = select i1 %cnd2, double %phi3, double %phi4
798 %sel_3_1.2 = select i1 %cnd1, double %sel_1.2, double %phi3
799 store double %sel_3_1.2, ptr %result
800 store double %phi3, ptr %result