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

Brian Gaeke gaeke at cs.uiuc.edu
Fri Aug 6 12:11:56 PDT 2004



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

PhyRegAlloc.cpp updated: 1.158 -> 1.159
PhyRegAlloc.h updated: 1.68 -> 1.69
---
Log message:

dumpSavedState has outlived its usefulness.


---
Diffs of the changes:  (+3 -47)

Index: llvm/lib/Target/SparcV9/RegAlloc/PhyRegAlloc.cpp
diff -u llvm/lib/Target/SparcV9/RegAlloc/PhyRegAlloc.cpp:1.158 llvm/lib/Target/SparcV9/RegAlloc/PhyRegAlloc.cpp:1.159
--- llvm/lib/Target/SparcV9/RegAlloc/PhyRegAlloc.cpp:1.158	Wed Aug  4 02:29:53 2004
+++ llvm/lib/Target/SparcV9/RegAlloc/PhyRegAlloc.cpp	Fri Aug  6 14:11:42 2004
@@ -1181,44 +1181,6 @@
 }
 
 
-/// Dump the saved state filled in by saveState() out to stderr. Only
-/// used when debugging.
-///
-void PhyRegAlloc::dumpSavedState () {
-  std::vector<AllocInfo> &state = FnAllocState[Fn];
-  int ArgNum = 0;
-  for (Function::const_aiterator i=Fn->abegin (), e=Fn->aend (); i != e; ++i) {
-    const Argument *Arg = &*i;
-    std::cerr << "Argument:  " << *Arg << "\n"
-              << "FnAllocState:\n";
-    for (unsigned i = 0; i < state.size (); ++i) {
-      AllocInfo &S = state[i];
-      if (S.Instruction == -1 && S.Operand == ArgNum)
-        std::cerr << "  " << S << "\n";
-    }
-    std::cerr << "----------\n";
-    ++ArgNum;
-  }
-  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);
-    std::cerr << "Instruction: " << *I
-              << "MachineCodeForInstruction:\n";
-    for (unsigned i = 0, n = Instrs.size (); i != n; ++i)
-      std::cerr << "  " << *Instrs[i];
-    std::cerr << "FnAllocState:\n";
-    for (unsigned i = 0; i < state.size (); ++i) {
-      AllocInfo &S = state[i];
-      if (Insn == S.Instruction)
-        std::cerr << "  " << S << "\n";
-    }
-    std::cerr << "----------\n";
-    ++Insn;
-  }
-}
-
-
 bool PhyRegAlloc::doFinalization (Module &M) { 
   if (SaveRegAllocState) finishSavingState (M);
   return false;
@@ -1377,20 +1339,15 @@
   colorIncomingArgs();
 
   // Save register allocation state for this function in a Constant.
-  if (SaveRegAllocState) {
+  if (SaveRegAllocState)
     saveState();
-  }
 
   // Now update the machine code with register names and add any additional
   // code inserted by the register allocator to the instruction stream.
   updateMachineCode(); 
 
-  if (SaveRegAllocState) {
-    if (DEBUG_RA) // Check our work.
-      dumpSavedState ();
-    if (!SaveStateToModule)
-      finishSavingState (const_cast<Module&> (*Fn->getParent ()));
-  }
+  if (SaveRegAllocState && !SaveStateToModule)
+    finishSavingState (const_cast<Module&> (*Fn->getParent ()));
 
   if (DEBUG_RA) {
     std::cerr << "\n**** Machine Code After Register Allocation:\n\n";


Index: llvm/lib/Target/SparcV9/RegAlloc/PhyRegAlloc.h
diff -u llvm/lib/Target/SparcV9/RegAlloc/PhyRegAlloc.h:1.68 llvm/lib/Target/SparcV9/RegAlloc/PhyRegAlloc.h:1.69
--- llvm/lib/Target/SparcV9/RegAlloc/PhyRegAlloc.h:1.68	Wed Jun  2 21:45:09 2004
+++ llvm/lib/Target/SparcV9/RegAlloc/PhyRegAlloc.h	Fri Aug  6 14:11:43 2004
@@ -128,7 +128,6 @@
   void saveStateForValue (std::vector<AllocInfo> &state,
                           const Value *V, int Insn, int Opnd);
   void saveState();
-  void dumpSavedState();
   void finishSavingState(Module &M);
 
   void setCallInterferences(const MachineInstr *MI, 






More information about the llvm-commits mailing list