Skip to content

Commit 5c8a71d

Browse files
committed
[InstCombine] Remove unnecessary icmp of all-zero gep folds (NFC)
All-zero GEPs will be removed anyway, no need to special-case them here.
1 parent 54732a3 commit 5c8a71d

File tree

1 file changed

+0
-11
lines changed

1 file changed

+0
-11
lines changed

llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -846,17 +846,6 @@ Instruction *InstCombinerImpl::foldGEPICmp(GEPOperator *GEPLHS, Value *RHS,
846846
return transformToIndexedCompare(GEPLHS, RHS, Cond, DL, *this);
847847
}
848848

849-
// If one of the GEPs has all zero indices, recurse.
850-
// FIXME: Handle vector of pointers.
851-
if (!GEPLHS->getType()->isVectorTy() && GEPLHS->hasAllZeroIndices())
852-
return foldGEPICmp(GEPRHS, GEPLHS->getOperand(0),
853-
ICmpInst::getSwappedPredicate(Cond), I);
854-
855-
// If the other GEP has all zero indices, recurse.
856-
// FIXME: Handle vector of pointers.
857-
if (!GEPRHS->getType()->isVectorTy() && GEPRHS->hasAllZeroIndices())
858-
return foldGEPICmp(GEPLHS, GEPRHS->getOperand(0), Cond, I);
859-
860849
bool GEPsInBounds = GEPLHS->isInBounds() && GEPRHS->isInBounds();
861850
if (GEPLHS->getNumOperands() == GEPRHS->getNumOperands() &&
862851
GEPLHS->getSourceElementType() == GEPRHS->getSourceElementType()) {

0 commit comments

Comments
 (0)