Skip to content

Commit 9ca9c2c

Browse files
committed
[InstSimplify] Remove redundant gep zero fold (NFC)
We already higher the all zero indices case above, no need to also handle the special case of a single zero index.
1 parent b0154c3 commit 9ca9c2c

File tree

1 file changed

+0
-4
lines changed

1 file changed

+0
-4
lines changed

llvm/lib/Analysis/InstructionSimplify.cpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4954,10 +4954,6 @@ static Value *simplifyGEPInst(Type *SrcTy, Value *Ptr,
49544954
});
49554955

49564956
if (Indices.size() == 1) {
4957-
// getelementptr P, 0 -> P.
4958-
if (match(Indices[0], m_Zero()) && Ptr->getType() == GEPTy)
4959-
return Ptr;
4960-
49614957
Type *Ty = SrcTy;
49624958
if (!IsScalableVec && Ty->isSized()) {
49634959
Value *P;

0 commit comments

Comments
 (0)