summaryrefslogtreecommitdiff
path: root/auto_update_tests.py
diff options
context:
space:
mode:
authorMax Graey <maxgraey@gmail.com>2021-09-10 02:27:21 +0300
committerGitHub <noreply@github.com>2021-09-09 16:27:21 -0700
commit0bc719505457acc1a92894b3995ce233fb0cdb20 (patch)
treea544c18f49c7497b6b1919e45692a93ab0f124ff /auto_update_tests.py
parentd127f82d7dbe27a35e07a4f3a723fa7b6811c756 (diff)
downloadbinaryen-0bc719505457acc1a92894b3995ce233fb0cdb20.tar.gz
binaryen-0bc719505457acc1a92894b3995ce233fb0cdb20.tar.bz2
binaryen-0bc719505457acc1a92894b3995ce233fb0cdb20.zip
[OptimizeInstructions] propagate sign for integer multiplication (#4098)
```ts -x * -y => (x * y) -x * y => -(x * y) x * -y => -(x * y), if x != C && y != C -x * C => x * -C, if C != C_pot || shrinkLevel != 0 -x * C => -(x * C), otherwise ``` We are skipping propagation when lhs and rhs are constants because this should handled by constant folding. Also skip cases like `-x * 4 -> x * -4` for `shrinkLevel != 0`, as this will be further converted to `-(x << 2)`.
Diffstat (limited to 'auto_update_tests.py')
0 files changed, 0 insertions, 0 deletions