mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-29 22:30:33 +00:00
Keep track of how many times a live range has been dequeued, and prioritize new ranges.
When a large live range is evicted, it will usually be split when it comes around again. By deferring evicted live ranges, the splitting happens at a time when the interference pattern is more realistic. This prevents repeated splitting and evictions. llvm-svn: 126282
This commit is contained in:
parent
18a19b665c
commit
17add01160
@ -74,6 +74,7 @@ class RAGreedy : public MachineFunctionPass, public RegAllocBase {
|
||||
std::auto_ptr<Spiller> SpillerInstance;
|
||||
std::auto_ptr<SplitAnalysis> SA;
|
||||
std::priority_queue<std::pair<unsigned, unsigned> > Queue;
|
||||
IndexedMap<unsigned, VirtReg2IndexFunctor> Generation;
|
||||
|
||||
// splitting state.
|
||||
|
||||
@ -186,6 +187,7 @@ void RAGreedy::getAnalysisUsage(AnalysisUsage &AU) const {
|
||||
|
||||
void RAGreedy::releaseMemory() {
|
||||
SpillerInstance.reset(0);
|
||||
Generation.clear();
|
||||
RegAllocBase::releaseMemory();
|
||||
}
|
||||
|
||||
@ -202,6 +204,11 @@ void RAGreedy::enqueue(LiveInterval *LI) {
|
||||
if (TargetRegisterInfo::isPhysicalRegister(Hint))
|
||||
Size |= (1u << 30);
|
||||
|
||||
// Boost ranges that we see for the first time.
|
||||
Generation.grow(Reg);
|
||||
if (++Generation[Reg] == 1)
|
||||
Size |= (1u << 31);
|
||||
|
||||
Queue.push(std::make_pair(Size, Reg));
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user