1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc -mtriple=s390x-linux-gnu -mcpu=z13 -O3 -pre-RA-sched=list-ilp -systemz-subreg-liveness -stress-sched -terminal-rule %s -o - | FileCheck %s
3 ; This test used to fail because we were creating empty subranges
4 ; instead of subranges with dead defs while rematerializing values
10 @g_39 = external dso_local unnamed_addr global i64, align 8
11 @g_151 = external dso_local global i32, align 4
12 @g_222 = external dso_local unnamed_addr global [7 x [10 x i8]], align 2
14 define void @main(i16 %in) {
17 ; CHECK-NEXT: lhr %r2, %r2
18 ; CHECK-NEXT: larl %r1, g_151
19 ; CHECK-NEXT: lghi %r3, 0
20 ; CHECK-NEXT: chi %r2, 0
21 ; CHECK-NEXT: lhi %r0, 1
22 ; CHECK-NEXT: locghile %r3, 1
23 ; CHECK-NEXT: o %r0, 0(%r1)
24 ; CHECK-NEXT: larl %r1, g_222
25 ; CHECK-NEXT: lghi %r5, 0
26 ; CHECK-NEXT: dsgfr %r2, %r0
27 ; CHECK-NEXT: stgrl %r2, g_39
28 ; CHECK-NEXT: stc %r5, 19(%r1)
30 %tmp = load i32, i32* @g_151, align 4
31 %tmp3 = or i32 %tmp, 1
32 %tmp4 = sext i32 %tmp3 to i64
33 %tmp5 = srem i64 0, %tmp4
34 %tmp6 = trunc i64 %tmp5 to i8
35 store i8 %tmp6, i8* getelementptr inbounds ([7 x [10 x i8]], [7 x [10 x i8]]* @g_222, i64 0, i64 1, i64 9), align 1
36 %tmp7 = icmp slt i16 %in, 1
37 %tmp8 = zext i1 %tmp7 to i64
38 %tmp9 = srem i64 %tmp8, %tmp4
39 store i64 %tmp9, i64* @g_39, align 8