mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-09-24 23:28:41 +00:00
Store live intervals in an IndexedMap.
It is both smaller and faster than DenseMap. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@159029 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -76,11 +76,9 @@ LiveIntervals::~LiveIntervals() {
|
||||
|
||||
void LiveIntervals::releaseMemory() {
|
||||
// Free the live intervals themselves.
|
||||
for (DenseMap<unsigned, LiveInterval*>::iterator I = R2IMap.begin(),
|
||||
E = R2IMap.end(); I != E; ++I)
|
||||
delete I->second;
|
||||
|
||||
R2IMap.clear();
|
||||
for (unsigned i = 0, e = VirtRegIntervals.size(); i != e; ++i)
|
||||
delete VirtRegIntervals[TargetRegisterInfo::index2VirtReg(i)];
|
||||
VirtRegIntervals.clear();
|
||||
RegMaskSlots.clear();
|
||||
RegMaskBits.clear();
|
||||
RegMaskBlocks.clear();
|
||||
@@ -124,21 +122,17 @@ bool LiveIntervals::runOnMachineFunction(MachineFunction &fn) {
|
||||
void LiveIntervals::print(raw_ostream &OS, const Module* ) const {
|
||||
OS << "********** INTERVALS **********\n";
|
||||
|
||||
// Dump the physregs.
|
||||
for (unsigned Reg = 1, RegE = TRI->getNumRegs(); Reg != RegE; ++Reg)
|
||||
if (const LiveInterval *LI = R2IMap.lookup(Reg))
|
||||
OS << PrintReg(Reg, TRI) << '\t' << *LI << '\n';
|
||||
|
||||
// Dump the regunits.
|
||||
for (unsigned i = 0, e = RegUnitIntervals.size(); i != e; ++i)
|
||||
if (LiveInterval *LI = RegUnitIntervals[i])
|
||||
OS << PrintRegUnit(i, TRI) << " = " << *LI << '\n';
|
||||
|
||||
// Dump the virtregs.
|
||||
for (unsigned Reg = 0, RegE = MRI->getNumVirtRegs(); Reg != RegE; ++Reg)
|
||||
if (const LiveInterval *LI =
|
||||
R2IMap.lookup(TargetRegisterInfo::index2VirtReg(Reg)))
|
||||
OS << PrintReg(LI->reg) << '\t' << *LI << '\n';
|
||||
for (unsigned i = 0, e = MRI->getNumVirtRegs(); i != e; ++i) {
|
||||
unsigned Reg = TargetRegisterInfo::index2VirtReg(i);
|
||||
if (hasInterval(Reg))
|
||||
OS << PrintReg(Reg) << " = " << getInterval(Reg) << '\n';
|
||||
}
|
||||
|
||||
printInstrs(OS);
|
||||
}
|
||||
|
Reference in New Issue
Block a user