From df19ebde22c48fba43f88c71c4870f53b8974f93 Mon Sep 17 00:00:00 2001 From: Alon Zakai Date: Tue, 10 Apr 2018 10:44:07 -0700 Subject: br_table optimizations (#1502) Inspired by #1501 * remove unneeded appearances of the default switch target (at the front or back of the list of targets) * optimize a switch with 0, 1 or 2 targets into an if or if-chain * optimize a br_if br pair when they have the same target Makes e.g. fastcomp libc++ 2% smaller. Noticeable improvements on other things like box2d etc. --- src/passes/pass.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'src/passes/pass.cpp') diff --git a/src/passes/pass.cpp b/src/passes/pass.cpp index be7365998..38a21fae8 100644 --- a/src/passes/pass.cpp +++ b/src/passes/pass.cpp @@ -197,6 +197,7 @@ static void dumpWast(Name name, Module* wasm) { // write out the wast static int counter = 0; auto fullName = std::string("byn-") + std::to_string(counter++) + "-" + name.str + ".wasm"; + Colors::disable(); ModuleWriter writer; writer.setBinary(false); // TODO: add an option for binary writer.write(*wasm, fullName); -- cgit v1.2.3