From 01a4bfdb5c28d54fd480d603cba2d35c943a0bf5 Mon Sep 17 00:00:00 2001 From: Alon Zakai Date: Thu, 2 May 2019 11:41:34 -0700 Subject: 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. --- src/passes/pass.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/passes/pass.cpp') 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", -- cgit v1.2.3