File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed
optvm/src/main/java/com/compilerprogramming/ezlang/compiler Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -105,14 +105,14 @@ private void removePhis() {
105105 var phis = block .phis ();
106106 if (phis .isEmpty ())
107107 continue ;
108- // Insert copy in predecessor
108+ // Insert copy in predecessor, since we are in CSSA, this is
109+ // a simple assignment from phi input to phi var
109110 for (var phi : phis ) {
110111 for (int j = 0 ; j < phi .numInputs (); j ++) {
111112 BasicBlock pred = block .predecessor (j );
112- var pCopyBEnd = getParallelCopyAtEnd (pred );
113113 var phiInput = phi .input (j );
114114 var phiVar = phi .value ();
115- pCopyBEnd . addCopy (phiInput ,new Operand .RegisterOperand (phiVar ));
115+ insertAtEnd ( pred , new Instruction . Move (phiInput ,new Operand .RegisterOperand (phiVar ) ));
116116 }
117117 }
118118 block .instructions .removeIf (instruction -> instruction instanceof Instruction .Phi );
You can’t perform that action at this time.
0 commit comments