summaryrefslogtreecommitdiff
path: root/src/wasm-binary.h
diff options
context:
space:
mode:
authorAlon Zakai (kripken) <alonzakai@gmail.com>2018-12-01 10:51:15 -0800
committerAlon Zakai <alonzakai@gmail.com>2018-12-04 10:14:29 -0800
commit774768375dbe8cdee91b797f1e8deec586085fb4 (patch)
tree3fb13d47a0faff98e2e3fa343cf627e34dbb07f8 /src/wasm-binary.h
parent6b6e89d0c8feeead83d6d83fa94e17fc9f75e0f8 (diff)
downloadbinaryen-774768375dbe8cdee91b797f1e8deec586085fb4.tar.gz
binaryen-774768375dbe8cdee91b797f1e8deec586085fb4.tar.bz2
binaryen-774768375dbe8cdee91b797f1e8deec586085fb4.zip
Move if copy logic from coalesce-locals to remove-unused-brs.
If copies is the case where an if arm is a get that feeds into a set of the same local: (set_local $x (if (result i32) (..condition..) (..result) (get_local $x) ) ) We can rework this so that the if-else is only an if, which executes the code path not going to the get. This was done in coalesce-locals only because it is likely to work there as after coalescing there are more copies. However, the logic is of removing a branch, and so belongs in remove-unused-brs, and fits alongside existing logic there for handling ifs with an arm that is a br. Also refactor that code so that the two optimizations can feed into each other.
Diffstat (limited to 'src/wasm-binary.h')
0 files changed, 0 insertions, 0 deletions