summaryrefslogtreecommitdiff
path: root/src/passes/pass.cpp
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2017-09-12 11:28:18 -0700
committerGitHub <noreply@github.com>2017-09-12 11:28:18 -0700
commit6977feb0f371c31f35ab8b1304c97dc3ac155d92 (patch)
tree906215a5d915a49ff8a3e96e86f16ed26bf6c117 /src/passes/pass.cpp
parent72f72c8b4a005bbd728d7246f87b9d347c2a775f (diff)
downloadbinaryen-6977feb0f371c31f35ab8b1304c97dc3ac155d92.tar.gz
binaryen-6977feb0f371c31f35ab8b1304c97dc3ac155d92.tar.bz2
binaryen-6977feb0f371c31f35ab8b1304c97dc3ac155d92.zip
Const hoisting (#1176)
A pass that hoists repeating constants to a local, and replaces their uses with a get of that local. This can reduce binary size, but can also *increase* gzip size, so it's mostly for experimentation and not used by default.
Diffstat (limited to 'src/passes/pass.cpp')
-rw-r--r--src/passes/pass.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/passes/pass.cpp b/src/passes/pass.cpp
index 728fe2371..4ec454a50 100644
--- a/src/passes/pass.cpp
+++ b/src/passes/pass.cpp
@@ -68,6 +68,7 @@ void PassRegistry::registerPasses() {
registerPass("coalesce-locals-learning", "reduce # of locals by coalescing and learning", createCoalesceLocalsWithLearningPass);
registerPass("code-pushing", "push code forward, potentially making it not always execute", createCodePushingPass);
registerPass("code-folding", "fold code, merging duplicates", createCodeFoldingPass);
+ registerPass("const-hoisting", "hoist repeated constants to a local", createConstHoistingPass);
registerPass("dce", "removes unreachable code", createDeadCodeEliminationPass);
registerPass("duplicate-function-elimination", "removes duplicate functions", createDuplicateFunctionEliminationPass);
registerPass("extract-function", "leaves just one function (useful for debugging)", createExtractFunctionPass);