42 lines · plain
1; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 22; RUN: opt -S -passes=jump-threading < %s | FileCheck %s3 4; Make sure this does not crash due to conflicting known bits.5 6define i32 @test() {7; CHECK-LABEL: define i32 @test() {8; CHECK-NEXT: join.thread:9; CHECK-NEXT: br label [[END:%.*]]10; CHECK: unreachable:11; CHECK-NEXT: [[SH_PROM:%.*]] = zext i32 -1 to i6412; CHECK-NEXT: [[SHL:%.*]] = shl nsw i64 -1, [[SH_PROM]]13; CHECK-NEXT: [[CONV:%.*]] = trunc i64 [[SHL]] to i3214; CHECK-NEXT: br label [[JOIN:%.*]]15; CHECK: join:16; CHECK-NEXT: [[PHI:%.*]] = phi i32 [ [[CONV]], [[UNREACHABLE:%.*]] ]17; CHECK-NEXT: [[CMP:%.*]] = icmp eq i32 [[PHI]], 018; CHECK-NEXT: br i1 [[CMP]], label [[END]], label [[END]]19; CHECK: end:20; CHECK-NEXT: ret i32 021;22entry:23 br label %join24 25unreachable:26 %sh_prom = zext i32 -1 to i6427 %shl = shl nsw i64 -1, %sh_prom28 %conv = trunc i64 %shl to i3229 br label %join30 31join:32 %phi = phi i32 [ %conv, %unreachable ], [ 0, %entry ]33 %cmp = icmp eq i32 %phi, 034 br i1 %cmp, label %end, label %if35 36if:37 br label %end38 39end:40 ret i32 041}42