diff options
author | Nikita Popov <npopov@redhat.com> | 2023-11-20 16:22:28 +0100 |
---|---|---|
committer | Nikita Popov <npopov@redhat.com> | 2023-11-20 16:25:48 +0100 |
commit | 9ca9c2cf7e05a0fe44a8a688d0c322d5229511d9 (patch) | |
tree | 0baeb5588cd60a838e4a1679fe382ead897418f6 | |
parent | b0154c36d6387272f7f961c22582693d2850d21c (diff) | |
download | llvm-9ca9c2cf7e05a0fe44a8a688d0c322d5229511d9.zip llvm-9ca9c2cf7e05a0fe44a8a688d0c322d5229511d9.tar.gz llvm-9ca9c2cf7e05a0fe44a8a688d0c322d5229511d9.tar.bz2 |
[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.
-rw-r--r-- | llvm/lib/Analysis/InstructionSimplify.cpp | 4 |
1 files changed, 0 insertions, 4 deletions
diff --git a/llvm/lib/Analysis/InstructionSimplify.cpp b/llvm/lib/Analysis/InstructionSimplify.cpp index 6323968..7ef2ffd 100644 --- a/llvm/lib/Analysis/InstructionSimplify.cpp +++ b/llvm/lib/Analysis/InstructionSimplify.cpp @@ -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; |