mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-25 13:24:46 +00:00
Always normalize spill weights, also for intervals created by spilling.
Moderate the weight given to very small intervals. The spill weight given to new intervals created when spilling was not normalized in the same way as the original spill weights calculated by CalcSpillWeights. That meant that restored registers would tend to hang around because they had a much higher spill weight that unspilled registers. This improves the runtime of a few tests by up to 10%, and there are no significant regressions. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96613 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -1562,6 +1562,12 @@ LiveIntervals::handleSpilledImpDefs(const LiveInterval &li, VirtRegMap &vrm,
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
LiveIntervals::normalizeSpillWeights(std::vector<LiveInterval*> &NewLIs) {
|
||||
for (unsigned i = 0, e = NewLIs.size(); i != e; ++i)
|
||||
normalizeSpillWeight(*NewLIs[i]);
|
||||
}
|
||||
|
||||
std::vector<LiveInterval*> LiveIntervals::
|
||||
addIntervalsForSpillsFast(const LiveInterval &li,
|
||||
const MachineLoopInfo *loopInfo,
|
||||
@@ -1739,6 +1745,7 @@ addIntervalsForSpills(const LiveInterval &li,
|
||||
}
|
||||
|
||||
handleSpilledImpDefs(li, vrm, rc, NewLIs);
|
||||
normalizeSpillWeights(NewLIs);
|
||||
return NewLIs;
|
||||
}
|
||||
|
||||
@@ -1814,6 +1821,7 @@ addIntervalsForSpills(const LiveInterval &li,
|
||||
// Insert spills / restores if we are splitting.
|
||||
if (!TrySplit) {
|
||||
handleSpilledImpDefs(li, vrm, rc, NewLIs);
|
||||
normalizeSpillWeights(NewLIs);
|
||||
return NewLIs;
|
||||
}
|
||||
|
||||
@@ -1973,6 +1981,7 @@ addIntervalsForSpills(const LiveInterval &li,
|
||||
}
|
||||
|
||||
handleSpilledImpDefs(li, vrm, rc, RetNewLIs);
|
||||
normalizeSpillWeights(RetNewLIs);
|
||||
return RetNewLIs;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user