summaryrefslogtreecommitdiffstats
path: root/lib/CodeGen/RegAllocSimple.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2002-12-15 21:24:30 +0000
committerChris Lattner <sabre@nondot.org>2002-12-15 21:24:30 +0000
commit01b08c59b46b1aaea6fd1d9204ed4f60e5b048a7 (patch)
treea82be24e5a5c7c6a36e63fb8070ac2eb790a4340 /lib/CodeGen/RegAllocSimple.cpp
parentf0eb7beb66d7402ba7ef32466aa6d9a53c33da01 (diff)
downloadexternal_llvm-01b08c59b46b1aaea6fd1d9204ed4f60e5b048a7.zip
external_llvm-01b08c59b46b1aaea6fd1d9204ed4f60e5b048a7.tar.gz
external_llvm-01b08c59b46b1aaea6fd1d9204ed4f60e5b048a7.tar.bz2
Localize a map, remove another
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5060 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/RegAllocSimple.cpp')
-rw-r--r--lib/CodeGen/RegAllocSimple.cpp12
1 files changed, 3 insertions, 9 deletions
diff --git a/lib/CodeGen/RegAllocSimple.cpp b/lib/CodeGen/RegAllocSimple.cpp
index 73c193b..e1f10bf 100644
--- a/lib/CodeGen/RegAllocSimple.cpp
+++ b/lib/CodeGen/RegAllocSimple.cpp
@@ -49,15 +49,9 @@ namespace {
// Maps SSA Regs => offsets on the stack where these values are stored
std::map<unsigned, unsigned> VirtReg2OffsetMap;
- // Maps SSA Regs => physical regs
- std::map<unsigned, unsigned> SSA2PhysRegMap;
-
// Maps physical register to their register classes
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.
std::set<unsigned> RegsUsed;
@@ -134,7 +128,6 @@ namespace {
void cleanupAfterFunction() {
VirtReg2OffsetMap.clear();
- SSA2PhysRegMap.clear();
NumBytesAllocated = 4; // FIXME: This is X86 specific
}
@@ -357,6 +350,9 @@ void RegAllocSimple::AllocateBasicBlock(MachineBasicBlock &MBB) {
//loop over each basic block
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;
// a preliminary pass that will invalidate any registers that
@@ -406,9 +402,7 @@ void RegAllocSimple::AllocateBasicBlock(MachineBasicBlock &MBB) {
", phys: " << op.getAllocatedRegNum() << "\n");
}
}
-
clearAllRegs();
- VirtReg2PhysRegMap.clear();
}
}