Skip to content

Commit 919416d

Browse files
committed
[ConstraintElim] Ignore unknown conditions
1 parent c140c31 commit 919416d

File tree

2 files changed

+1
-3
lines changed

2 files changed

+1
-3
lines changed

llvm/lib/Transforms/Scalar/ConstraintElimination.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1536,9 +1536,7 @@ static bool checkOrAndOpImpliedByOther(
15361536
: match(Val, m_LogicalAnd(m_Value(LHS), m_Value(RHS)))) {
15371537
Worklist.push_back(LHS);
15381538
Worklist.push_back(RHS);
1539-
continue;
15401539
}
1541-
return false;
15421540
}
15431541
if (OldSize == DFSInStack.size())
15441542
return false;

llvm/test/Transforms/ConstraintElimination/and-implied-by-operands.ll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -659,7 +659,7 @@ define void @or_tree_second_implies_first_with_unknown_cond(i64 %x, i1 %cond) {
659659
; CHECK-NEXT: [[CMP1:%.*]] = icmp ugt i64 [[X:%.*]], 1
660660
; CHECK-NEXT: [[OR1:%.*]] = select i1 [[CMP1]], i1 [[COND:%.*]], i1 false
661661
; CHECK-NEXT: [[CMP2:%.*]] = icmp ult i64 [[X]], 2
662-
; CHECK-NEXT: [[OR2:%.*]] = select i1 [[OR1]], i1 [[CMP2]], i1 false
662+
; CHECK-NEXT: [[OR2:%.*]] = select i1 [[OR1]], i1 false, i1 false
663663
; CHECK-NEXT: br i1 [[OR2]], label [[IF_THEN:%.*]], label [[IF_END:%.*]]
664664
; CHECK: if.then:
665665
; CHECK-NEXT: call void @side_effect()

0 commit comments

Comments
 (0)