aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Analysis
diff options
context:
space:
mode:
authorNikita Popov <npopov@redhat.com>2024-06-12 09:50:14 +0200
committerNikita Popov <npopov@redhat.com>2024-06-13 17:03:35 +0200
commitcc2dc0916ad6a00ebc9373a58854d77cf73af122 (patch)
treee918c11b7c7875b5e35123e302c0f94b02fe970e /llvm/lib/Analysis
parent3d35b94e3a9abcf5f703267c7653fd6ef39870b6 (diff)
downloadllvm-cc2dc0916ad6a00ebc9373a58854d77cf73af122.zip
llvm-cc2dc0916ad6a00ebc9373a58854d77cf73af122.tar.gz
llvm-cc2dc0916ad6a00ebc9373a58854d77cf73af122.tar.bz2
Reapply [ConstantFold] Drop gep of gep fold entirely (#95126)
Reapplying without changes. The flang+openmp buildbot failure should be addressed by https://github.com/llvm/llvm-project/pull/94541. ----- 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.cpp5
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);