B3 IntRange analysis should know more about shifting
authorfpizlo@apple.com <fpizlo@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 28 Jan 2016 05:21:57 +0000 (05:21 +0000)
committerfpizlo@apple.com <fpizlo@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 28 Jan 2016 05:21:57 +0000 (05:21 +0000)
commit48bad4b8bdefca32c6b77d75be8fee968f278559
tree7b434f3b2da1a73743a48a80a9bef9fc198d3e46
parentc4d8c1f6964dad125b146dff664e2ee26f71477e
B3 IntRange analysis should know more about shifting
https://bugs.webkit.org/show_bug.cgi?id=153568

Reviewed by Benjamin Poulain.

This teaches the IntRange analysis that the result of a right shift is usually better than
the worst-case mask based on the shift amount. In fact, you can reach useful conclusions
from looking at the IntRange of the input. This helps because Octane/crypto does something
like:

    CheckMul((@x & $268435455) >> 14, @y >> 14, ...)

If you consider just the shifts, then this may overflow. But if you consider that @x is
first masked, then the IntRange coming out of the first shift is tight enough to prove that
the CheckMul cannot overflow.

* b3/B3ReduceStrength.cpp:
* b3/testb3.cpp:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@195728 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/b3/B3ReduceStrength.cpp
Source/JavaScriptCore/b3/testb3.cpp