diff options
author | Nikita Popov <npopov@redhat.com> | 2024-06-12 09:50:14 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-06-12 09:50:14 +0200 |
commit | 3b3b839c66dc49674fd6646650525a2173030690 (patch) | |
tree | 372e2fd7337c9db0535def3d9bfdc4fb226d5e60 /llvm/lib/Analysis | |
parent | 1754651dd150139d64cdae190afe1faabf69a403 (diff) | |
download | llvm-3b3b839c66dc49674fd6646650525a2173030690.zip llvm-3b3b839c66dc49674fd6646650525a2173030690.tar.gz llvm-3b3b839c66dc49674fd6646650525a2173030690.tar.bz2 |
[ConstantFold] Drop gep of gep fold entirely (#95126)
This is a followup to https://github.com/llvm/llvm-project/pull/93823
and drops the DataLayout-unaware GEP of GEP fold entirely. All cases are
now left to the DataLayout-aware constant folder, which will fold
everything to a single i8 GEP.
We didn't have any test coverage for this fold in LLVM, but some Clang
tests change.
Diffstat (limited to 'llvm/lib/Analysis')
-rw-r--r-- | llvm/lib/Analysis/InstructionSimplify.cpp | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/llvm/lib/Analysis/InstructionSimplify.cpp b/llvm/lib/Analysis/InstructionSimplify.cpp index 8b2aa6b..0089586 100644 --- a/llvm/lib/Analysis/InstructionSimplify.cpp +++ b/llvm/lib/Analysis/InstructionSimplify.cpp @@ -5068,9 +5068,8 @@ static Value *simplifyGEPInst(Type *SrcTy, Value *Ptr, return nullptr; if (!ConstantExpr::isSupportedGetElementPtr(SrcTy)) - // TODO(gep_nowrap): Pass on the whole GEPNoWrapFlags. - return ConstantFoldGetElementPtr(SrcTy, cast<Constant>(Ptr), - NW.isInBounds(), std::nullopt, Indices); + return ConstantFoldGetElementPtr(SrcTy, cast<Constant>(Ptr), std::nullopt, + Indices); auto *CE = ConstantExpr::getGetElementPtr(SrcTy, cast<Constant>(Ptr), Indices, NW); |