summaryrefslogtreecommitdiff
path: root/src/wasm2js.h
diff options
context:
space:
mode:
authorAlon Zakai <azakai@google.com>2019-05-01 10:43:01 -0700
committerGitHub <noreply@github.com>2019-05-01 10:43:01 -0700
commit73709b4da08d285c2237c8c23a54ba53274c0c7f (patch)
tree2f428e5367c511b22391a8c471edbc0e7ed0688a /src/wasm2js.h
parentac93469d7fde75397403db94d9bf0c1bac0cf60f (diff)
downloadbinaryen-73709b4da08d285c2237c8c23a54ba53274c0c7f.tar.gz
binaryen-73709b4da08d285c2237c8c23a54ba53274c0c7f.tar.bz2
binaryen-73709b4da08d285c2237c8c23a54ba53274c0c7f.zip
wasm2js: run more optimizations (#2073)
In particular, coalesce-locals is useful even if closure is run later (apparently it finds stuff closure can't).
Diffstat (limited to 'src/wasm2js.h')
-rw-r--r--src/wasm2js.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/wasm2js.h b/src/wasm2js.h
index 18175d443..385f8877e 100644
--- a/src/wasm2js.h
+++ b/src/wasm2js.h
@@ -291,10 +291,11 @@ Ref Wasm2JSBuilder::processWasm(Module* wasm, Name funcName) {
// Finally, get the code into the flat form we need for wasm2js itself, and
// optimize that a little in a way that keeps flat property.
runner.add("flatten");
+ runner.add("remove-unused-names");
+ runner.add("merge-blocks");
runner.add("simplify-locals-notee-nostructure");
- // TODO: coalesce-locals?
+ runner.add("coalesce-locals");
runner.add("reorder-locals");
- runner.add("remove-unused-names");
runner.add("vacuum");
runner.add("remove-unused-module-elements");
runner.setDebug(flags.debug);