1 # RUN: llc -mtriple=s390x-linux-gnu -mcpu=z13 -misched=shuffle -verify-machineinstrs -start-before=register-coalescer -systemz-subreg-liveness %s -o - | FileCheck %s
3 # -misched=shuffle is under !NDEBUG.
6 # Check for successful compilation.
10 target datalayout = "E-m:e-i1:8:16-i8:8:16-i64:64-f128:64-v128:64-a:8:16-n32:64"
11 target triple = "s390x-unknown-linux-gnu"
13 @g_54 = external dso_local unnamed_addr global i8, align 2
14 @g_69 = external dso_local unnamed_addr global i32, align 4
15 @g_189 = external dso_local unnamed_addr global i16, align 2
16 @g_226 = external dso_local unnamed_addr global i8, align 2
17 @g_314 = external dso_local global [10 x i8], align 2
18 @g_334 = external dso_local global i32, align 4
19 @g_352 = external dso_local unnamed_addr global i64, align 8
20 @g_747 = external dso_local unnamed_addr global i1, align 2
21 @0 = internal unnamed_addr global i8 74, align 2
22 @g_1055 = external dso_local unnamed_addr global i16, align 2
23 @g_195 = external dso_local global ptr, align 8
25 declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #0
27 declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #0
29 define dso_local fastcc void @func_32(i8 zeroext %arg, i16 zeroext %arg1) unnamed_addr #1 {
31 %tmp = alloca i32, align 4
32 %tmp2 = alloca [5 x [5 x ptr]], align 8
33 %tmp3 = bitcast ptr %tmp2 to ptr
34 %tmp4 = getelementptr inbounds [5 x [5 x ptr]], ptr %tmp2, i64 0, i64 2, i64 2
35 %tmp5 = bitcast ptr %tmp4 to ptr
38 bb6: ; preds = %bb40, %bb
39 %tmp7 = phi i8 [ 0, %bb ], [ %tmp43, %bb40 ]
40 %tmp8 = phi i16 [ %arg1, %bb ], [ %tmp41, %bb40 ]
41 %tmp9 = phi i8 [ %arg, %bb ], [ 0, %bb40 ]
42 %tmp10 = sext i8 %tmp7 to i64
43 %tmp11 = add nsw i64 %tmp10, 1
44 %tmp12 = getelementptr inbounds [10 x i8], ptr @g_314, i64 0, i64 %tmp11
45 %tmp13 = load volatile i8, ptr %tmp12, align 1
46 br i1 undef, label %bb39, label %bb14
49 %tmp15 = load ptr, ptr @g_195, align 8
50 %tmp16 = load volatile i8, ptr %tmp12, align 1
51 store i32 7, ptr %tmp, align 4
52 call void @llvm.lifetime.start.p0(i64 200, ptr nonnull %tmp3)
53 store i32 580868341, ptr @g_69, align 4
54 %tmp17 = zext i8 %tmp9 to i64
55 %tmp18 = load i64, ptr @g_352, align 8
56 %tmp19 = and i64 %tmp18, %tmp17
57 %tmp20 = icmp ne i64 %tmp19, 1
58 %tmp21 = zext i1 %tmp20 to i64
59 %tmp22 = load ptr, ptr %tmp15, align 8
60 store i64 %tmp21, ptr %tmp22, align 8
61 %tmp23 = load i32, ptr @g_334, align 4
62 %tmp24 = xor i32 %tmp23, 1
63 store i32 %tmp24, ptr @g_334, align 4
64 %tmp25 = zext i8 %tmp9 to i16
65 %tmp26 = mul i16 %tmp25, 26036
66 %tmp27 = load ptr, ptr %tmp5, align 8
70 %tmp29 = mul i16 %tmp26, %tmp8
71 %tmp30 = zext i16 %tmp29 to i32
72 store i32 %tmp30, ptr @g_69, align 4
73 store i8 0, ptr @g_226, align 2
77 call void @llvm.lifetime.end.p0(i64 200, ptr nonnull %tmp3)
80 bb32: ; preds = %bb34, %bb28
81 store i16 1, ptr @g_1055, align 2
82 store i64 0, ptr @g_352, align 8
83 store ptr @g_334, ptr undef, align 8
85 store i64 %tmp33, ptr @g_352, align 8
86 store ptr @g_334, ptr null, align 8
90 br i1 false, label %bb32, label %bb35
93 store ptr %tmp, ptr undef, align 8
94 store i8 0, ptr @0, align 2
95 store i16 2, ptr @g_189, align 2
96 store i8 1, ptr @g_54, align 2
97 store i1 true, ptr @g_747, align 2
98 store i64 0, ptr undef, align 8
99 %tmp36 = load ptr, ptr undef, align 8
100 %tmp37 = load i64, ptr %tmp36, align 8
101 %tmp38 = load ptr, ptr %tmp27, align 8
102 store i64 %tmp37, ptr %tmp38, align 8
103 store i16 0, ptr @g_189, align 2
109 bb40: ; preds = %bb39, %bb31
110 %tmp41 = phi i16 [ undef, %bb39 ], [ 0, %bb31 ]
111 %tmp42 = load volatile i8, ptr %tmp12, align 1
112 %tmp43 = add i8 %tmp7, 1
113 br i1 false, label %bb6, label %bb44
115 bb44: ; preds = %bb40
119 attributes #0 = { argmemonly nofree nosync nounwind willreturn }
120 attributes #1 = { nounwind }
121 attributes #2 = { nofree nosync nounwind willreturn }
127 tracksRegLiveness: true
129 - { reg: '$r2d', virtual-reg: '%0' }
130 - { reg: '$r3d', virtual-reg: '%1' }
134 - { id: 0, name: tmp, size: 4, alignment: 4 }
135 - { id: 1, name: tmp2, size: 200, alignment: 8 }
140 %1:gr64bit = COPY killed $r3d
141 %0:gr64bit = COPY killed $r2d
142 %2:grx32bit = COPY killed %1.subreg_l32
143 %3:grx32bit = COPY killed %0.subreg_l32
144 %4:addr64bit = LA %stack.1.tmp2, 96, $noreg
145 %5:gr32bit = LHIMux 0
146 %6:addr64bit = LARL @g_314
147 %7:gr32bit = IIFMux 580868341
148 %8:addr64bit = LARL @g_352
150 %10:addr64bit = LARL @g_334
151 %11:gr32bit = LHIMux 1
152 %12:addr64bit = LARL @g_226
154 %14:gr64bit = LA %stack.0.tmp, 0, $noreg
155 %15:addr64bit = LARL @0
156 %16:gr32bit = LHIMux 2
157 %17:addr64bit = LARL @g_54
158 %18:addr64bit = LARL @g_747
159 %19:grx32bit = COPY %5
160 %20:gr32bit = COPY killed %2
161 %21:grx32bit = COPY killed %3
164 %22:grx32bit = COPY killed %21
165 %23:gr32bit = COPY killed %20
166 %24:grx32bit = COPY killed %19
167 undef %25.subreg_l32:gr64bit = COPY %24
168 %26:addr64bit = LGBR killed %25
169 %27:addr64bit = LA %26, 1, %6
170 dead %28:grx32bit = LBMux killed %26, 1, %6 :: (volatile load (s8) from %ir.tmp12)
171 CHIMux %5, 0, implicit-def $cc
172 BRC 14, 6, %bb.7, implicit killed $cc
176 %29:addr64bit = LGRL @g_195 :: (dereferenceable load (s64) from @g_195)
177 dead %30:grx32bit = LBMux %27, 0, $noreg :: (volatile load (s8) from %ir.tmp12)
178 MVHI %stack.0.tmp, 0, 7 :: (store (s32) into %ir.tmp)
179 STRL %7, @g_69 :: (store (s32) into @g_69)
180 undef %31.subreg_l32:gr64bit = COPY %22
181 %32:gr64bit = LLGC %8, 7, $noreg :: (dereferenceable load (s8) from @g_352 + 7)
182 %33:gr64bit = COPY killed %32
183 %33:gr64bit = RNSBG %33, killed %31, 0, 63, 0, implicit-def dead $cc
184 CGHI killed %33, 1, implicit-def $cc
185 %34:gr64bit = COPY %9
186 %34:gr64bit = LOCGHI %34, 1, 14, 6, implicit killed $cc
187 %35:addr64bit = LG killed %29, 0, $noreg :: (load (s64) from %ir.tmp15)
188 STG killed %34, killed %35, 0, $noreg :: (store (s64) into %ir.tmp22)
189 %36:gr32bit = COPY %11
190 %36:gr32bit = X %36, %10, 0, $noreg, implicit-def dead $cc :: (dereferenceable load (s32) from @g_334)
191 STRL killed %36, @g_334 :: (store (s32) into @g_334)
192 %37:gr32bit = LLCRMux killed %22
193 %38:gr32bit = COPY killed %37
194 %38:gr32bit = MHI %38, 26036
195 %39:addr64bit = LG %4, 0, $noreg :: (dereferenceable load (s64) from %ir.tmp5)
198 %40:gr32bit = COPY killed %38
199 %40:gr32bit = MSR %40, killed %23
200 %41:gr32bit = LLHRMux killed %40
201 STRL killed %41, @g_69 :: (store (s32) into @g_69)
202 MVI %12, 0, 0 :: (store (s8) into @g_226, align 2)
206 STHRL %11, @g_1055 :: (store (s16) into @g_1055)
207 STGRL %9, @g_352 :: (store (s64) into @g_352)
208 STG %10, undef %42:addr64bit, 0, $noreg :: (store (s64) into `ptr undef`)
209 STGRL %13, @g_352 :: (store (s64) into @g_352)
210 STG %10, $noreg, 0, $noreg :: (store (s64) into `ptr null`)
213 successors: %bb.4(0x7c000000), %bb.6(0x04000000)
215 CHIMux %5, 0, implicit-def $cc
216 BRC 14, 6, %bb.4, implicit killed $cc
220 STG %14, undef %43:addr64bit, 0, $noreg :: (store (s64) into `ptr undef`)
221 MVI %15, 0, 0 :: (store (s8) into @0, align 2)
222 STHRL %16, @g_189 :: (store (s16) into @g_189)
223 MVI %17, 0, 1 :: (store (s8) into @g_54, align 2)
224 MVI %18, 0, 1 :: (store (s8) into @g_747, align 2)
225 MVGHI undef %44:addr64bit, 0, 0 :: (store (s64) into `ptr undef`)
226 %45:gr64bit = LG $noreg, 0, $noreg :: (load (s64) from %ir.tmp36)
227 %46:addr64bit = LG killed %39, 0, $noreg :: (load (s64) from %ir.tmp27)
228 STG killed %45, killed %46, 0, $noreg :: (store (s64) into %ir.tmp38)
229 STHRL %5, @g_189 :: (store (s16) into @g_189)
230 %47:grx32bit = LHIMux 0
231 %48:grx32bit = COPY killed %47
235 %48:grx32bit = IMPLICIT_DEF
238 successors: %bb.1(0x7fffffff), %bb.9(0x00000001)
240 %49:grx32bit = COPY killed %48
241 dead %50:grx32bit = LBMux killed %27, 0, $noreg :: (volatile load (s8) from %ir.tmp12)
242 %51:grx32bit = COPY killed %24
243 %51:grx32bit = AHIMux %51, 1, implicit-def dead $cc
244 %52:grx32bit = LHIMux 0
245 CHIMux %52, 0, implicit-def $cc
246 %19:grx32bit = COPY killed %51
247 %20:gr32bit = COPY killed %49
248 %21:grx32bit = COPY killed %52
249 BRC 14, 6, %bb.1, implicit killed $cc