[llvm-commits] CVS: llvm/lib/CodeGen/RegAllocSimple.cpp

Chris Lattner lattner at cs.uiuc.edu
Sun Dec 15 15:25:01 PST 2002


Changes in directory llvm/lib/CodeGen:

RegAllocSimple.cpp updated: 1.23 -> 1.24

---
Log message:

Localize a map, remove another


---
Diffs of the changes:

Index: llvm/lib/CodeGen/RegAllocSimple.cpp
diff -u llvm/lib/CodeGen/RegAllocSimple.cpp:1.23 llvm/lib/CodeGen/RegAllocSimple.cpp:1.24
--- llvm/lib/CodeGen/RegAllocSimple.cpp:1.23	Sun Dec 15 15:13:12 2002
+++ llvm/lib/CodeGen/RegAllocSimple.cpp	Sun Dec 15 15:24:30 2002
@@ -49,15 +49,9 @@
     // 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 @@
 
     void cleanupAfterFunction() {
       VirtReg2OffsetMap.clear();
-      SSA2PhysRegMap.clear();
       NumBytesAllocated = 4;   // FIXME: This is X86 specific
     }
 
@@ -357,6 +350,9 @@
   
   //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 @@
               ", phys: " << op.getAllocatedRegNum() << "\n");
       }
     }
-    
     clearAllRegs();
-    VirtReg2PhysRegMap.clear();
   }
 }
 





More information about the llvm-commits mailing list