aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/IR/Module.cpp
diff options
context:
space:
mode:
authorSanjay Patel <spatel@rotateright.com>2017-05-09 16:24:59 +0000
committerSanjay Patel <spatel@rotateright.com>2017-05-09 16:24:59 +0000
commit6844e21f593467c640f0e14e2113bf0dfb32b1a8 (patch)
treea0bc16140ba56e87ca046528176741727e044666 /llvm/lib/IR/Module.cpp
parent125c03070edbe7ee8b4f66879a08dc80cd280584 (diff)
downloadllvm-6844e21f593467c640f0e14e2113bf0dfb32b1a8.zip
llvm-6844e21f593467c640f0e14e2113bf0dfb32b1a8.tar.gz
llvm-6844e21f593467c640f0e14e2113bf0dfb32b1a8.tar.bz2
[InstCombineCasts] Fix checks in sext->lshr->trunc pattern.
The comment says to avoid the case where zero bits are shifted into the truncated value, but the code checks that the shift is smaller than the truncated value instead of the number of bits added by the sign extension. Fixing this allows a shift by more than the value size to be introduced, which is undefined behavior, so the shift is capped at the value size minus one, which has the expected behavior of filling the value with the sign bit. Patch by Jacob Young! Differential Revision: https://reviews.llvm.org/D32285 llvm-svn: 302548
Diffstat (limited to 'llvm/lib/IR/Module.cpp')
0 files changed, 0 insertions, 0 deletions