diff options
author | Alon Zakai <azakai@google.com> | 2021-04-20 08:21:42 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-04-20 08:21:42 -0700 |
commit | 02ae2661c9cb748d5479017a3db7bbd222e2daf5 (patch) | |
tree | 3446624c393b21ab349c654189fa2aa49d84cb87 /src/js/binaryen.js-post.js | |
parent | f180f6c11d2ddf9acc806333c0a452bb57f8acf9 (diff) | |
download | binaryen-02ae2661c9cb748d5479017a3db7bbd222e2daf5.tar.gz binaryen-02ae2661c9cb748d5479017a3db7bbd222e2daf5.tar.bz2 binaryen-02ae2661c9cb748d5479017a3db7bbd222e2daf5.zip |
Optimize if/select with one arm an EqZ and another a 0 or a 1 (#3822)
(select
(i32.eqz (X))
(i32.const 0|1)
(Y)
)
=>
(i32.eqz
(select
(X)
(i32.const 1|0)
(Y)
)
)
This is beneficial as the eqz may be folded into something on the outside. I
see this pattern in real-world code, both a GC benchmark (which is why I
noticed it) and it shrinks code size by tiny amounts on the emscripten
benchmark suite as well.
Diffstat (limited to 'src/js/binaryen.js-post.js')
0 files changed, 0 insertions, 0 deletions