Skip to content

Commit 7df92fb

Browse files
committed
[InstCombine] Remove redundant icmp gep fold (NFCI)
Gep with zero indices will be folded away independently. It will only be retained for splat geps, for which the transform is not applicable anyway.
1 parent 8d80a45 commit 7df92fb

File tree

1 file changed

+0
-8
lines changed

1 file changed

+0
-8
lines changed

llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3952,14 +3952,6 @@ Instruction *InstCombinerImpl::foldICmpInstWithConstantNotInt(ICmpInst &I) {
39523952
return nullptr;
39533953

39543954
switch (LHSI->getOpcode()) {
3955-
case Instruction::GetElementPtr:
3956-
// icmp pred GEP (P, int 0, int 0, int 0), null -> icmp pred P, null
3957-
if (RHSC->isNullValue() &&
3958-
cast<GetElementPtrInst>(LHSI)->hasAllZeroIndices())
3959-
return new ICmpInst(
3960-
I.getPredicate(), LHSI->getOperand(0),
3961-
Constant::getNullValue(LHSI->getOperand(0)->getType()));
3962-
break;
39633955
case Instruction::PHI:
39643956
if (Instruction *NV = foldOpIntoPhi(I, cast<PHINode>(LHSI)))
39653957
return NV;

0 commit comments

Comments
 (0)