Skip to content

Commit b4badb8

Browse files
committed
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.
1 parent f5b8221 commit b4badb8

19 files changed

+3435
-3619
lines changed

src/passes/pass.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,8 +180,11 @@ void PassRunner::addDefaultFunctionOptimizationPasses() {
180180
}
181181
add("coalesce-locals");
182182
add("simplify-locals");
183-
add("vacuum"); // previous pass creates garbage
183+
add("vacuum");
184+
add("reorder-locals");
185+
add("coalesce-locals");
184186
add("reorder-locals");
187+
add("vacuum");
185188
if (options.optimizeLevel >= 3 || options.shrinkLevel >= 1) {
186189
add("code-folding");
187190
}

0 commit comments

Comments
 (0)