diff options
author | Nikita Popov <npopov@redhat.com> | 2024-06-12 11:51:41 +0200 |
---|---|---|
committer | Nikita Popov <npopov@redhat.com> | 2024-06-12 11:52:12 +0200 |
commit | cece0a105b29dcbb9d88d0aa264c4745c07a8456 (patch) | |
tree | 36c477e6dff02c61bf05d19a5a414fab987c15ea /llvm/lib/IR/Constants.cpp | |
parent | 4a305d40a392e41521b6a427a6acd8d02d428f6c (diff) | |
download | llvm-cece0a105b29dcbb9d88d0aa264c4745c07a8456.zip llvm-cece0a105b29dcbb9d88d0aa264c4745c07a8456.tar.gz llvm-cece0a105b29dcbb9d88d0aa264c4745c07a8456.tar.bz2 |
Revert "[ConstantFold] Drop gep of gep fold entirely (#95126)"
This reverts commit 3b3b839c66dc49674fd6646650525a2173030690.
This broke the flang+openmp+offload buildbot, as reported in
https://github.com/llvm/llvm-project/pull/95126#issuecomment-2162424019.
Diffstat (limited to 'llvm/lib/IR/Constants.cpp')
-rw-r--r-- | llvm/lib/IR/Constants.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/llvm/lib/IR/Constants.cpp b/llvm/lib/IR/Constants.cpp index d079073..a76be44 100644 --- a/llvm/lib/IR/Constants.cpp +++ b/llvm/lib/IR/Constants.cpp @@ -2438,7 +2438,8 @@ Constant *ConstantExpr::getGetElementPtr(Type *Ty, Constant *C, assert(Ty && "Must specify element type"); assert(isSupportedGetElementPtr(Ty) && "Element type is unsupported!"); - if (Constant *FC = ConstantFoldGetElementPtr(Ty, C, InRange, Idxs)) + if (Constant *FC = + ConstantFoldGetElementPtr(Ty, C, NW.isInBounds(), InRange, Idxs)) return FC; // Fold a few common cases. assert(GetElementPtrInst::getIndexedType(Ty, Idxs) && "GEP indices invalid!"); |