aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Transforms/Utils/LoopUtils.cpp
diff options
context:
space:
mode:
authorRoman Lebedev <lebedev.ri@gmail.com>2020-02-25 16:48:36 +0300
committerRoman Lebedev <lebedev.ri@gmail.com>2020-02-25 18:23:51 +0300
commit781d077afb0ed9771c513d064c40170c1ccd21c9 (patch)
tree642ff6e62798d53108a801ec5e55f693eb741aeb /llvm/lib/Transforms/Utils/LoopUtils.cpp
parent425ef999385058143bb927aefe81daddcd43f623 (diff)
downloadllvm-781d077afb0ed9771c513d064c40170c1ccd21c9.zip
llvm-781d077afb0ed9771c513d064c40170c1ccd21c9.tar.gz
llvm-781d077afb0ed9771c513d064c40170c1ccd21c9.tar.bz2
[InstCombine] reassociateShiftAmtsOfTwoSameDirectionShifts(): fix miscompile (PR44802)
As input, we have the following pattern: Sh0 (Sh1 X, Q), K We want to rewrite that as: Sh x, (Q+K) iff (Q+K) u< bitwidth(x) While we know that originally (Q+K) would not overflow (because 2 * (N-1) u<= iN -1), we may have looked past extensions of shift amounts. so it may now overflow in smaller bitwidth. To ensure that does not happen, we need to ensure that the total maximal shift amount is still representable in that smaller bitwidth. If the overflow would happen, (Q+K) u< bitwidth(x) check would be bogus. https://bugs.llvm.org/show_bug.cgi?id=44802
Diffstat (limited to 'llvm/lib/Transforms/Utils/LoopUtils.cpp')
0 files changed, 0 insertions, 0 deletions