Skip to content

Commit

Permalink
[InstSimplify] Remove redundant gep zero fold (NFC)
Browse files Browse the repository at this point in the history
We already higher the all zero indices case above, no need to
also handle the special case of a single zero index.
  • Loading branch information
nikic committed Nov 20, 2023
1 parent b0154c3 commit 9ca9c2c
Showing 1 changed file with 0 additions and 4 deletions.
4 changes: 0 additions & 4 deletions llvm/lib/Analysis/InstructionSimplify.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4954,10 +4954,6 @@ static Value *simplifyGEPInst(Type *SrcTy, Value *Ptr,
});

if (Indices.size() == 1) {
// getelementptr P, 0 -> P.
if (match(Indices[0], m_Zero()) && Ptr->getType() == GEPTy)
return Ptr;

Type *Ty = SrcTy;
if (!IsScalableVec && Ty->isSized()) {
Value *P;
Expand Down

0 comments on commit 9ca9c2c

Please sign in to comment.