From b4badb815ec844e438a05d501eafb6bb99383bc6 Mon Sep 17 00:00:00 2001 From: "Alon Zakai (kripken)" Date: Sun, 2 Dec 2018 08:22:33 -0800 Subject: Run coalesce-locals after the final simplify-locals. We now emit more sets and tees of if-elses from simplify-locals, and coalesce-locals is necessary to remove them if they are ineffectual, that is, if no get will read them. --- src/passes/pass.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/passes/pass.cpp b/src/passes/pass.cpp index e89fed83f..c42a3d144 100644 --- a/src/passes/pass.cpp +++ b/src/passes/pass.cpp @@ -180,8 +180,11 @@ void PassRunner::addDefaultFunctionOptimizationPasses() { } add("coalesce-locals"); add("simplify-locals"); - add("vacuum"); // previous pass creates garbage + add("vacuum"); + add("reorder-locals"); + add("coalesce-locals"); add("reorder-locals"); + add("vacuum"); if (options.optimizeLevel >= 3 || options.shrinkLevel >= 1) { add("code-folding"); } -- cgit v1.2.3