1 #RUN: llc -o - %s -mtriple=s390x-ibm-linux -run-pass=greedy
2 #PR34502. Check HoistSpill works properly after the live range of spilled
3 #virtual register is cleared.
5 ; ModuleID = 'hoistspills_crash.ll'
6 source_filename = "bugpoint-output-07170c2.bc"
7 target datalayout = "E-m:e-i1:8:16-i8:8:16-i64:64-f128:64-v128:64-a:8:16-n32:64"
8 target triple = "s390x-ibm-linux"
10 @best8x8mode = external local_unnamed_addr global [4 x i16], align 2
11 @best8x8fwref = external local_unnamed_addr global [15 x [4 x i16]], align 2
12 @rec_mbY8x8 = external local_unnamed_addr global [16 x [16 x i16]], align 2
13 @bi_pred_me = external local_unnamed_addr global i32, align 4
15 declare signext i32 @Get_Direct_Cost8x8(i32 signext, ptr) local_unnamed_addr #0
16 declare void @store_coding_state(ptr) local_unnamed_addr #0
17 declare void @reset_coding_state(ptr) local_unnamed_addr #0
18 declare void @SetRefAndMotionVectors(i32 signext, i32 signext, i32 signext, i32 signext, i32 signext) local_unnamed_addr #2
19 declare signext i32 @Get_Direct_CostMB(double) local_unnamed_addr #0
20 declare void @SetModesAndRefframeForBlocks(i32 signext) local_unnamed_addr #1
22 define void @encode_one_macroblock() { ret void }
24 name: encode_one_macroblock
26 tracksRegLiveness: true
28 - { id: 0, class: addr64bit }
29 - { id: 1, class: addr64bit }
30 - { id: 2, class: grx32bit }
31 - { id: 3, class: grx32bit }
32 - { id: 4, class: gr32bit }
33 - { id: 5, class: gr32bit }
34 - { id: 6, class: addr64bit }
35 - { id: 7, class: addr64bit }
36 - { id: 8, class: gr64bit }
37 - { id: 9, class: grx32bit }
38 - { id: 10, class: gr32bit }
39 - { id: 11, class: grx32bit }
40 - { id: 12, class: gr32bit }
41 - { id: 13, class: grx32bit }
42 - { id: 14, class: gr32bit }
43 - { id: 15, class: grx32bit }
44 - { id: 16, class: grx32bit }
45 - { id: 17, class: gr32bit }
46 - { id: 18, class: gr32bit }
47 - { id: 19, class: gr64bit }
48 - { id: 20, class: grx32bit }
49 - { id: 21, class: grx32bit }
50 - { id: 22, class: addr64bit }
51 - { id: 23, class: grx32bit }
52 - { id: 24, class: grx32bit }
53 - { id: 25, class: grx32bit }
54 - { id: 26, class: grx32bit }
55 - { id: 27, class: grx32bit }
56 - { id: 28, class: grx32bit }
57 - { id: 29, class: grx32bit }
58 - { id: 30, class: grx32bit }
59 - { id: 31, class: grx32bit }
60 - { id: 32, class: grx32bit }
61 - { id: 33, class: grx32bit }
62 - { id: 34, class: grx32bit }
63 - { id: 35, class: grx32bit }
64 - { id: 36, class: grx32bit }
65 - { id: 37, class: gr64bit }
66 - { id: 38, class: gr32bit }
67 - { id: 39, class: grx32bit }
68 - { id: 40, class: addr64bit }
69 - { id: 41, class: addr64bit }
70 - { id: 42, class: gr64bit }
71 - { id: 43, class: gr32bit }
72 - { id: 44, class: gr32bit }
73 - { id: 45, class: gr32bit }
74 - { id: 46, class: gr32bit }
75 - { id: 47, class: gr32bit }
76 - { id: 48, class: grx32bit }
77 - { id: 49, class: gr64bit }
78 - { id: 50, class: gr64bit }
79 - { id: 51, class: gr64bit }
80 - { id: 52, class: gr32bit }
81 - { id: 53, class: gr32bit }
82 - { id: 54, class: grx32bit }
83 - { id: 55, class: gr32bit }
84 - { id: 56, class: grx32bit }
85 - { id: 57, class: grx32bit }
86 - { id: 58, class: gr64bit }
87 - { id: 59, class: gr64bit }
88 - { id: 60, class: gr32bit }
89 - { id: 61, class: grx32bit }
90 - { id: 62, class: addr64bit }
91 - { id: 63, class: addr64bit }
92 - { id: 64, class: addr64bit }
93 - { id: 65, class: addr64bit }
94 - { id: 66, class: addr64bit }
95 - { id: 67, class: addr64bit }
96 - { id: 68, class: addr64bit }
97 - { id: 69, class: addr64bit }
98 - { id: 70, class: addr64bit }
99 - { id: 71, class: gr64bit }
100 - { id: 72, class: addr64bit }
101 - { id: 73, class: grx32bit }
102 - { id: 74, class: gr64bit }
103 - { id: 75, class: addr64bit }
104 - { id: 76, class: addr64bit }
105 - { id: 77, class: addr64bit }
106 - { id: 78, class: addr64bit }
107 - { id: 79, class: gr32bit }
108 - { id: 80, class: grx32bit }
109 - { id: 81, class: gr64bit }
110 - { id: 82, class: addr64bit }
111 - { id: 83, class: grx32bit }
112 - { id: 84, class: addr64bit }
113 - { id: 85, class: addr64bit }
114 - { id: 86, class: addr64bit }
115 - { id: 87, class: grx32bit }
116 - { id: 88, class: addr64bit }
117 - { id: 89, class: addr64bit }
118 - { id: 90, class: gr64bit }
119 - { id: 91, class: addr64bit }
120 - { id: 92, class: addr64bit }
121 - { id: 93, class: addr64bit }
122 - { id: 94, class: addr64bit }
123 - { id: 95, class: addr64bit }
124 - { id: 96, class: addr64bit }
125 - { id: 97, class: addr64bit }
126 - { id: 98, class: gr64bit }
127 - { id: 99, class: gr64bit }
128 - { id: 100, class: addr64bit }
129 - { id: 101, class: gr64bit }
130 - { id: 102, class: gr64bit }
131 - { id: 103, class: gr64bit }
132 - { id: 104, class: gr64bit }
133 - { id: 105, class: addr64bit }
134 - { id: 106, class: grx32bit }
135 - { id: 107, class: grx32bit }
136 - { id: 108, class: vr64bit }
137 - { id: 109, class: gr64bit }
138 - { id: 110, class: gr64bit }
139 - { id: 111, class: grx32bit }
140 - { id: 112, class: grx32bit }
141 - { id: 113, class: fp64bit }
142 - { id: 114, class: grx32bit }
143 - { id: 115, class: fp64bit }
144 - { id: 116, class: fp64bit }
145 - { id: 117, class: addr64bit }
146 - { id: 118, class: grx32bit }
147 - { id: 119, class: grx32bit }
148 - { id: 120, class: addr64bit }
149 - { id: 121, class: grx32bit }
150 - { id: 122, class: grx32bit }
151 - { id: 123, class: gr32bit }
152 - { id: 124, class: gr32bit }
153 - { id: 125, class: gr32bit }
154 - { id: 126, class: gr32bit }
155 - { id: 127, class: gr32bit }
156 - { id: 128, class: grx32bit }
157 - { id: 129, class: grx32bit }
158 - { id: 130, class: fp64bit }
164 successors: %bb.2(0x00000001), %bb.1(0x7fffffff)
166 CHIMux undef %20, 3, implicit-def $cc
167 BRC 14, 8, %bb.2, implicit killed $cc
171 successors: %bb.2(0x00000001), %bb.3(0x7fffffff)
173 CHIMux undef %21, 0, implicit-def $cc
174 BRC 14, 6, %bb.3, implicit killed $cc
180 successors: %bb.6(0x00000001), %bb.4(0x7fffffff)
182 CHIMux undef %23, 2, implicit-def $cc
183 BRC 14, 8, %bb.6, implicit killed $cc
187 successors: %bb.5(0x00000001), %bb.7(0x7fffffff)
189 CHIMux undef %24, 1, implicit-def $cc
190 BRC 14, 6, %bb.7, implicit killed $cc
198 successors: %bb.47(0x00000001), %bb.8(0x7fffffff)
200 CHIMux undef %25, 1, implicit-def $cc
201 BRC 14, 8, %bb.47, implicit killed $cc
205 successors: %bb.46(0x00000001), %bb.48(0x7fffffff)
207 CHIMux undef %26, 2, implicit-def $cc
208 BRC 14, 8, %bb.46, implicit killed $cc
212 successors: %bb.36(0x00000001), %bb.10(0x7fffffff)
214 CHIMux undef %31, 1, implicit-def $cc
215 BRC 14, 8, %bb.36, implicit killed $cc
219 successors: %bb.35(0x00000001), %bb.37(0x7fffffff)
221 CHIMux undef %32, 2, implicit-def $cc
222 BRC 14, 8, %bb.35, implicit killed $cc
227 %6 = SLLG %120, $noreg, 1
229 %6 = AGR %6, %42, implicit-def dead $cc
230 %45 = SRLK %120.subreg_l32, $noreg, 31
231 %45 = AR %45, %120.subreg_l32, implicit-def dead $cc
232 %45 = NIFMux %45, 536870910, implicit-def dead $cc
233 %47 = SRK %120.subreg_l32, %45, implicit-def dead $cc
234 %47 = SLL %47, $noreg, 3
238 successors: %bb.56, %bb.13
240 CHIMux %38, 0, implicit-def $cc
241 BRC 14, 8, %bb.13, implicit killed $cc
247 successors: %bb.14(0x7fffffff), %bb.15(0x00000001)
249 ADJCALLSTACKDOWN 0, 0
250 %49 = LGFR %120.subreg_l32
252 CallBRASL @Get_Direct_Cost8x8, killed $r2d, undef $r3d, csr_systemz_elf, implicit-def dead $r14d, implicit-def dead $cc, implicit-def $r2d
254 %51 = COPY killed $r2d
255 MVHHI %7, 0, 0 :: (store (s16))
256 %12 = ARK %51.subreg_l32, %125, implicit-def dead $cc
257 CFIMux %51.subreg_l32, 2147483647, implicit-def $cc
258 %12 = LOCRMux %12, %126, 14, 8, implicit killed $cc
259 CFIMux %125, 2147483647, implicit-def $cc
260 %12 = LOCRMux %12, %126, 14, 8, implicit killed $cc
261 CHIMux undef %56, 0, implicit-def $cc
262 BRC 14, 6, %bb.15, implicit killed $cc
266 %124 = AHIMux %124, 1, implicit-def dead $cc
267 ADJCALLSTACKDOWN 0, 0
268 CallBRASL @store_coding_state, undef $r2d, csr_systemz_elf, implicit-def dead $r14d, implicit-def dead $cc
276 successors: %bb.12(0x7c000000), %bb.17(0x04000000)
278 CLGFI undef %59, 4, implicit-def $cc
279 BRC 14, 4, %bb.12, implicit killed $cc
283 successors: %bb.18, %bb.19
285 MVHI %0, 332, 2 :: (store (s32))
287 %60 = AR %60, %4, implicit-def dead $cc
288 %18 = LHMux %6, 0, $noreg :: (load (s16))
289 CHIMux %38, 0, implicit-def $cc
290 BRC 14, 6, %bb.19, implicit killed $cc
294 %62 = SLLG %81, $noreg, 1
296 %65 = LG undef %66, 0, $noreg :: (load (s64))
297 %67 = LGF undef %68, 0, $noreg :: (load (s32))
298 MVC undef %69, 0, 2, %64, 0 :: (store (s16)), (load (s16))
300 %70 = OILL64 %70, 3, implicit-def dead $cc
301 %71 = LA %70, 2, $noreg
302 %72 = SLLG %71, $noreg, 1
303 %73 = LHMux %72, 0, %63 :: (load (s16))
305 %75 = SLLG %74, $noreg, 1
306 %76 = LG %65, 0, $noreg :: (load (s64))
307 STHMux %73, %76, 0, %75 :: (store (s16))
308 %77 = LG undef %78, 0, $noreg :: (load (s64))
309 %79 = LHRL @rec_mbY8x8 :: (load (s16))
310 STHMux %79, %77, 0, $noreg :: (store (s16))
311 %80 = LHMux %72, 0, %63 :: (load (s16))
312 STHMux %80, %77, 0, %75 :: (store (s16))
313 %81 = OILL64 %81, 7, implicit-def dead $cc
314 %82 = SLLG %81, $noreg, 1
315 %83 = LHMux %82, 0, %63 :: (load (s16))
316 STHMux %83, %77, 0, $noreg :: (store (s16))
317 %84 = LA %62, 64, %63
318 MVC undef %85, 0, 2, %84, 0 :: (store (s16)), (load (s16))
319 %86 = SLLG %70, $noreg, 1
320 %87 = LHMux %86, 64, %63 :: (load (s16))
321 %88 = SLLG %67, $noreg, 3
322 %89 = LG %65, 16, %88 :: (load (s64))
324 %91 = SLLG %90, $noreg, 1
325 STHMux %87, %89, 0, %91 :: (store (s16))
326 %92 = LA %72, 64, %63
327 MVC undef %93, 0, 2, %92, 0 :: (store (s16)), (load (s16))
329 MVC undef %95, 0, 2, %94, 0 :: (store (s16)), (load (s16))
331 MVC undef %97, 0, 2, %96, 0 :: (store (s16)), (load (s16))
334 successors: %bb.20(0x04000000), %bb.11(0x7c000000)
336 %98 = LGH %7, 0, $noreg :: (load (s16))
337 %99 = LGH undef %100, 0, $noreg :: (load (s16))
338 ADJCALLSTACKDOWN 0, 0
339 %101 = LGFR %120.subreg_l32
346 CallBRASL @SetRefAndMotionVectors, killed $r2d, killed $r3d, killed $r4d, killed $r5d, killed $r6d, csr_systemz_elf, implicit-def dead $r14d, implicit-def dead $cc
348 ADJCALLSTACKDOWN 0, 0
349 CallBRASL @reset_coding_state, undef $r2d, csr_systemz_elf, implicit-def dead $r14d, implicit-def dead $cc
351 %120 = LA %120, 1, $noreg
352 CGHI %120, 4, implicit-def $cc
353 BRC 14, 6, %bb.11, implicit killed $cc
357 successors: %bb.22(0x00000001), %bb.21(0x7fffffff)
359 MVHI undef %105, 0, 0 :: (store (s32))
360 CHIMux undef %106, 3, implicit-def $cc
361 BRC 14, 8, %bb.22, implicit killed $cc
365 successors: %bb.22(0x00000001), %bb.23(0x7fffffff)
367 CHIMux undef %107, 0, implicit-def $cc
368 BRC 14, 6, %bb.23, implicit killed $cc
374 successors: %bb.26(0x00000001), %bb.24(0x7fffffff)
376 ADJCALLSTACKDOWN 0, 0
377 CallBRASL @Get_Direct_CostMB, undef $f0d, csr_systemz_elf, implicit-def dead $r14d, implicit-def dead $cc, implicit-def dead $r2d
379 ADJCALLSTACKDOWN 0, 0
381 CallBRASL @SetModesAndRefframeForBlocks, killed $r2d, csr_systemz_elf, implicit-def dead $r14d, implicit-def dead $cc
383 CHIMux undef %111, 13, implicit-def $cc
384 BRC 14, 8, %bb.26, implicit killed $cc
388 successors: %bb.25(0x00000001), %bb.27(0x7fffffff)
390 CHIMux undef %112, 8, implicit-def $cc
391 BRC 14, 6, %bb.27, implicit killed $cc
399 successors: %bb.28, %bb.29
401 CHIMux undef %114, 0, implicit-def $cc
402 BRC 14, 6, %bb.29, implicit killed $cc
405 %130 = CDFBR %60, implicit $fpc
412 successors: %bb.33(0x00000001), %bb.31(0x7fffffff)
414 VST64 %130, undef %117, 0, $noreg :: (store (s64))
415 CHIMux undef %118, 2, implicit-def $cc
416 BRC 14, 8, %bb.33, implicit killed $cc
420 successors: %bb.32(0x00000001), %bb.34(0x7fffffff)
422 CHIMux undef %119, 1, implicit-def $cc
423 BRC 14, 6, %bb.34, implicit killed $cc
438 successors: %bb.40(0x00000001), %bb.38(0x7fffffff)
440 CHIMux undef %33, 1, implicit-def $cc
441 BRC 14, 8, %bb.40, implicit killed $cc
445 successors: %bb.39(0x00000001), %bb.41(0x7fffffff)
447 CHIMux undef %34, 2, implicit-def $cc
448 BRC 14, 6, %bb.41, implicit killed $cc
456 successors: %bb.44(0x00000001), %bb.42(0x7fffffff)
458 CHIMux undef %35, 1, implicit-def $cc
459 BRC 14, 8, %bb.44, implicit killed $cc
463 successors: %bb.43(0x00000001), %bb.45(0x7fffffff)
465 CHIMux undef %36, 2, implicit-def $cc
466 BRC 14, 6, %bb.45, implicit killed $cc
474 %0 = LG undef %22, 0, $noreg :: (load (s64))
476 STRL %38, @bi_pred_me :: (store (s32))
478 %41 = LARL @best8x8fwref
479 %42 = LARL @best8x8mode
480 %63 = LARL @rec_mbY8x8
481 %126 = IIFMux 2147483647
492 successors: %bb.51(0x00000001), %bb.49(0x7fffffff)
494 CHIMux undef %27, 1, implicit-def $cc
495 BRC 14, 8, %bb.51, implicit killed $cc
499 successors: %bb.50(0x00000001), %bb.52(0x7fffffff)
501 CHIMux undef %28, 2, implicit-def $cc
502 BRC 14, 6, %bb.52, implicit killed $cc
510 successors: %bb.55(0x00000001), %bb.53(0x7fffffff)
512 CHIMux undef %29, 1, implicit-def $cc
513 BRC 14, 8, %bb.55, implicit killed $cc
517 successors: %bb.54(0x00000001), %bb.9(0x7fffffff)
519 CHIMux undef %30, 2, implicit-def $cc
520 BRC 14, 6, %bb.9, implicit killed $cc