Skip to content

Commit ba4e9c1

Browse files
#53 Move method
1 parent 266d017 commit ba4e9c1

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

optvm/src/main/java/com/compilerprogramming/ezlang/compiler/CompiledFunction.java

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -965,15 +965,6 @@ private Register addPhiOperands(Register variable, Instruction.Phi phi) {
965965
return tryRemovingPhi(phi);
966966
}
967967

968-
// The Phi's def was replaced
969-
// We must also replace all occurrences of the phi def from the memoized defs
970-
// per Basic Block
971-
private void replaceDefs(Register oldValue, Register newValue) {
972-
var defs = currentDef.get(oldValue.nonSSAId());
973-
for (var bb: defs.keySet())
974-
defs.replace(bb, oldValue, newValue);
975-
}
976-
977968
// reference implementation https://github.com/dibyendumajumdar/libfirm/blob/master/ir/ir/ircons.c#L97
978969
private Register tryRemovingPhi(Instruction.Phi phi) {
979970
Register same = null;
@@ -1051,6 +1042,15 @@ private List<Instruction> getUsesExcept(Instruction.Phi phi) {
10511042
return useList;
10521043
}
10531044

1045+
// The Phi's def was replaced
1046+
// We must also replace all occurrences of the phi def from the memoized defs
1047+
// per Basic Block
1048+
private void replaceDefs(Register oldValue, Register newValue) {
1049+
var defs = currentDef.get(oldValue.nonSSAId());
1050+
for (var bb: defs.keySet())
1051+
defs.replace(bb, oldValue, newValue);
1052+
}
1053+
10541054
@Override
10551055
public Operand read(Operand operand) {
10561056
// We have to consider temps too because of boolean expressions

0 commit comments

Comments
 (0)