Skip to content

Commit 3116f90

Browse files
committed
Rerun CI
1 parent 8cedff8 commit 3116f90

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4634,16 +4634,15 @@ Instruction *InstCombinerImpl::foldICmpBinOp(ICmpInst &I,
46344634
// Analyze the case when either Op0 or Op1 is an add instruction.
46354635
// Op0 = A + B (or A and B are null); Op1 = C + D (or C and D are null).
46364636
Value *A = nullptr, *B = nullptr, *C = nullptr, *D = nullptr;
4637-
auto hasNoWrapProblem = [&](const BinaryOperator &BO, const Value *X,
4638-
const Value *Y, bool &HasNSW,
4639-
bool &HasNUW) -> bool {
4637+
auto hasNoWrapProblem = [](const BinaryOperator &BO, CmpInst::Predicate Pred,
4638+
bool &HasNSW, bool &HasNUW) -> bool {
46404639
if (isa<OverflowingBinaryOperator>(BO)) {
46414640
HasNUW = BO.hasNoUnsignedWrap();
46424641
HasNSW = BO.hasNoSignedWrap();
46434642
return ICmpInst::isEquality(Pred) ||
46444643
(CmpInst::isUnsigned(Pred) && HasNUW) ||
46454644
(CmpInst::isSigned(Pred) && HasNSW);
4646-
} else if (BO0->getOpcode() == Instruction::Or) {
4645+
} else if (BO.getOpcode() == Instruction::Or) {
46474646
HasNUW = true;
46484647
HasNSW = true;
46494648
return true;
@@ -4654,11 +4653,11 @@ Instruction *InstCombinerImpl::foldICmpBinOp(ICmpInst &I,
46544653

46554654
if (BO0) {
46564655
match(BO0, m_AddLike(m_Value(A), m_Value(B)));
4657-
NoOp0WrapProblem = hasNoWrapProblem(*BO0, A, B, Op0HasNSW, Op0HasNUW);
4656+
NoOp0WrapProblem = hasNoWrapProblem(*BO0, Pred, Op0HasNSW, Op0HasNUW);
46584657
}
46594658
if (BO1) {
46604659
match(BO1, m_AddLike(m_Value(C), m_Value(D)));
4661-
NoOp1WrapProblem = hasNoWrapProblem(*BO1, C, D, Op1HasNSW, Op1HasNUW);
4660+
NoOp1WrapProblem = hasNoWrapProblem(*BO1, Pred, Op1HasNSW, Op1HasNUW);
46624661
}
46634662

46644663
if ((A == Op1 || B == Op1) && NoOp0WrapProblem)

0 commit comments

Comments
 (0)