diff options
Diffstat (limited to 'src/wasm2js.h')
-rw-r--r-- | src/wasm2js.h | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/wasm2js.h b/src/wasm2js.h index 731bf0a8c..e721d3d58 100644 --- a/src/wasm2js.h +++ b/src/wasm2js.h @@ -301,12 +301,14 @@ 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"); + // Regardless of optimization level, run some simple optimizations to undo + // some of the effects of flattening. runner.add("simplify-locals-notee-nostructure"); - // Coalescing is slow if we didn't run full optimizations earlier, so don't - // run it automatically. + // Some operations can be very slow if we didn't run full optimizations + // earlier, so don't run them automatically. if (options.optimizeLevel > 0) { + runner.add("remove-unused-names"); + runner.add("merge-blocks"); runner.add("coalesce-locals"); } runner.add("reorder-locals"); |