diff options
author | Vedant Kumar <vsk@apple.com> | 2020-03-30 10:02:21 -0700 |
---|---|---|
committer | Vedant Kumar <vsk@apple.com> | 2020-03-30 10:14:14 -0700 |
commit | dcc410b5cf202e354105df431fad62d2f5f7eac7 (patch) | |
tree | 5c5884dd82383da522cb6d47fa0d3c9c39872be8 /llvm/lib/Transforms/Utils/BasicBlockUtils.cpp | |
parent | 673e81eee4fa3ffa38736f1063e6c4fa2d9278b0 (diff) | |
download | llvm-dcc410b5cf202e354105df431fad62d2f5f7eac7.zip llvm-dcc410b5cf202e354105df431fad62d2f5f7eac7.tar.gz llvm-dcc410b5cf202e354105df431fad62d2f5f7eac7.tar.bz2 |
[LoopVectorize] Fix crash on "getNoopOrZeroExtend cannot truncate!" (PR45259)
In InnerLoopVectorizer::getOrCreateTripCount, when the backedge taken
count is a SCEV add expression, its type is defined by the type of the
last operand of the add expression.
In the test case from PR45259, this last operand happens to be a
pointer, which (according to llvm::Type) does not have a primitive size
in bits. In this case, LoopVectorize fails to truncate the SCEV and
crashes as a result.
Uing ScalarEvolution::getTypeSizeInBits makes the truncation work as expected.
https://bugs.llvm.org/show_bug.cgi?id=45259
Differential Revision: https://reviews.llvm.org/D76669
Diffstat (limited to 'llvm/lib/Transforms/Utils/BasicBlockUtils.cpp')
0 files changed, 0 insertions, 0 deletions