Commit message (Collapse) | Author | Age | Files | Lines | |
---|---|---|---|---|---|
* | [OptimizeForJS] Fix use of localized variable in popcnt(x) == 1 rule (#4057) | Max Graey | 2021-08-05 | 1 | -3/+1 |
| | | | | Localizer may have added a new tee and a local, and we should apply the tee in the right place. | ||||
* | [OptimizeForJS] Refactor rewritePopcntEqualOne (#4050) | Max Graey | 2021-08-03 | 1 | -26/+8 |
| | |||||
* | [JS] Add a new OptimizeForJS pass (#4033) | Max Graey | 2021-08-02 | 1 | -0/+92 |
Add a new OptimizeForJS pass which contains rewriting rules specific to JavaScript. LLVM usually lowers x != 0 && (x & (x - 1)) == 0 (isPowerOf2) to popcnt(x) == 1 which is ok for wasm and other targets but is quite expensive for JavaScript. In this PR we lower the popcnt pattern back to the isPowerOf2 pattern. |