mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-15 23:31:37 +00:00
Localize a map, remove another
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5060 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
f0eb7beb66
commit
01b08c59b4
@ -49,15 +49,9 @@ namespace {
|
|||||||
// Maps SSA Regs => offsets on the stack where these values are stored
|
// Maps SSA Regs => offsets on the stack where these values are stored
|
||||||
std::map<unsigned, unsigned> VirtReg2OffsetMap;
|
std::map<unsigned, unsigned> VirtReg2OffsetMap;
|
||||||
|
|
||||||
// Maps SSA Regs => physical regs
|
|
||||||
std::map<unsigned, unsigned> SSA2PhysRegMap;
|
|
||||||
|
|
||||||
// Maps physical register to their register classes
|
// Maps physical register to their register classes
|
||||||
PhysRegClassMap PhysRegClasses;
|
PhysRegClassMap PhysRegClasses;
|
||||||
|
|
||||||
// Made to combat the incorrect allocation of r2 = add r1, r1
|
|
||||||
std::map<unsigned, unsigned> VirtReg2PhysRegMap;
|
|
||||||
|
|
||||||
// RegsUsed - Keep track of what registers are currently in use.
|
// RegsUsed - Keep track of what registers are currently in use.
|
||||||
std::set<unsigned> RegsUsed;
|
std::set<unsigned> RegsUsed;
|
||||||
|
|
||||||
@ -134,7 +128,6 @@ namespace {
|
|||||||
|
|
||||||
void cleanupAfterFunction() {
|
void cleanupAfterFunction() {
|
||||||
VirtReg2OffsetMap.clear();
|
VirtReg2OffsetMap.clear();
|
||||||
SSA2PhysRegMap.clear();
|
|
||||||
NumBytesAllocated = 4; // FIXME: This is X86 specific
|
NumBytesAllocated = 4; // FIXME: This is X86 specific
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -357,6 +350,9 @@ void RegAllocSimple::AllocateBasicBlock(MachineBasicBlock &MBB) {
|
|||||||
|
|
||||||
//loop over each basic block
|
//loop over each basic block
|
||||||
for (MachineBasicBlock::iterator I = MBB.begin(); I != MBB.end(); ++I) {
|
for (MachineBasicBlock::iterator I = MBB.begin(); I != MBB.end(); ++I) {
|
||||||
|
// Made to combat the incorrect allocation of r2 = add r1, r1
|
||||||
|
std::map<unsigned, unsigned> VirtReg2PhysRegMap;
|
||||||
|
|
||||||
MachineInstr *MI = *I;
|
MachineInstr *MI = *I;
|
||||||
|
|
||||||
// a preliminary pass that will invalidate any registers that
|
// a preliminary pass that will invalidate any registers that
|
||||||
@ -406,9 +402,7 @@ void RegAllocSimple::AllocateBasicBlock(MachineBasicBlock &MBB) {
|
|||||||
", phys: " << op.getAllocatedRegNum() << "\n");
|
", phys: " << op.getAllocatedRegNum() << "\n");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
clearAllRegs();
|
clearAllRegs();
|
||||||
VirtReg2PhysRegMap.clear();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user