summaryrefslogtreecommitdiffstats
path: root/clang/lib
diff options
context:
space:
mode:
authorRoman Lebedev <lebedev.ri@gmail.com>2020-02-25 16:48:36 +0300
committerHans Wennborg <hans@chromium.org>2020-02-27 13:45:21 +0100
commitf115a88191c3dc80c5140fbbf63f74ca77fcc74b (patch)
tree704a2e042c4a886267a87fb21198260bb90ebe27 /clang/lib
parent77e448c0d3a87e7944381d7d53e55c997c8b936a (diff)
downloadbcm5719-llvm-f115a88191c3dc80c5140fbbf63f74ca77fcc74b.tar.gz
bcm5719-llvm-f115a88191c3dc80c5140fbbf63f74ca77fcc74b.zip
[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 (cherry picked from commit 781d077afb0ed9771c513d064c40170c1ccd21c9)
Diffstat (limited to 'clang/lib')
0 files changed, 0 insertions, 0 deletions
OpenPOWER on IntegriCloud