46 lines · plain
1; NOTE: Assertions have been autogenerated by utils/update_test_checks.py2; RUN: opt -S -passes=guard-widening < %s | FileCheck %s3 4declare void @llvm.experimental.deoptimize.isVoid(...)5declare i1 @llvm.experimental.widenable.condition()6 7; In the current scheme we widen `br i1 %and1`, so we try to build8; `and i1 poison, %and1` using `%call0` as insertion point.9; That's not possible, so widening will not occur in the case.10; TODO: Widen `%call0` in the test case, not a branch.11define void @test() {12; CHECK-LABEL: @test(13; CHECK-NEXT: bb0:14; CHECK-NEXT: [[CALL0:%.*]] = call i1 @llvm.experimental.widenable.condition()15; CHECK-NEXT: [[AND0:%.*]] = and i1 false, [[CALL0]]16; CHECK-NEXT: [[AND1:%.*]] = and i1 false, [[AND0]]17; CHECK-NEXT: br i1 [[AND1]], label [[BB1:%.*]], label [[DEOPT:%.*]]18; CHECK: bb1:19; CHECK-NEXT: [[CALL1:%.*]] = call i1 @llvm.experimental.widenable.condition()20; CHECK-NEXT: [[AND2:%.*]] = and i1 poison, [[CALL1]]21; CHECK-NEXT: br i1 [[AND2]], label [[UNREACH:%.*]], label [[DEOPT]]22; CHECK: unreach:23; CHECK-NEXT: unreachable24; CHECK: deopt:25; CHECK-NEXT: call void (...) @llvm.experimental.deoptimize.isVoid(i32 0) [ "deopt"(i32 0) ]26; CHECK-NEXT: ret void27;28bb0:29 %call0 = call i1 @llvm.experimental.widenable.condition()30 %and0 = and i1 false, %call031 %and1 = and i1 false, %and032 br i1 %and1, label %bb1, label %deopt33 34bb1:35 %call1 = call i1 @llvm.experimental.widenable.condition()36 %and2 = and i1 poison, %call137 br i1 %and2, label %unreach, label %deopt38 39unreach:40 unreachable41 42deopt:43 call void (...) @llvm.experimental.deoptimize.isVoid(i32 0) [ "deopt"(i32 0) ]44 ret void45}46