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, i64* %a, i64* %b, i64* %c, i64* %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: addiu $1, $sp, 88
10 ; MIPS32-NEXT: lw $1, 0($1)
11 ; MIPS32-NEXT: addiu $2, $sp, 92
12 ; MIPS32-NEXT: lw $2, 0($2)
13 ; MIPS32-NEXT: addiu $3, $sp, 96
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, 68($sp) # 4-byte Folded Spill
18 ; MIPS32-NEXT: sw $4, 64($sp) # 4-byte Folded Spill
19 ; MIPS32-NEXT: sw $5, 60($sp) # 4-byte Folded Spill
20 ; MIPS32-NEXT: sw $6, 56($sp) # 4-byte Folded Spill
21 ; MIPS32-NEXT: sw $7, 52($sp) # 4-byte Folded Spill
22 ; MIPS32-NEXT: sw $2, 48($sp) # 4-byte Folded Spill
23 ; MIPS32-NEXT: sw $3, 44($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, 60($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, 56($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, 52($sp) # 4-byte Folded Reload
40 ; MIPS32-NEXT: ldc1 $f0, 0($1)
41 ; MIPS32-NEXT: sdc1 $f0, 32($sp) # 8-byte Folded Spill
42 ; MIPS32-NEXT: j $BB0_6
44 ; MIPS32-NEXT: $BB0_4: # %b.PHI.1.1
45 ; MIPS32-NEXT: lw $1, 68($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_6
50 ; MIPS32-NEXT: $BB0_5: # %b.PHI.1.2
51 ; MIPS32-NEXT: lw $1, 48($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: $BB0_6: # %b.PHI.1
55 ; MIPS32-NEXT: ldc1 $f0, 32($sp) # 8-byte Folded Reload
56 ; MIPS32-NEXT: ori $1, $zero, 1
57 ; MIPS32-NEXT: lw $2, 56($sp) # 4-byte Folded Reload
58 ; MIPS32-NEXT: and $1, $2, $1
59 ; MIPS32-NEXT: mov.d $f2, $f0
60 ; MIPS32-NEXT: sdc1 $f0, 24($sp) # 8-byte Folded Spill
61 ; MIPS32-NEXT: sdc1 $f2, 16($sp) # 8-byte Folded Spill
62 ; MIPS32-NEXT: bnez $1, $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: ldc1 $f0, 24($sp) # 8-byte Folded Reload
69 ; MIPS32-NEXT: lw $1, 44($sp) # 4-byte Folded Reload
70 ; MIPS32-NEXT: sdc1 $f0, 0($1)
71 ; MIPS32-NEXT: addiu $sp, $sp, 72
74 ; MIPS32-NEXT: $BB0_9: # %pre.PHI.2
75 ; MIPS32-NEXT: ori $1, $zero, 1
76 ; MIPS32-NEXT: lw $2, 64($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, 52($sp) # 4-byte Folded Reload
85 ; MIPS32-NEXT: ldc1 $f0, 0($1)
86 ; MIPS32-NEXT: sdc1 $f0, 8($sp) # 8-byte Folded Spill
87 ; MIPS32-NEXT: j $BB0_13
89 ; MIPS32-NEXT: $BB0_12: # %b.PHI.2.1
90 ; MIPS32-NEXT: lw $1, 68($sp) # 4-byte Folded Reload
91 ; MIPS32-NEXT: ldc1 $f0, 0($1)
92 ; MIPS32-NEXT: sdc1 $f0, 8($sp) # 8-byte Folded Spill
93 ; MIPS32-NEXT: $BB0_13: # %b.PHI.2
94 ; MIPS32-NEXT: ldc1 $f0, 8($sp) # 8-byte Folded Reload
95 ; MIPS32-NEXT: ori $1, $zero, 1
96 ; MIPS32-NEXT: lw $2, 60($sp) # 4-byte Folded Reload
97 ; MIPS32-NEXT: and $1, $2, $1
98 ; MIPS32-NEXT: mov.d $f2, $f0
99 ; MIPS32-NEXT: sdc1 $f0, 0($sp) # 8-byte Folded Spill
100 ; MIPS32-NEXT: sdc1 $f2, 16($sp) # 8-byte Folded Spill
101 ; MIPS32-NEXT: bnez $1, $BB0_15
103 ; MIPS32-NEXT: # %bb.14: # %b.PHI.2.end
104 ; MIPS32-NEXT: ldc1 $f0, 0($sp) # 8-byte Folded Reload
105 ; MIPS32-NEXT: lw $1, 44($sp) # 4-byte Folded Reload
106 ; MIPS32-NEXT: sdc1 $f0, 0($1)
107 ; MIPS32-NEXT: addiu $sp, $sp, 72
108 ; MIPS32-NEXT: jr $ra
110 ; MIPS32-NEXT: $BB0_15: # %b.PHI.3
111 ; MIPS32-NEXT: ldc1 $f0, 16($sp) # 8-byte Folded Reload
112 ; MIPS32-NEXT: ldc1 $f2, 16($sp) # 8-byte Folded Reload
113 ; MIPS32-NEXT: ori $1, $zero, 1
114 ; MIPS32-NEXT: lw $2, 56($sp) # 4-byte Folded Reload
115 ; MIPS32-NEXT: and $3, $2, $1
116 ; MIPS32-NEXT: movn.d $f0, $f2, $3
117 ; MIPS32-NEXT: lw $3, 60($sp) # 4-byte Folded Reload
118 ; MIPS32-NEXT: and $1, $3, $1
119 ; MIPS32-NEXT: mov.d $f4, $f2
120 ; MIPS32-NEXT: movn.d $f4, $f0, $1
121 ; MIPS32-NEXT: lw $1, 44($sp) # 4-byte Folded Reload
122 ; MIPS32-NEXT: sdc1 $f4, 0($1)
123 ; MIPS32-NEXT: sdc1 $f2, 0($1)
124 ; MIPS32-NEXT: addiu $sp, $sp, 72
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 i64, i64* %a
141 %phi1.1 = load i64, i64* %b
145 %phi1.2 = load i64, i64* %c
149 %phi1 = phi i64 [ %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 i64 %phi1, i64* %result
157 br i1 %cnd0, label %b.PHI.2.0, label %b.PHI.2.1
160 %phi2.0 = load i64, i64* %a
164 %phi2.1 = load i64, i64* %b
168 %phi2 = phi i64 [ %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 i64 %phi2, i64* %result
176 %phi3 = phi i64 [ %phi2, %b.PHI.2], [ %phi1, %b.PHI.1 ]
177 %phi4 = phi i64 [ %phi2, %b.PHI.2], [ %phi1, %b.PHI.1 ]
178 %sel_1.2 = select i1 %cnd2, i64 %phi3, i64 %phi4
179 %sel_3_1.2 = select i1 %cnd1, i64 %sel_1.2, i64 %phi3
180 store i64 %sel_3_1.2, i64* %result
181 store i64 %phi3, i64* %result
186 define void @long_chain_i64_in_gpr(i1 %cnd0, i1 %cnd1, i1 %cnd2, i64* %a, i64* %b, i64* %c, i64* %result) {
187 ; MIPS32-LABEL: long_chain_i64_in_gpr:
188 ; MIPS32: # %bb.0: # %entry
189 ; MIPS32-NEXT: addiu $sp, $sp, -80
190 ; MIPS32-NEXT: .cfi_def_cfa_offset 80
191 ; MIPS32-NEXT: addiu $1, $sp, 96
192 ; MIPS32-NEXT: lw $1, 0($1)
193 ; MIPS32-NEXT: addiu $2, $sp, 100
194 ; MIPS32-NEXT: lw $2, 0($2)
195 ; MIPS32-NEXT: addiu $3, $sp, 104
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, 76($sp) # 4-byte Folded Spill
201 ; MIPS32-NEXT: sw $4, 72($sp) # 4-byte Folded Spill
202 ; MIPS32-NEXT: sw $5, 68($sp) # 4-byte Folded Spill
203 ; MIPS32-NEXT: sw $6, 64($sp) # 4-byte Folded Spill
204 ; MIPS32-NEXT: sw $7, 60($sp) # 4-byte Folded Spill
205 ; MIPS32-NEXT: sw $2, 56($sp) # 4-byte Folded Spill
206 ; MIPS32-NEXT: sw $3, 52($sp) # 4-byte Folded Spill
207 ; MIPS32-NEXT: sw $8, 48($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, 68($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, 64($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, 60($sp) # 4-byte Folded Reload
224 ; MIPS32-NEXT: lw $2, 0($1)
225 ; MIPS32-NEXT: lw $3, 4($1)
226 ; MIPS32-NEXT: sw $2, 44($sp) # 4-byte Folded Spill
227 ; MIPS32-NEXT: sw $3, 40($sp) # 4-byte Folded Spill
228 ; MIPS32-NEXT: j $BB1_6
230 ; MIPS32-NEXT: $BB1_4: # %b.PHI.1.1
231 ; MIPS32-NEXT: lw $1, 76($sp) # 4-byte Folded Reload
232 ; MIPS32-NEXT: lw $2, 0($1)
233 ; MIPS32-NEXT: lw $3, 4($1)
234 ; MIPS32-NEXT: sw $2, 44($sp) # 4-byte Folded Spill
235 ; MIPS32-NEXT: sw $3, 40($sp) # 4-byte Folded Spill
236 ; MIPS32-NEXT: j $BB1_6
238 ; MIPS32-NEXT: $BB1_5: # %b.PHI.1.2
239 ; MIPS32-NEXT: lw $1, 56($sp) # 4-byte Folded Reload
240 ; MIPS32-NEXT: lw $2, 0($1)
241 ; MIPS32-NEXT: lw $3, 4($1)
242 ; MIPS32-NEXT: sw $2, 44($sp) # 4-byte Folded Spill
243 ; MIPS32-NEXT: sw $3, 40($sp) # 4-byte Folded Spill
244 ; MIPS32-NEXT: $BB1_6: # %b.PHI.1
245 ; MIPS32-NEXT: lw $1, 40($sp) # 4-byte Folded Reload
246 ; MIPS32-NEXT: lw $2, 44($sp) # 4-byte Folded Reload
247 ; MIPS32-NEXT: ori $3, $zero, 1
248 ; MIPS32-NEXT: lw $4, 64($sp) # 4-byte Folded Reload
249 ; MIPS32-NEXT: and $3, $4, $3
250 ; MIPS32-NEXT: move $5, $2
251 ; MIPS32-NEXT: move $6, $1
252 ; MIPS32-NEXT: lw $7, 48($sp) # 4-byte Folded Reload
253 ; MIPS32-NEXT: lw $8, 48($sp) # 4-byte Folded Reload
254 ; MIPS32-NEXT: sw $1, 36($sp) # 4-byte Folded Spill
255 ; MIPS32-NEXT: sw $2, 32($sp) # 4-byte Folded Spill
256 ; MIPS32-NEXT: sw $5, 28($sp) # 4-byte Folded Spill
257 ; MIPS32-NEXT: sw $6, 24($sp) # 4-byte Folded Spill
258 ; MIPS32-NEXT: sw $7, 20($sp) # 4-byte Folded Spill
259 ; MIPS32-NEXT: sw $8, 16($sp) # 4-byte Folded Spill
260 ; MIPS32-NEXT: bnez $3, $BB1_8
262 ; MIPS32-NEXT: # %bb.7: # %b.PHI.1
263 ; MIPS32-NEXT: j $BB1_15
265 ; MIPS32-NEXT: $BB1_8: # %b.PHI.1.end
266 ; MIPS32-NEXT: lw $1, 32($sp) # 4-byte Folded Reload
267 ; MIPS32-NEXT: lw $2, 52($sp) # 4-byte Folded Reload
268 ; MIPS32-NEXT: sw $1, 0($2)
269 ; MIPS32-NEXT: lw $3, 36($sp) # 4-byte Folded Reload
270 ; MIPS32-NEXT: sw $3, 4($2)
271 ; MIPS32-NEXT: addiu $sp, $sp, 80
272 ; MIPS32-NEXT: jr $ra
274 ; MIPS32-NEXT: $BB1_9: # %pre.PHI.2
275 ; MIPS32-NEXT: ori $1, $zero, 1
276 ; MIPS32-NEXT: lw $2, 72($sp) # 4-byte Folded Reload
277 ; MIPS32-NEXT: and $1, $2, $1
278 ; MIPS32-NEXT: bnez $1, $BB1_11
280 ; MIPS32-NEXT: # %bb.10: # %pre.PHI.2
281 ; MIPS32-NEXT: j $BB1_12
283 ; MIPS32-NEXT: $BB1_11: # %b.PHI.2.0
284 ; MIPS32-NEXT: lw $1, 60($sp) # 4-byte Folded Reload
285 ; MIPS32-NEXT: lw $2, 0($1)
286 ; MIPS32-NEXT: lw $3, 4($1)
287 ; MIPS32-NEXT: sw $2, 12($sp) # 4-byte Folded Spill
288 ; MIPS32-NEXT: sw $3, 8($sp) # 4-byte Folded Spill
289 ; MIPS32-NEXT: j $BB1_13
291 ; MIPS32-NEXT: $BB1_12: # %b.PHI.2.1
292 ; MIPS32-NEXT: lw $1, 76($sp) # 4-byte Folded Reload
293 ; MIPS32-NEXT: lw $2, 0($1)
294 ; MIPS32-NEXT: lw $3, 4($1)
295 ; MIPS32-NEXT: sw $2, 12($sp) # 4-byte Folded Spill
296 ; MIPS32-NEXT: sw $3, 8($sp) # 4-byte Folded Spill
297 ; MIPS32-NEXT: $BB1_13: # %b.PHI.2
298 ; MIPS32-NEXT: lw $1, 8($sp) # 4-byte Folded Reload
299 ; MIPS32-NEXT: lw $2, 12($sp) # 4-byte Folded Reload
300 ; MIPS32-NEXT: ori $3, $zero, 1
301 ; MIPS32-NEXT: lw $4, 68($sp) # 4-byte Folded Reload
302 ; MIPS32-NEXT: and $3, $4, $3
303 ; MIPS32-NEXT: move $5, $2
304 ; MIPS32-NEXT: move $6, $1
305 ; MIPS32-NEXT: move $7, $2
306 ; MIPS32-NEXT: move $8, $1
307 ; MIPS32-NEXT: sw $1, 4($sp) # 4-byte Folded Spill
308 ; MIPS32-NEXT: sw $2, 0($sp) # 4-byte Folded Spill
309 ; MIPS32-NEXT: sw $5, 28($sp) # 4-byte Folded Spill
310 ; MIPS32-NEXT: sw $6, 24($sp) # 4-byte Folded Spill
311 ; MIPS32-NEXT: sw $7, 20($sp) # 4-byte Folded Spill
312 ; MIPS32-NEXT: sw $8, 16($sp) # 4-byte Folded Spill
313 ; MIPS32-NEXT: bnez $3, $BB1_15
315 ; MIPS32-NEXT: # %bb.14: # %b.PHI.2.end
316 ; MIPS32-NEXT: lw $1, 0($sp) # 4-byte Folded Reload
317 ; MIPS32-NEXT: lw $2, 52($sp) # 4-byte Folded Reload
318 ; MIPS32-NEXT: sw $1, 0($2)
319 ; MIPS32-NEXT: lw $3, 4($sp) # 4-byte Folded Reload
320 ; MIPS32-NEXT: sw $3, 4($2)
321 ; MIPS32-NEXT: addiu $sp, $sp, 80
322 ; MIPS32-NEXT: jr $ra
324 ; MIPS32-NEXT: $BB1_15: # %b.PHI.3
325 ; MIPS32-NEXT: lw $1, 16($sp) # 4-byte Folded Reload
326 ; MIPS32-NEXT: lw $2, 20($sp) # 4-byte Folded Reload
327 ; MIPS32-NEXT: lw $3, 24($sp) # 4-byte Folded Reload
328 ; MIPS32-NEXT: lw $4, 28($sp) # 4-byte Folded Reload
329 ; MIPS32-NEXT: ori $5, $zero, 1
330 ; MIPS32-NEXT: lw $6, 64($sp) # 4-byte Folded Reload
331 ; MIPS32-NEXT: and $7, $6, $5
332 ; MIPS32-NEXT: movn $2, $4, $7
333 ; MIPS32-NEXT: movn $1, $3, $7
334 ; MIPS32-NEXT: lw $7, 68($sp) # 4-byte Folded Reload
335 ; MIPS32-NEXT: and $5, $7, $5
336 ; MIPS32-NEXT: move $8, $4
337 ; MIPS32-NEXT: movn $8, $2, $5
338 ; MIPS32-NEXT: move $2, $3
339 ; MIPS32-NEXT: movn $2, $1, $5
340 ; MIPS32-NEXT: lw $1, 52($sp) # 4-byte Folded Reload
341 ; MIPS32-NEXT: sw $8, 0($1)
342 ; MIPS32-NEXT: sw $2, 4($1)
343 ; MIPS32-NEXT: sw $4, 0($1)
344 ; MIPS32-NEXT: sw $3, 4($1)
345 ; MIPS32-NEXT: addiu $sp, $sp, 80
346 ; MIPS32-NEXT: jr $ra
349 br i1 %cnd0, label %pre.PHI.2, label %pre.PHI.1
352 br i1 %cnd1, label %b.PHI.1.1, label %pre.PHI.1.0
355 br i1 %cnd2, label %b.PHI.1.2, label %b.PHI.1.0
358 %phi1.0 = load i64, i64* %a
362 %phi1.1 = load i64, i64* %b
366 %phi1.2 = load i64, i64* %c
370 %phi1 = phi i64 [ %phi1.0, %b.PHI.1.0 ], [ %phi1.1, %b.PHI.1.1 ], [ %phi1.2, %b.PHI.1.2 ]
371 br i1 %cnd2, label %b.PHI.1.end, label %b.PHI.3
374 store i64 %phi1, i64* %result
378 br i1 %cnd0, label %b.PHI.2.0, label %b.PHI.2.1
381 %phi2.0 = load i64, i64* %a
385 %phi2.1 = load i64, i64* %b
389 %phi2 = phi i64 [ %phi2.0, %b.PHI.2.0 ], [ %phi2.1, %b.PHI.2.1 ]
390 br i1 %cnd1, label %b.PHI.3, label %b.PHI.2.end
393 store i64 %phi2, i64* %result
397 %phi3 = phi i64 [ %phi2, %b.PHI.2], [ %phi1, %b.PHI.1 ]
398 %phi4 = phi i64 [ %phi2, %b.PHI.2], [ 0, %b.PHI.1 ]
399 %sel_1.2 = select i1 %cnd2, i64 %phi3, i64 %phi4
400 %sel_3_1.2 = select i1 %cnd1, i64 %sel_1.2, i64 %phi3
401 store i64 %sel_3_1.2, i64* %result
402 store i64 %phi3, i64* %result
406 define void @long_chain_ambiguous_double_in_fpr(i1 %cnd0, i1 %cnd1, i1 %cnd2, double* %a, double* %b, double* %c, double* %result) {
407 ; MIPS32-LABEL: long_chain_ambiguous_double_in_fpr:
408 ; MIPS32: # %bb.0: # %entry
409 ; MIPS32-NEXT: addiu $sp, $sp, -72
410 ; MIPS32-NEXT: .cfi_def_cfa_offset 72
411 ; MIPS32-NEXT: addiu $1, $sp, 88
412 ; MIPS32-NEXT: lw $1, 0($1)
413 ; MIPS32-NEXT: addiu $2, $sp, 92
414 ; MIPS32-NEXT: lw $2, 0($2)
415 ; MIPS32-NEXT: addiu $3, $sp, 96
416 ; MIPS32-NEXT: lw $3, 0($3)
417 ; MIPS32-NEXT: ori $8, $zero, 1
418 ; MIPS32-NEXT: and $8, $4, $8
419 ; MIPS32-NEXT: sw $1, 68($sp) # 4-byte Folded Spill
420 ; MIPS32-NEXT: sw $4, 64($sp) # 4-byte Folded Spill
421 ; MIPS32-NEXT: sw $5, 60($sp) # 4-byte Folded Spill
422 ; MIPS32-NEXT: sw $6, 56($sp) # 4-byte Folded Spill
423 ; MIPS32-NEXT: sw $7, 52($sp) # 4-byte Folded Spill
424 ; MIPS32-NEXT: sw $2, 48($sp) # 4-byte Folded Spill
425 ; MIPS32-NEXT: sw $3, 44($sp) # 4-byte Folded Spill
426 ; MIPS32-NEXT: bnez $8, $BB2_9
428 ; MIPS32-NEXT: # %bb.1: # %pre.PHI.1
429 ; MIPS32-NEXT: ori $1, $zero, 1
430 ; MIPS32-NEXT: lw $2, 60($sp) # 4-byte Folded Reload
431 ; MIPS32-NEXT: and $1, $2, $1
432 ; MIPS32-NEXT: bnez $1, $BB2_4
434 ; MIPS32-NEXT: # %bb.2: # %pre.PHI.1.0
435 ; MIPS32-NEXT: ori $1, $zero, 1
436 ; MIPS32-NEXT: lw $2, 56($sp) # 4-byte Folded Reload
437 ; MIPS32-NEXT: and $1, $2, $1
438 ; MIPS32-NEXT: bnez $1, $BB2_5
440 ; MIPS32-NEXT: # %bb.3: # %b.PHI.1.0
441 ; MIPS32-NEXT: lw $1, 52($sp) # 4-byte Folded Reload
442 ; MIPS32-NEXT: ldc1 $f0, 0($1)
443 ; MIPS32-NEXT: sdc1 $f0, 32($sp) # 8-byte Folded Spill
444 ; MIPS32-NEXT: j $BB2_6
446 ; MIPS32-NEXT: $BB2_4: # %b.PHI.1.1
447 ; MIPS32-NEXT: lw $1, 68($sp) # 4-byte Folded Reload
448 ; MIPS32-NEXT: ldc1 $f0, 0($1)
449 ; MIPS32-NEXT: sdc1 $f0, 32($sp) # 8-byte Folded Spill
450 ; MIPS32-NEXT: j $BB2_6
452 ; MIPS32-NEXT: $BB2_5: # %b.PHI.1.2
453 ; MIPS32-NEXT: lw $1, 48($sp) # 4-byte Folded Reload
454 ; MIPS32-NEXT: ldc1 $f0, 0($1)
455 ; MIPS32-NEXT: sdc1 $f0, 32($sp) # 8-byte Folded Spill
456 ; MIPS32-NEXT: $BB2_6: # %b.PHI.1
457 ; MIPS32-NEXT: ldc1 $f0, 32($sp) # 8-byte Folded Reload
458 ; MIPS32-NEXT: ori $1, $zero, 1
459 ; MIPS32-NEXT: lw $2, 56($sp) # 4-byte Folded Reload
460 ; MIPS32-NEXT: and $1, $2, $1
461 ; MIPS32-NEXT: mov.d $f2, $f0
462 ; MIPS32-NEXT: sdc1 $f0, 24($sp) # 8-byte Folded Spill
463 ; MIPS32-NEXT: sdc1 $f2, 16($sp) # 8-byte Folded Spill
464 ; MIPS32-NEXT: bnez $1, $BB2_8
466 ; MIPS32-NEXT: # %bb.7: # %b.PHI.1
467 ; MIPS32-NEXT: j $BB2_15
469 ; MIPS32-NEXT: $BB2_8: # %b.PHI.1.end
470 ; MIPS32-NEXT: ldc1 $f0, 24($sp) # 8-byte Folded Reload
471 ; MIPS32-NEXT: lw $1, 44($sp) # 4-byte Folded Reload
472 ; MIPS32-NEXT: sdc1 $f0, 0($1)
473 ; MIPS32-NEXT: addiu $sp, $sp, 72
474 ; MIPS32-NEXT: jr $ra
476 ; MIPS32-NEXT: $BB2_9: # %pre.PHI.2
477 ; MIPS32-NEXT: ori $1, $zero, 1
478 ; MIPS32-NEXT: lw $2, 64($sp) # 4-byte Folded Reload
479 ; MIPS32-NEXT: and $1, $2, $1
480 ; MIPS32-NEXT: bnez $1, $BB2_11
482 ; MIPS32-NEXT: # %bb.10: # %pre.PHI.2
483 ; MIPS32-NEXT: j $BB2_12
485 ; MIPS32-NEXT: $BB2_11: # %b.PHI.2.0
486 ; MIPS32-NEXT: lw $1, 52($sp) # 4-byte Folded Reload
487 ; MIPS32-NEXT: ldc1 $f0, 0($1)
488 ; MIPS32-NEXT: sdc1 $f0, 8($sp) # 8-byte Folded Spill
489 ; MIPS32-NEXT: j $BB2_13
491 ; MIPS32-NEXT: $BB2_12: # %b.PHI.2.1
492 ; MIPS32-NEXT: lw $1, 68($sp) # 4-byte Folded Reload
493 ; MIPS32-NEXT: ldc1 $f0, 0($1)
494 ; MIPS32-NEXT: sdc1 $f0, 8($sp) # 8-byte Folded Spill
495 ; MIPS32-NEXT: $BB2_13: # %b.PHI.2
496 ; MIPS32-NEXT: ldc1 $f0, 8($sp) # 8-byte Folded Reload
497 ; MIPS32-NEXT: ori $1, $zero, 1
498 ; MIPS32-NEXT: lw $2, 60($sp) # 4-byte Folded Reload
499 ; MIPS32-NEXT: and $1, $2, $1
500 ; MIPS32-NEXT: mov.d $f2, $f0
501 ; MIPS32-NEXT: sdc1 $f0, 0($sp) # 8-byte Folded Spill
502 ; MIPS32-NEXT: sdc1 $f2, 16($sp) # 8-byte Folded Spill
503 ; MIPS32-NEXT: bnez $1, $BB2_15
505 ; MIPS32-NEXT: # %bb.14: # %b.PHI.2.end
506 ; MIPS32-NEXT: ldc1 $f0, 0($sp) # 8-byte Folded Reload
507 ; MIPS32-NEXT: lw $1, 44($sp) # 4-byte Folded Reload
508 ; MIPS32-NEXT: sdc1 $f0, 0($1)
509 ; MIPS32-NEXT: addiu $sp, $sp, 72
510 ; MIPS32-NEXT: jr $ra
512 ; MIPS32-NEXT: $BB2_15: # %b.PHI.3
513 ; MIPS32-NEXT: ldc1 $f0, 16($sp) # 8-byte Folded Reload
514 ; MIPS32-NEXT: ldc1 $f2, 16($sp) # 8-byte Folded Reload
515 ; MIPS32-NEXT: ori $1, $zero, 1
516 ; MIPS32-NEXT: lw $2, 56($sp) # 4-byte Folded Reload
517 ; MIPS32-NEXT: and $3, $2, $1
518 ; MIPS32-NEXT: movn.d $f0, $f2, $3
519 ; MIPS32-NEXT: lw $3, 60($sp) # 4-byte Folded Reload
520 ; MIPS32-NEXT: and $1, $3, $1
521 ; MIPS32-NEXT: mov.d $f4, $f2
522 ; MIPS32-NEXT: movn.d $f4, $f0, $1
523 ; MIPS32-NEXT: lw $1, 44($sp) # 4-byte Folded Reload
524 ; MIPS32-NEXT: sdc1 $f4, 0($1)
525 ; MIPS32-NEXT: sdc1 $f2, 0($1)
526 ; MIPS32-NEXT: addiu $sp, $sp, 72
527 ; MIPS32-NEXT: jr $ra
530 br i1 %cnd0, label %pre.PHI.2, label %pre.PHI.1
533 br i1 %cnd1, label %b.PHI.1.1, label %pre.PHI.1.0
536 br i1 %cnd2, label %b.PHI.1.2, label %b.PHI.1.0
539 %phi1.0 = load double, double* %a
543 %phi1.1 = load double, double* %b
547 %phi1.2 = load double, double* %c
551 %phi1 = phi double [ %phi1.0, %b.PHI.1.0 ], [ %phi1.1, %b.PHI.1.1 ], [ %phi1.2, %b.PHI.1.2 ]
552 br i1 %cnd2, label %b.PHI.1.end, label %b.PHI.3
555 store double %phi1, double* %result
559 br i1 %cnd0, label %b.PHI.2.0, label %b.PHI.2.1
562 %phi2.0 = load double, double* %a
566 %phi2.1 = load double, double* %b
570 %phi2 = phi double [ %phi2.0, %b.PHI.2.0 ], [ %phi2.1, %b.PHI.2.1 ]
571 br i1 %cnd1, label %b.PHI.3, label %b.PHI.2.end
574 store double %phi2, double* %result
578 %phi3 = phi double [ %phi2, %b.PHI.2], [ %phi1, %b.PHI.1 ]
579 %phi4 = phi double [ %phi2, %b.PHI.2], [ %phi1, %b.PHI.1 ]
580 %sel_1.2 = select i1 %cnd2, double %phi3, double %phi4
581 %sel_3_1.2 = select i1 %cnd1, double %sel_1.2, double %phi3
582 store double %sel_3_1.2, double* %result
583 store double %phi3, double* %result
588 define void @long_chain_double_in_fpr(i1 %cnd0, i1 %cnd1, i1 %cnd2, double* %a, double* %b, double* %c, double* %result) {
589 ; MIPS32-LABEL: long_chain_double_in_fpr:
590 ; MIPS32: # %bb.0: # %entry
591 ; MIPS32-NEXT: addiu $sp, $sp, -88
592 ; MIPS32-NEXT: .cfi_def_cfa_offset 88
593 ; MIPS32-NEXT: addiu $1, $sp, 104
594 ; MIPS32-NEXT: lw $1, 0($1)
595 ; MIPS32-NEXT: addiu $2, $sp, 108
596 ; MIPS32-NEXT: lw $2, 0($2)
597 ; MIPS32-NEXT: addiu $3, $sp, 112
598 ; MIPS32-NEXT: lw $3, 0($3)
599 ; MIPS32-NEXT: ori $8, $zero, 0
600 ; MIPS32-NEXT: ori $9, $zero, 0
601 ; MIPS32-NEXT: mtc1 $9, $f0
602 ; MIPS32-NEXT: mtc1 $8, $f1
603 ; MIPS32-NEXT: ori $8, $zero, 1
604 ; MIPS32-NEXT: and $8, $4, $8
605 ; MIPS32-NEXT: sw $1, 84($sp) # 4-byte Folded Spill
606 ; MIPS32-NEXT: sw $4, 80($sp) # 4-byte Folded Spill
607 ; MIPS32-NEXT: sw $5, 76($sp) # 4-byte Folded Spill
608 ; MIPS32-NEXT: sw $6, 72($sp) # 4-byte Folded Spill
609 ; MIPS32-NEXT: sw $7, 68($sp) # 4-byte Folded Spill
610 ; MIPS32-NEXT: sw $2, 64($sp) # 4-byte Folded Spill
611 ; MIPS32-NEXT: sw $3, 60($sp) # 4-byte Folded Spill
612 ; MIPS32-NEXT: sdc1 $f0, 48($sp) # 8-byte Folded Spill
613 ; MIPS32-NEXT: bnez $8, $BB3_9
615 ; MIPS32-NEXT: # %bb.1: # %pre.PHI.1
616 ; MIPS32-NEXT: ori $1, $zero, 1
617 ; MIPS32-NEXT: lw $2, 76($sp) # 4-byte Folded Reload
618 ; MIPS32-NEXT: and $1, $2, $1
619 ; MIPS32-NEXT: bnez $1, $BB3_4
621 ; MIPS32-NEXT: # %bb.2: # %pre.PHI.1.0
622 ; MIPS32-NEXT: ori $1, $zero, 1
623 ; MIPS32-NEXT: lw $2, 72($sp) # 4-byte Folded Reload
624 ; MIPS32-NEXT: and $1, $2, $1
625 ; MIPS32-NEXT: bnez $1, $BB3_5
627 ; MIPS32-NEXT: # %bb.3: # %b.PHI.1.0
628 ; MIPS32-NEXT: lw $1, 68($sp) # 4-byte Folded Reload
629 ; MIPS32-NEXT: ldc1 $f0, 0($1)
630 ; MIPS32-NEXT: sdc1 $f0, 40($sp) # 8-byte Folded Spill
631 ; MIPS32-NEXT: j $BB3_6
633 ; MIPS32-NEXT: $BB3_4: # %b.PHI.1.1
634 ; MIPS32-NEXT: lw $1, 84($sp) # 4-byte Folded Reload
635 ; MIPS32-NEXT: ldc1 $f0, 0($1)
636 ; MIPS32-NEXT: sdc1 $f0, 40($sp) # 8-byte Folded Spill
637 ; MIPS32-NEXT: j $BB3_6
639 ; MIPS32-NEXT: $BB3_5: # %b.PHI.1.2
640 ; MIPS32-NEXT: lw $1, 64($sp) # 4-byte Folded Reload
641 ; MIPS32-NEXT: ldc1 $f0, 0($1)
642 ; MIPS32-NEXT: sdc1 $f0, 40($sp) # 8-byte Folded Spill
643 ; MIPS32-NEXT: $BB3_6: # %b.PHI.1
644 ; MIPS32-NEXT: ldc1 $f0, 40($sp) # 8-byte Folded Reload
645 ; MIPS32-NEXT: ori $1, $zero, 1
646 ; MIPS32-NEXT: lw $2, 72($sp) # 4-byte Folded Reload
647 ; MIPS32-NEXT: and $1, $2, $1
648 ; MIPS32-NEXT: mov.d $f2, $f0
649 ; MIPS32-NEXT: ldc1 $f4, 48($sp) # 8-byte Folded Reload
650 ; MIPS32-NEXT: sdc1 $f0, 32($sp) # 8-byte Folded Spill
651 ; MIPS32-NEXT: sdc1 $f2, 24($sp) # 8-byte Folded Spill
652 ; MIPS32-NEXT: sdc1 $f4, 16($sp) # 8-byte Folded Spill
653 ; MIPS32-NEXT: bnez $1, $BB3_8
655 ; MIPS32-NEXT: # %bb.7: # %b.PHI.1
656 ; MIPS32-NEXT: j $BB3_15
658 ; MIPS32-NEXT: $BB3_8: # %b.PHI.1.end
659 ; MIPS32-NEXT: ldc1 $f0, 32($sp) # 8-byte Folded Reload
660 ; MIPS32-NEXT: lw $1, 60($sp) # 4-byte Folded Reload
661 ; MIPS32-NEXT: sdc1 $f0, 0($1)
662 ; MIPS32-NEXT: addiu $sp, $sp, 88
663 ; MIPS32-NEXT: jr $ra
665 ; MIPS32-NEXT: $BB3_9: # %pre.PHI.2
666 ; MIPS32-NEXT: ori $1, $zero, 1
667 ; MIPS32-NEXT: lw $2, 80($sp) # 4-byte Folded Reload
668 ; MIPS32-NEXT: and $1, $2, $1
669 ; MIPS32-NEXT: bnez $1, $BB3_11
671 ; MIPS32-NEXT: # %bb.10: # %pre.PHI.2
672 ; MIPS32-NEXT: j $BB3_12
674 ; MIPS32-NEXT: $BB3_11: # %b.PHI.2.0
675 ; MIPS32-NEXT: lw $1, 68($sp) # 4-byte Folded Reload
676 ; MIPS32-NEXT: ldc1 $f0, 0($1)
677 ; MIPS32-NEXT: sdc1 $f0, 8($sp) # 8-byte Folded Spill
678 ; MIPS32-NEXT: j $BB3_13
680 ; MIPS32-NEXT: $BB3_12: # %b.PHI.2.1
681 ; MIPS32-NEXT: lw $1, 84($sp) # 4-byte Folded Reload
682 ; MIPS32-NEXT: ldc1 $f0, 0($1)
683 ; MIPS32-NEXT: sdc1 $f0, 8($sp) # 8-byte Folded Spill
684 ; MIPS32-NEXT: $BB3_13: # %b.PHI.2
685 ; MIPS32-NEXT: ldc1 $f0, 8($sp) # 8-byte Folded Reload
686 ; MIPS32-NEXT: ori $1, $zero, 1
687 ; MIPS32-NEXT: lw $2, 76($sp) # 4-byte Folded Reload
688 ; MIPS32-NEXT: and $1, $2, $1
689 ; MIPS32-NEXT: mov.d $f2, $f0
690 ; MIPS32-NEXT: mov.d $f4, $f0
691 ; MIPS32-NEXT: sdc1 $f0, 0($sp) # 8-byte Folded Spill
692 ; MIPS32-NEXT: sdc1 $f2, 24($sp) # 8-byte Folded Spill
693 ; MIPS32-NEXT: sdc1 $f4, 16($sp) # 8-byte Folded Spill
694 ; MIPS32-NEXT: bnez $1, $BB3_15
696 ; MIPS32-NEXT: # %bb.14: # %b.PHI.2.end
697 ; MIPS32-NEXT: ldc1 $f0, 0($sp) # 8-byte Folded Reload
698 ; MIPS32-NEXT: lw $1, 60($sp) # 4-byte Folded Reload
699 ; MIPS32-NEXT: sdc1 $f0, 0($1)
700 ; MIPS32-NEXT: addiu $sp, $sp, 88
701 ; MIPS32-NEXT: jr $ra
703 ; MIPS32-NEXT: $BB3_15: # %b.PHI.3
704 ; MIPS32-NEXT: ldc1 $f0, 16($sp) # 8-byte Folded Reload
705 ; MIPS32-NEXT: ldc1 $f2, 24($sp) # 8-byte Folded Reload
706 ; MIPS32-NEXT: ori $1, $zero, 1
707 ; MIPS32-NEXT: lw $2, 72($sp) # 4-byte Folded Reload
708 ; MIPS32-NEXT: and $3, $2, $1
709 ; MIPS32-NEXT: movn.d $f0, $f2, $3
710 ; MIPS32-NEXT: lw $3, 76($sp) # 4-byte Folded Reload
711 ; MIPS32-NEXT: and $1, $3, $1
712 ; MIPS32-NEXT: mov.d $f4, $f2
713 ; MIPS32-NEXT: movn.d $f4, $f0, $1
714 ; MIPS32-NEXT: lw $1, 60($sp) # 4-byte Folded Reload
715 ; MIPS32-NEXT: sdc1 $f4, 0($1)
716 ; MIPS32-NEXT: sdc1 $f2, 0($1)
717 ; MIPS32-NEXT: addiu $sp, $sp, 88
718 ; MIPS32-NEXT: jr $ra
721 br i1 %cnd0, label %pre.PHI.2, label %pre.PHI.1
724 br i1 %cnd1, label %b.PHI.1.1, label %pre.PHI.1.0
727 br i1 %cnd2, label %b.PHI.1.2, label %b.PHI.1.0
730 %phi1.0 = load double, double* %a
734 %phi1.1 = load double, double* %b
738 %phi1.2 = load double, double* %c
742 %phi1 = phi double [ %phi1.0, %b.PHI.1.0 ], [ %phi1.1, %b.PHI.1.1 ], [ %phi1.2, %b.PHI.1.2 ]
743 br i1 %cnd2, label %b.PHI.1.end, label %b.PHI.3
746 store double %phi1, double* %result
750 br i1 %cnd0, label %b.PHI.2.0, label %b.PHI.2.1
753 %phi2.0 = load double, double* %a
757 %phi2.1 = load double, double* %b
761 %phi2 = phi double [ %phi2.0, %b.PHI.2.0 ], [ %phi2.1, %b.PHI.2.1 ]
762 br i1 %cnd1, label %b.PHI.3, label %b.PHI.2.end
765 store double %phi2, double* %result
769 %phi3 = phi double [ %phi2, %b.PHI.2], [ %phi1, %b.PHI.1 ]
770 %phi4 = phi double [ %phi2, %b.PHI.2], [ 0.0, %b.PHI.1 ]
771 %sel_1.2 = select i1 %cnd2, double %phi3, double %phi4
772 %sel_3_1.2 = select i1 %cnd1, double %sel_1.2, double %phi3
773 store double %sel_3_1.2, double* %result
774 store double %phi3, double* %result