Skip to content

Commit d59529c

Browse files
committed
[InstCombine] Address review comments. NFC.
1 parent b14982b commit d59529c

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -833,11 +833,9 @@ Instruction *InstCombinerImpl::foldGEPICmp(GEPOperator *GEPLHS, Value *RHS,
833833
if (NumDifferences == 0) // SAME GEP?
834834
return replaceInstUsesWith(I, // No comparison is needed here.
835835
ConstantInt::get(I.getType(), ICmpInst::isTrueWhenEqual(Cond)));
836-
// If two GEPs only differ by an index/the base pointer, compare them.
836+
// If two GEPs only differ by an index, compare them.
837837
// Note that nowrap flags are always needed when comparing two indices.
838-
else if (NumDifferences == 1 &&
839-
(DiffOperand == 0 ? CanFold(NW)
840-
: NW != GEPNoWrapFlags::none())) {
838+
else if (NumDifferences == 1 && NW != GEPNoWrapFlags::none()) {
841839
Value *LHSV = GEPLHS->getOperand(DiffOperand);
842840
Value *RHSV = GEPRHS->getOperand(DiffOperand);
843841
return NewICmp(NW, LHSV, RHSV);

0 commit comments

Comments
 (0)