[llvm-commits] CVS: llvm/lib/Target/SparcV9/RegAlloc/PhyRegAlloc.cpp

Brian Gaeke gaeke at cs.uiuc.edu
Mon Mar 8 17:23:04 PST 2004


Changes in directory llvm/lib/Target/SparcV9/RegAlloc:

PhyRegAlloc.cpp updated: 1.139 -> 1.140

---
Log message:

Save argument list alloc state by recording it as the operands of Instruction
#-1. Other minor changes to deal with AllocInfo.Instruction becoming an int.


---
Diffs of the changes:  (+10 -2)

Index: llvm/lib/Target/SparcV9/RegAlloc/PhyRegAlloc.cpp
diff -u llvm/lib/Target/SparcV9/RegAlloc/PhyRegAlloc.cpp:1.139 llvm/lib/Target/SparcV9/RegAlloc/PhyRegAlloc.cpp:1.140
--- llvm/lib/Target/SparcV9/RegAlloc/PhyRegAlloc.cpp:1.139	Sun Feb 29 13:12:43 2004
+++ llvm/lib/Target/SparcV9/RegAlloc/PhyRegAlloc.cpp	Mon Mar  8 17:22:02 2004
@@ -1125,7 +1125,7 @@
 
 
 void PhyRegAlloc::saveStateForValue (std::vector<AllocInfo> &state,
-                                     const Value *V, unsigned Insn, int Opnd) {
+                                     const Value *V, int Insn, int Opnd) {
   LiveRangeMapType::const_iterator HMI = LRI->getLiveRangeMap ()->find (V); 
   LiveRangeMapType::const_iterator HMIEnd = LRI->getLiveRangeMap ()->end ();   
   AllocInfo::AllocStateTy AllocState = AllocInfo::NotAllocated; 
@@ -1155,7 +1155,15 @@
 ///
 void PhyRegAlloc::saveState () {
   std::vector<AllocInfo> &state = FnAllocState[Fn];
+  unsigned ArgNum = 0;
+  // Arguments encoded as instruction # -1
+  for (Function::const_aiterator i=Fn->abegin (), e=Fn->aend (); i != e; ++i) {
+    const Argument *Arg = &*i;
+    saveStateForValue (state, Arg, -1, ArgNum);
+    ++ArgNum;
+  }
   unsigned Insn = 0;
+  // Instructions themselves encoded as operand # -1
   for (const_inst_iterator II=inst_begin (Fn), IE=inst_end (Fn); II!=IE; ++II){
     saveStateForValue (state, (*II), Insn, -1);
     for (unsigned i = 0; i < (*II)->getNumOperands (); ++i) {
@@ -1176,7 +1184,7 @@
 ///
 void PhyRegAlloc::verifySavedState () {
   std::vector<AllocInfo> &state = FnAllocState[Fn];
-  unsigned Insn = 0;
+  int Insn = 0;
   for (const_inst_iterator II=inst_begin (Fn), IE=inst_end (Fn); II!=IE; ++II) {
     const Instruction *I = *II;
     MachineCodeForInstruction &Instrs = MachineCodeForInstruction::get (I);





More information about the llvm-commits mailing list