diff options
author | Alon Zakai <azakai@google.com> | 2019-05-01 17:18:04 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-05-01 17:18:04 -0700 |
commit | af459403bc6e1bb99468ad05f351665143193082 (patch) | |
tree | fd6b0c2e0bd14822c3e3bb1e0f4a3b42c78bb56c /src/wasm2js.h | |
parent | 2bd3758a22131cfd6925b3fd995657b211095c90 (diff) | |
download | binaryen-af459403bc6e1bb99468ad05f351665143193082.tar.gz binaryen-af459403bc6e1bb99468ad05f351665143193082.tar.bz2 binaryen-af459403bc6e1bb99468ad05f351665143193082.zip |
wasm2js: don't run coalesce-locals if not optimizing (#2076)
That pass is very slow on unoptimized code (super-linear on the number of locals, which if unoptimized can be massive due to flatten).
Diffstat (limited to 'src/wasm2js.h')
-rw-r--r-- | src/wasm2js.h | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/wasm2js.h b/src/wasm2js.h index 4e5bebb4c..1a5050af4 100644 --- a/src/wasm2js.h +++ b/src/wasm2js.h @@ -295,7 +295,11 @@ Ref Wasm2JSBuilder::processWasm(Module* wasm, Name funcName) { runner.add("remove-unused-names"); runner.add("merge-blocks"); runner.add("simplify-locals-notee-nostructure"); - runner.add("coalesce-locals"); + // Coalescing is slow if we didn't run full optimizations earlier, so don't + // run it automatically. + if (options.optimizeLevel > 0) { + runner.add("coalesce-locals"); + } runner.add("reorder-locals"); runner.add("vacuum"); runner.add("remove-unused-module-elements"); |