summaryrefslogtreecommitdiff
path: root/src/wasm/literal.cpp
diff options
context:
space:
mode:
authorAlon Zakai (kripken) <alonzakai@gmail.com>2018-12-01 18:28:52 -0800
committerAlon Zakai <alonzakai@gmail.com>2018-12-04 10:14:29 -0800
commite6048c1dabde9e511d25c8bd6d2da68461807f74 (patch)
tree08f5d4d4fbf5586f602bcab90a72aa288ec72ad1 /src/wasm/literal.cpp
parent774768375dbe8cdee91b797f1e8deec586085fb4 (diff)
downloadbinaryen-e6048c1dabde9e511d25c8bd6d2da68461807f74.tar.gz
binaryen-e6048c1dabde9e511d25c8bd6d2da68461807f74.tar.bz2
binaryen-e6048c1dabde9e511d25c8bd6d2da68461807f74.zip
Speculate in simplify-locals that it is worth turning an if into
an if-else. If an if sets a local, (if (..condition..) (set_local $x (..value..)) ) we can turn it into (set_local $x (if (..condition..) (..value..) (get_local $x) ) ) This increases code size and adds a branch in the if, but allows the set to be optimized into a tee or optimized out entirely. In the worst case, other optimizations can break up an if with a copy in one of its arms later. Includes a determinism fix for EquivalentSets, which this patch triggered.
Diffstat (limited to 'src/wasm/literal.cpp')
0 files changed, 0 insertions, 0 deletions