42 lines · plain
1; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py2; RUN: llc < %s -mtriple=s390x-linux-gnu -pre-RA-sched=list-ilp -disable-sched-live-uses=false | FileCheck %s3 4target datalayout = "E-m:e-i1:8:16-i8:8:16-i64:64-f128:64-v128:64-a:8:16-n32:64"5 6%struct.a = type { i16, i32 }7 8@e = dso_local global %struct.a { i16 9, i32 0 }, align 89@f = dso_local local_unnamed_addr global ptr @e, align 810@d = dso_local local_unnamed_addr global i32 0, align 411 12; This shows a miscompile caused by merging truncated13; stores if the store of 0 (sthrl) to 'e' happens before14; a 64-bit store (stg) of r0. The store of r0 can follow15; the store to 'e' only if it is a 32-bit store (st).16 17define signext i32 @main() {18; CHECK-LABEL: main:19; CHECK: # %bb.0:20; CHECK-NEXT: lgrl %r0, e21; CHECK-NEXT: lgrl %r1, f22; CHECK-NEXT: srlg %r2, %r0, 3223; CHECK-NEXT: st %r2, 0(%r1)24; CHECK-NEXT: lhi %r2, 025; CHECK-NEXT: sthrl %r2, e26; CHECK-NEXT: st %r0, 4(%r1)27; CHECK-NEXT: lghi %r2, 028; CHECK-NEXT: strl %r0, d29; CHECK-NEXT: br %r1430 %e = load i64, ptr @e, align 831 %esh = lshr i64 %e, 3232 %ehi = trunc i64 %esh to i3233 %elo = trunc i64 %e to i3234 %t1 = load ptr, ptr @f, align 835 store i32 %ehi, ptr %t1, align 436 %f4 = getelementptr inbounds i8, ptr %t1, i64 437 store i32 %elo, ptr %f4, align 438 store i16 0, ptr @e, align 839 store i32 %elo, ptr @d, align 440 ret i32 041}42