mirror of
https://github.com/RPCS3/llvm.git
synced 2025-01-21 01:06:46 +00:00
Reuse live interval union between functions. This saves a bit of compile time
when compiling many small functions. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129321 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
de16508955
commit
560ab9ebf7
@ -95,6 +95,9 @@ public:
|
||||
// Remove a live virtual register's segments from this union.
|
||||
void extract(LiveInterval &VirtReg);
|
||||
|
||||
// Remove all inserted virtual registers.
|
||||
void clear() { Segments.clear(); ++Tag; }
|
||||
|
||||
// Print union, using TRI to translate register names
|
||||
void print(raw_ostream &OS, const TargetRegisterInfo *TRI) const;
|
||||
|
||||
|
@ -235,9 +235,12 @@ void RegAllocBase::init(VirtRegMap &vrm, LiveIntervals &lis) {
|
||||
MRI = &vrm.getRegInfo();
|
||||
VRM = &vrm;
|
||||
LIS = &lis;
|
||||
PhysReg2LiveUnion.init(UnionAllocator, TRI->getNumRegs());
|
||||
// Cache an interferece query for each physical reg
|
||||
Queries.reset(new LiveIntervalUnion::Query[PhysReg2LiveUnion.numRegs()]);
|
||||
const unsigned NumRegs = TRI->getNumRegs();
|
||||
if (NumRegs != PhysReg2LiveUnion.numRegs()) {
|
||||
PhysReg2LiveUnion.init(UnionAllocator, NumRegs);
|
||||
// Cache an interferece query for each physical reg
|
||||
Queries.reset(new LiveIntervalUnion::Query[PhysReg2LiveUnion.numRegs()]);
|
||||
}
|
||||
}
|
||||
|
||||
void RegAllocBase::LiveUnionArray::clear() {
|
||||
@ -251,7 +254,8 @@ void RegAllocBase::LiveUnionArray::clear() {
|
||||
}
|
||||
|
||||
void RegAllocBase::releaseMemory() {
|
||||
PhysReg2LiveUnion.clear();
|
||||
for (unsigned r = 0, e = PhysReg2LiveUnion.numRegs(); r != e; ++r)
|
||||
PhysReg2LiveUnion[r].clear();
|
||||
}
|
||||
|
||||
// Visit all the live registers. If they are already assigned to a physical
|
||||
|
Loading…
x
Reference in New Issue
Block a user