Shifts by an amount computed using BitAnd with a mask that subsumes the shift's own...
authorfpizlo@apple.com <fpizlo@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 26 Jan 2016 22:07:28 +0000 (22:07 +0000)
committerfpizlo@apple.com <fpizlo@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 26 Jan 2016 22:07:28 +0000 (22:07 +0000)
commit647c716f8eca57e199c899b721594ffb95f30858
treee1582ffafeeeb4fdbb170fd2c2c312da7c7d49a1
parent2fac859d05fab0d3ce6f404e92704fe652b58129
Shifts by an amount computed using BitAnd with a mask that subsumes the shift's own mask should be rewired around the BitAnd
https://bugs.webkit.org/show_bug.cgi?id=153505

Reviewed by Saam Barati.

Turn this: Shl(@x, BitAnd(@y, 63))
Into this: Shl(@x, @y)

It matters for Octane/crypto.

We should also stop FTL from generating such code, but even if we did that, we'd still want
this optimization in case user code did the BitAnd.

Also we can't stop the FTL from generating such code yet, because when targetting LLVM, you
must mask your shifts this way.

* b3/B3ReduceStrength.cpp:

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