Skip to content

Commit 52520e3

Browse files
committed
Restore LocalOptimizationPass
* While this doesn't do a while lot right now, it does opt some scenarios (some forms of multiple-assignment). * During refactorings and cleanup work between pre1 and pre2, we lost the code that actually ran it. Restoring it here.
1 parent c09c4e5 commit 52520e3

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

core/src/main/java/org/jruby/ir/passes/LocalOptimizationPass.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
import org.jruby.ir.instructions.ResultInstr;
88
import org.jruby.ir.operands.Operand;
99
import org.jruby.ir.operands.Variable;
10+
import org.jruby.ir.representations.BasicBlock;
1011

1112
import java.util.*;
1213

@@ -18,6 +19,10 @@ public String getLabel() {
1819

1920
@Override
2021
public Object execute(IRScope s, Object... data) {
22+
for (BasicBlock b: s.getCFG().getBasicBlocks()) {
23+
runLocalOptsOnInstrList(s, b.getInstrs().listIterator(), false);
24+
}
25+
2126
// SSS FIXME: What is this about?
2227
// Why 'Only after running local opts'? Figure out and document.
2328
//

0 commit comments

Comments
 (0)