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(
97
97
const MachineOperand Rhs = Instr.getOperand (1 );
98
98
assert (Lhs.isReg () && " Is register." );
99
99
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
+
101
111
// Reassigning a new value to Lhs means any mappings to Lhs are now void
102
112
// and need to be removed.
103
113
clearRhs (Lhs.getReg (), SpillMap);
Original file line number Diff line number Diff line change @@ -220,10 +220,6 @@ class YkControlPoint : public ModulePass {
220
220
// Replace the call to the dummy control point.
221
221
OldCtrlPointCall->eraseFromParent ();
222
222
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
-
227
223
// Create the new exit block.
228
224
BasicBlock *ExitBB = BasicBlock::Create (Context, " " , Caller);
229
225
Builder.SetInsertPoint (ExitBB);
You can’t perform that action at this time.
0 commit comments