summaryrefslogtreecommitdiff
path: root/src/passes/pass.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/passes/pass.cpp')
-rw-r--r--src/passes/pass.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/passes/pass.cpp b/src/passes/pass.cpp
index 7f8e09bbf..82a804eb5 100644
--- a/src/passes/pass.cpp
+++ b/src/passes/pass.cpp
@@ -135,6 +135,7 @@ void PassRegistry::registerPasses() {
registerPass("souperify-single-use", "emit Souper IR in text form (single-use nodes only)", createSouperifySingleUsePass);
registerPass("spill-pointers", "spill pointers to the C stack (useful for Boehm-style GC)", createSpillPointersPass);
registerPass("ssa", "ssa-ify variables so that they have a single assignment", createSSAifyPass);
+ registerPass("ssa-nomerge", "ssa-ify variables so that they have a single assignment, ignoring merges", createSSAifyNoMergePass);
registerPass("strip", "deprecated; same as strip-debug", createStripDebugPass);
registerPass("strip-debug", "strip debug info (including the names section)", createStripDebugPass);
registerPass("strip-producers", "strip the wasm producers section", createStripProducersPass);
@@ -153,6 +154,11 @@ void PassRunner::addDefaultOptimizationPasses() {
}
void PassRunner::addDefaultFunctionOptimizationPasses() {
+ // Untangling to semi-ssa form is helpful (but best to ignore merges
+ // so as to not introduce new copies).
+ if (options.optimizeLevel >= 3 || options.shrinkLevel >= 1) {
+ add("ssa-nomerge");
+ }
// if we are willing to work very very hard, flatten the IR and do opts
// that depend on flat IR
if (options.optimizeLevel >= 4) {