File tree Expand file tree Collapse file tree 2 files changed +11
-5
lines changed Expand file tree Collapse file tree 2 files changed +11
-5
lines changed Original file line number Diff line number Diff line change @@ -97,7 +97,17 @@ void processInstructions(
9797 const MachineOperand Rhs = Instr.getOperand (1 );
9898 assert (Lhs.isReg () && " Is register." );
9999 assert (Rhs.isReg () && " Is register." );
100- SpillMap[Lhs.getReg ()] = Rhs.getReg ();
100+ if (SpillMap.count (Rhs.getReg ()) > 0 ) {
101+ // If the RHS has a mapping, apply the same mapping to the new register.
102+ // This means, that stack spills moved into one register and then into
103+ // another will continued to be tracked.
104+ SpillMap[Lhs.getReg ()] = SpillMap[Rhs.getReg ()];
105+ } else {
106+ SpillMap[Lhs.getReg ()] = Rhs.getReg ();
107+ }
108+ // YKFIXME: If the `mov` instruction has a killed-flag, remove the
109+ // register from the map.
110+
101111 // Reassigning a new value to Lhs means any mappings to Lhs are now void
102112 // and need to be removed.
103113 clearRhs (Lhs.getReg (), SpillMap);
Original file line number Diff line number Diff line change @@ -220,10 +220,6 @@ class YkControlPoint : public ModulePass {
220220 // Replace the call to the dummy control point.
221221 OldCtrlPointCall->eraseFromParent ();
222222
223- // Get the result of the control point call. If it returns true, that means
224- // the stopgap interpreter has interpreted a return so we need to return as
225- // well.
226-
227223 // Create the new exit block.
228224 BasicBlock *ExitBB = BasicBlock::Create (Context, " " , Caller);
229225 Builder.SetInsertPoint (ExitBB);
You can’t perform that action at this time.
0 commit comments