summaryrefslogtreecommitdiff
path: root/src/passes/pass.cpp
diff options
context:
space:
mode:
authorAlon Zakai <azakai@google.com>2019-05-02 11:41:34 -0700
committerGitHub <noreply@github.com>2019-05-02 11:41:34 -0700
commit01a4bfdb5c28d54fd480d603cba2d35c943a0bf5 (patch)
tree0bdeeb9096c8c7dec33a990022f920ebadfbd252 /src/passes/pass.cpp
parent3b4d9013c6c2dd6cfa90e02e2307a758a0f91140 (diff)
downloadbinaryen-01a4bfdb5c28d54fd480d603cba2d35c943a0bf5.tar.gz
binaryen-01a4bfdb5c28d54fd480d603cba2d35c943a0bf5.tar.bz2
binaryen-01a4bfdb5c28d54fd480d603cba2d35c943a0bf5.zip
Add a pass to lower unaligned loads and stores (#2078)
This replaces the wasm2js code that lowered them to pessimistic (1-byte aligned) loads and stores. The new pass will do the optimal thing, keeping 2-byte alignment where possible. This is also nicer as a standalone pass, which has the simple property that after it runs all loads and stores are aligned, instead of some code scattered inside wasm2js.
Diffstat (limited to 'src/passes/pass.cpp')
-rw-r--r--src/passes/pass.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/passes/pass.cpp b/src/passes/pass.cpp
index 7cfb21dfe..e4fbc5343 100644
--- a/src/passes/pass.cpp
+++ b/src/passes/pass.cpp
@@ -69,6 +69,9 @@ std::string PassRegistry::getPassDescription(std::string name) {
void PassRegistry::registerPasses() {
registerPass(
"dae", "removes arguments to calls in an lto-like manner", createDAEPass);
+ registerPass("alignment-lowering",
+ "lower unaligned loads and stores to smaller aligned ones",
+ createAlignmentLoweringPass);
registerPass("dae-optimizing",
"removes arguments to calls in an lto-like manner, and "
"optimizes where we removed",