summaryrefslogtreecommitdiff
path: root/llvm/lib/Bitcode/Reader/BitcodeReader.cpp
diff options
context:
space:
mode:
authorNikita Popov <npopov@redhat.com>2024-05-31 09:25:38 +0200
committerNikita Popov <npopov@redhat.com>2024-06-10 10:12:55 +0200
commitcc158d4c0bb50554dadcad44c10cafb052376cea (patch)
treecc78f7e1c65d23219bf565c88eddab9e7f4401f2 /llvm/lib/Bitcode/Reader/BitcodeReader.cpp
parente58f830a1de20af79a6ce41c85b787f4a64b9c74 (diff)
Reapply [ConstantFold] Remove non-trivial gep-of-gep fold (#93823)
Reapply after https://github.com/llvm/llvm-project/pull/93956, which changed clang array initialization codegen to avoid size regressions for unoptimized builds. ----- This fold is subtly incorrect, because DL-unaware constant folding does not know the correct index type to use, and just performs the addition in the type that happens to already be there. This is incorrect, since sext(X)+sext(Y) is generally not the same as sext(X+Y). See the `@constexpr_gep_of_gep_with_narrow_type()` for a miscompile with the current implementation. One could try to restrict the fold to cases where no overflow occurs, but I'm not bothering with that here, because the DL-aware constant folding will take care of this anyway. I've only kept the straightforward zero-index case, where we just concatenate two GEPs.
Diffstat (limited to 'llvm/lib/Bitcode/Reader/BitcodeReader.cpp')
0 files changed, 0 insertions, 0 deletions