From 73709b4da08d285c2237c8c23a54ba53274c0c7f Mon Sep 17 00:00:00 2001 From: Alon Zakai Date: Wed, 1 May 2019 10:43:01 -0700 Subject: wasm2js: run more optimizations (#2073) In particular, coalesce-locals is useful even if closure is run later (apparently it finds stuff closure can't). --- src/wasm2js.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src') 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); -- cgit v1.2.3