From 8597c85a6066bb2f814f5ab821d307d415493c58 Mon Sep 17 00:00:00 2001 From: Alon Zakai Date: Sat, 16 Jul 2016 15:51:20 -0700 Subject: fix dce bug in non-parallel mode, which happens in debug mode, and add debug testing --- src/passes/DeadCodeElimination.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/passes/DeadCodeElimination.cpp b/src/passes/DeadCodeElimination.cpp index 9562b2973..de1191131 100644 --- a/src/passes/DeadCodeElimination.cpp +++ b/src/passes/DeadCodeElimination.cpp @@ -40,7 +40,12 @@ struct DeadCodeElimination : public WalkerPassbody); + } std::set reachableBreaks; -- cgit v1.2.3 From 07170478897c81aa973217ae8070d2d155d16b2e Mon Sep 17 00:00:00 2001 From: Alon Zakai Date: Sat, 16 Jul 2016 15:59:11 -0700 Subject: make sure to create instances of function-parallel functions, even in debug mode --- src/passes/pass.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/passes/pass.cpp b/src/passes/pass.cpp index e04033d90..f27eccf6a 100644 --- a/src/passes/pass.cpp +++ b/src/passes/pass.cpp @@ -149,7 +149,14 @@ void PassRunner::run() { std::cerr << ' '; } before = std::chrono::high_resolution_clock::now(); - pass->run(this, wasm); + if (pass->isFunctionParallel()) { + // function-parallel passes should get a new instance per function + for (auto& func : wasm->functions) { + runPassOnFunction(pass, func.get()); + } + } else { + pass->run(this, wasm); + } auto after = std::chrono::high_resolution_clock::now(); std::chrono::duration diff = after - before; std::cerr << diff.count() << " seconds." << std::endl; -- cgit v1.2.3