aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Object/Error.cpp
diff options
context:
space:
mode:
authorRoman Lebedev <lebedev.ri@gmail.com>2020-06-27 11:34:58 +0300
committerRoman Lebedev <lebedev.ri@gmail.com>2020-06-27 11:37:17 +0300
commit141e845da5dda6743a09f858b4aec0133a931453 (patch)
tree195a5d5d5d2b67228be4b8b50eb911cda3cd65fa /llvm/lib/Object/Error.cpp
parentf9f52c88cafb11952a20eaa6d3b6cb2fcc79bbf9 (diff)
downloadllvm-141e845da5dda6743a09f858b4aec0133a931453.zip
llvm-141e845da5dda6743a09f858b4aec0133a931453.tar.gz
llvm-141e845da5dda6743a09f858b4aec0133a931453.tar.bz2
[SCEV] Make SCEVAddExpr actually always return pointer type if there is pointer operand (PR46457)
Summary: The added assertion fails on the added test without the fix. Reduced from test-suite/MultiSource/Benchmarks/MiBench/office-ispell/correct.c In IR, getelementptr, obviously, takes pointer as it's base, and returns a pointer. When creating an SCEV expression, SCEV operands are sorted in hope that it increases folding potential, and at the same time SCEVAddExpr's type is the type of the last(!) operand. Which means, in some exceedingly rare cases, pointer operand may happen to end up not being the last operand, and as a result SCEV for GEP will suddenly have a non-pointer return type. We should ensure that does not happen. In the end, actually storing the `Type *`, at the cost of increasing memory footprint of `SCEVAddExpr`, appears to be the solution. We can't just store a 'is a pointer' bit and create pointer type on the fly since we don't have data layout in getType(). Fixes [[ https://bugs.llvm.org/show_bug.cgi?id=46457 | PR46457 ]] Reviewers: efriedma, mkazantsev, reames, nikic Reviewed By: efriedma Subscribers: hiraditya, javed.absar, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D82633
Diffstat (limited to 'llvm/lib/Object/Error.cpp')
0 files changed, 0 insertions, 0 deletions