1 # RUN: llc %s -mtriple=s390x-linux-gnu -mcpu=z13 \
2 # RUN: -start-before=register-coalescer -o - 2>&1 > /dev/null
4 # Test that the SystemZ shouldCoalesce() implementation does not crash in
5 # case of an undef use in another MBB. This was discovered in testing with
6 # -systemz-subreg-liveness.
9 @g_74 = external dso_local unnamed_addr global i32, align 4
10 @g_193 = external dso_local unnamed_addr global i32, align 4
12 define dso_local void @main() local_unnamed_addr {
13 %1 = load i32, ptr @g_193
14 %2 = or i32 %1, -1395153718
15 %3 = sdiv i32 -1395153718, %2
16 br i1 undef, label %5, label %4
18 ; <label>:4: ; preds = %0
19 store i32 %3, ptr @g_74
20 store i32 -9, ptr @g_74
23 ; <label>:5: ; preds = %0
31 tracksRegLiveness: true
33 - { id: 0, class: grx32bit }
34 - { id: 1, class: addr64bit }
35 - { id: 2, class: gr32bit }
36 - { id: 3, class: gr32bit }
37 - { id: 4, class: gr64bit }
38 - { id: 5, class: gr128bit }
39 - { id: 6, class: gr128bit }
40 - { id: 7, class: grx32bit }
41 - { id: 8, class: gr32bit }
42 - { id: 9, class: gr128bit }
45 successors: %bb.2(0x00000001), %bb.1(0x7fffffff)
47 %1:addr64bit = LARL @g_193
48 %2:gr32bit = IIFMux 2899813578
49 %3:gr32bit = COPY killed %2
50 %3:gr32bit = O %3, killed %1, 0, $noreg, implicit-def dead $cc :: (dereferenceable load (s32) from @g_193)
51 %4:gr64bit = LGFI -1395153718
52 undef %5.subreg_l64:gr128bit = COPY killed %4
53 %6:gr128bit = COPY killed %5
54 dead %6:gr128bit = DSGFR %6, killed %3
55 %7:grx32bit = LHIMux 0
56 CHIMux killed %7, 0, implicit-def $cc
57 BRC 14, 6, %bb.2, implicit killed $cc
61 %8:gr32bit = LHIMux -9
62 STRL killed %8, @g_74 :: (store (s32) into @g_74)
66 dead %0:grx32bit = COPY undef %6.subreg_l32