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.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126282
91177308-0d34-0410-b5e6-
96231b3b80d8
std::auto_ptr<Spiller> SpillerInstance;
std::auto_ptr<SplitAnalysis> SA;
std::priority_queue<std::pair<unsigned, unsigned> > Queue;
+ IndexedMap<unsigned, VirtReg2IndexFunctor> Generation;
// splitting state.
void RAGreedy::releaseMemory() {
SpillerInstance.reset(0);
+ Generation.clear();
RegAllocBase::releaseMemory();
}
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));
}