| ; NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py UTC_ARGS: --version 6 | |
| ; RUN: llc < %s -mtriple=s390x-linux-gnu -mcpu=z14 -O3 -stop-before=finalize-isel \ | |
| ; RUN: | FileCheck %s | |
| ; | |
| ; Check that an i1 in memory used in a comparison is loaded correctly. | |
| @bPtr = external dso_local local_unnamed_addr global ptr, align 8 | |
| @c = external hidden unnamed_addr global i1, align 4 | |
| define i64 @main() { | |
| ; CHECK-LABEL: name: main | |
| ; CHECK: bb.0.entry: | |
| ; CHECK-NEXT: [[LGRL:%[0-9]+]]:addr64bit = LGRL @bPtr :: (dereferenceable load (s64) from @bPtr) | |
| ; CHECK-NEXT: [[LARL:%[0-9]+]]:addr64bit = LARL @c | |
| ; CHECK-NEXT: MVI [[LARL]], 0, 1 :: (store (s8) into @c, align 4) | |
| ; CHECK-NEXT: MVHI [[LGRL]], 0, 8 :: (store (s32) into %ir.0) | |
| ; CHECK-NEXT: [[LLGC:%[0-9]+]]:gr64bit = LLGC [[LARL]], 0, $noreg :: (dereferenceable load (s8) from @c, align 4) | |
| ; CHECK-NEXT: [[DEF:%[0-9]+]]:gr64bit = IMPLICIT_DEF | |
| ; CHECK-NEXT: [[RISBGN:%[0-9]+]]:gr64bit = RISBGN [[DEF]], [[LLGC]], 63, 191, 0 | |
| ; CHECK-NEXT: [[LCGR:%[0-9]+]]:gr64bit = LCGR [[RISBGN]], implicit-def dead $cc | |
| ; CHECK-NEXT: CGHI [[LCGR]], 1, implicit-def $cc | |
| ; CHECK-NEXT: [[LGHI:%[0-9]+]]:gr64bit = LGHI 0 | |
| ; CHECK-NEXT: [[LOCGHI:%[0-9]+]]:gr64bit = LOCGHI [[LGHI]], 1, 14, 8, implicit $cc | |
| ; CHECK-NEXT: $r2d = COPY [[LOCGHI]] | |
| ; CHECK-NEXT: Return implicit $r2d | |
| entry: | |
| %0 = load ptr, ptr @bPtr | |
| store i1 true, ptr @c | |
| store i32 8, ptr %0 | |
| %.b = load i1, ptr @c | |
| %conv.i = select i1 %.b, i64 1, i64 3 | |
| %div.i = sdiv i64 -1, %conv.i | |
| %cmp.i = icmp eq i64 %div.i, 1 | |
| %conv2.i = zext i1 %cmp.i to i64 | |
| ret i64 %conv2.i | |
| } | |