Clean up MethodLiveVarInfo
authorChris Lattner <sabre@nondot.org>
Mon, 4 Feb 2002 20:49:04 +0000 (20:49 +0000)
committerChris Lattner <sabre@nondot.org>
Mon, 4 Feb 2002 20:49:04 +0000 (20:49 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1703 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/Analysis/LiveVar/FunctionLiveVarInfo.h
include/llvm/CodeGen/FunctionLiveVarInfo.h
lib/Analysis/LiveVar/FunctionLiveVarInfo.cpp
lib/Target/SparcV9/LiveVar/FunctionLiveVarInfo.cpp

index 9e44be4642a80b39a78bfd772a77d94b07755e2e..d126b6e03ef19b7b07cfd0afbc5fa0b162525e85 100644 (file)
@@ -72,9 +72,6 @@ static const int DEBUG_LV = 0;
 
 class MethodLiveVarInfo : public MethodPass {
 
-  // Live var anal is done on this method - set by constructor
-  const Method *Meth;   
-
   // A map betwn the BasicBlock and BBLiveVar
   BBToBBLiveVarMapType BB2BBLVMap;  
 
@@ -88,10 +85,10 @@ class MethodLiveVarInfo : public MethodPass {
   // --------- private methods -----------------------------------------
 
   // constructs BBLiveVars and init Def and In sets
-  void constructBBs();      
+  void constructBBs(const Method *M);      
     
   // do one backward pass over the CFG
-  bool  doSingleBackwardPass(); 
+  bool  doSingleBackwardPass(const Method *M); 
 
   // calculates live var sets for instructions in a BB
   void calcLiveVarSetsForBB(const BasicBlock *BB);
@@ -100,7 +97,7 @@ class MethodLiveVarInfo : public MethodPass {
 public:
   static AnalysisID ID;    // We are an analysis, we must have an ID
 
-  MethodLiveVarInfo(AnalysisID id = ID) : Meth(0) { assert(id == ID); }
+  MethodLiveVarInfo(AnalysisID id = ID) { assert(id == ID); }
   ~MethodLiveVarInfo() { releaseMemory(); }
 
   // --------- Implement the MethodPass interface ----------------------
index 9e44be4642a80b39a78bfd772a77d94b07755e2e..d126b6e03ef19b7b07cfd0afbc5fa0b162525e85 100644 (file)
@@ -72,9 +72,6 @@ static const int DEBUG_LV = 0;
 
 class MethodLiveVarInfo : public MethodPass {
 
-  // Live var anal is done on this method - set by constructor
-  const Method *Meth;   
-
   // A map betwn the BasicBlock and BBLiveVar
   BBToBBLiveVarMapType BB2BBLVMap;  
 
@@ -88,10 +85,10 @@ class MethodLiveVarInfo : public MethodPass {
   // --------- private methods -----------------------------------------
 
   // constructs BBLiveVars and init Def and In sets
-  void constructBBs();      
+  void constructBBs(const Method *M);      
     
   // do one backward pass over the CFG
-  bool  doSingleBackwardPass(); 
+  bool  doSingleBackwardPass(const Method *M); 
 
   // calculates live var sets for instructions in a BB
   void calcLiveVarSetsForBB(const BasicBlock *BB);
@@ -100,7 +97,7 @@ class MethodLiveVarInfo : public MethodPass {
 public:
   static AnalysisID ID;    // We are an analysis, we must have an ID
 
-  MethodLiveVarInfo(AnalysisID id = ID) : Meth(0) { assert(id == ID); }
+  MethodLiveVarInfo(AnalysisID id = ID) { assert(id == ID); }
   ~MethodLiveVarInfo() { releaseMemory(); }
 
   // --------- Implement the MethodPass interface ----------------------
index 54980d796030c17b237dfc7fdbbf82ab9586d93d..b43f7aaedd532b0b8524649b1d4d99dcaec1c11d 100644 (file)
 #include "llvm/BasicBlock.h"
 #include "Support/PostOrderIterator.h"
 #include <iostream>
-using std::cout;
-using std::endl;
+using std::cerr;
 
 AnalysisID MethodLiveVarInfo::ID(AnalysisID::create<MethodLiveVarInfo>());
 
-void MethodLiveVarInfo::releaseMemory() {
-  // First delete all BBLiveVar objects created in constructBBs(). A new object
-  // of type  BBLiveVa is created for every BasicBlock in the method
 
-  // hash map iterator for BB2BBLVMap
-  //
-  BBToBBLiveVarMapType::iterator HMI = BB2BBLVMap.begin(); 
-
-  for( ; HMI != BB2BBLVMap.end(); ++HMI)
-    delete HMI->second;                // delete all BBLiveVar in BB2BBLVMap
-
-  BB2BBLVMap.clear();
-
-  // Then delete all objects of type LiveVarSet created in calcLiveVarSetsForBB
-  // and entered into  MInst2LVSetBI and  MInst2LVSetAI (these are caches
-  // to return LiveVarSet's before/after a machine instruction quickly). It
-  // is sufficient to free up all LiveVarSet using only one cache since 
-  // both caches refer to the same sets
+//-----------------------------------------------------------------------------
+// Performs live var analysis for a method
+//-----------------------------------------------------------------------------
 
-  // hash map iterator for MInst2LVSetBI
-  //
-  MInstToLiveVarSetMapType::iterator MI = MInst2LVSetBI.begin(); 
+bool MethodLiveVarInfo::runOnMethod(Method *M) {
+  if (DEBUG_LV) cerr << "Analysing live variables ...\n";
 
-  for( ; MI != MInst2LVSetBI.end(); ++MI)
-    delete MI->second;           // delete all LiveVarSets in  MInst2LVSetBI
+  // create and initialize all the BBLiveVars of the CFG
+  constructBBs(M);
 
-  MInst2LVSetBI.clear();
-  MInst2LVSetAI.clear();
+  while (doSingleBackwardPass(M))
+    ; // Iterate until we are done.
+  
+  if (DEBUG_LV) cerr << "Live Variable Analysis complete!\n";
+  return false;
 }
 
 
@@ -54,27 +41,22 @@ void MethodLiveVarInfo::releaseMemory() {
 // constructs BBLiveVars and init Def and In sets
 //-----------------------------------------------------------------------------
 
-void MethodLiveVarInfo::constructBBs()   
-{
+void MethodLiveVarInfo::constructBBs(const Method *M) {
   unsigned int POId = 0;                // Reverse Depth-first Order ID
-
-  po_iterator<const Method*> BBI = po_begin(Meth);
-
-  for(  ; BBI != po_end(Meth) ; ++BBI, ++POId) 
-  { 
-
+  
+  for(po_iterator<const Method*> BBI = po_begin(M), BBE = po_end(M);
+      BBI != BBE; ++BBI, ++POId) { 
     const BasicBlock *BB = *BBI;        // get the current BB 
 
-    if(DEBUG_LV) { cout << " For BB "; printValue(BB); cout << ":" << endl; }
+    if (DEBUG_LV) { cerr << " For BB "; printValue(BB); cerr << ":\n"; }
 
-                                        // create a new BBLiveVar
-    BBLiveVar * LVBB = new BBLiveVar( BB, POId );  
-    
-    BB2BBLVMap[ BB ] = LVBB;            // insert the pair to Map
+    // create a new BBLiveVar
+    BBLiveVar *LVBB = new BBLiveVar(BB, POId);  
+    BB2BBLVMap[BB] = LVBB;              // insert the pair to Map
     
     LVBB->calcDefUseSets();             // calculates the def and in set
 
-    if(DEBUG_LV) 
+    if (DEBUG_LV) 
       LVBB->printAllSets();
   }
 
@@ -82,54 +64,38 @@ void MethodLiveVarInfo::constructBBs()
   // go over the random iterator and init those blocks as well.
   // However, LV info is not correct for those blocks (they are not
   // analyzed)
-
-  Method::const_iterator BBRI = Meth->begin();  // random iterator for BBs   
-
-  for( ; BBRI != Meth->end(); ++BBRI, ++POId) {     
-
-    if(   ! BB2BBLVMap[ *BBRI ] )
-      BB2BBLVMap[ *BBRI ] = new BBLiveVar( *BBRI, POId );
-
-  }
-
-
+  //
+  for (Method::const_iterator BBRI = M->begin(), BBRE = M->end();
+       BBRI != BBRE; ++BBRI, ++POId)
+    if (!BB2BBLVMap[*BBRI])   // Not yet processed?
+      BB2BBLVMap[*BBRI] = new BBLiveVar(*BBRI, POId);
 }
 
 
 //-----------------------------------------------------------------------------
 // do one backward pass over the CFG (for iterative analysis)
 //-----------------------------------------------------------------------------
-bool MethodLiveVarInfo::doSingleBackwardPass()  
-{
+bool MethodLiveVarInfo::doSingleBackwardPass(const Method *M) {
   bool ResultFlow, NeedAnotherIteration = false;
 
-  if(DEBUG_LV) 
-    cout << endl <<  " After Backward Pass ..." << endl;
+  if (DEBUG_LV) 
+    cerr << "\n After Backward Pass ...\n";
 
-  po_iterator<const Method*> BBI = po_begin(Meth);
+  po_iterator<const Method*> BBI = po_begin(M);
 
-  for( ; BBI != po_end(Meth) ; ++BBI) 
-  { 
+  for( ; BBI != po_end(M) ; ++BBI) { 
+    BBLiveVar *LVBB = BB2BBLVMap[*BBI];
+    assert(LVBB);
 
-    BBLiveVar* LVBB = BB2BBLVMap[*BBI];
-    assert( LVBB );
+    if (DEBUG_LV) cerr << " For BB " << (*BBI)->getName() << ":\n";
 
-    if(DEBUG_LV) cout << " For BB " << (*BBI)->getName() << ":"  << endl;
-    // cout << " (POId=" << LVBB->getPOId() << ")" << endl ;
-
-    ResultFlow = false;
-
-    if( LVBB->isOutSetChanged() ) 
+    if(LVBB->isOutSetChanged()) 
       LVBB->applyTransferFunc();        // apply the Tran Func to calc InSet
 
-    if( LVBB->isInSetChanged() )        // to calc Outsets of preds
-      ResultFlow = LVBB->applyFlowFunc(BB2BBLVMap); 
+    if (LVBB->isInSetChanged())        // to calc Outsets of preds
+      NeedAnotherIteration |= LVBB->applyFlowFunc(BB2BBLVMap); 
 
     if(DEBUG_LV) LVBB->printInOutSets();
-
-
-    if( ResultFlow ) NeedAnotherIteration = true;
-
   }
 
   // true if we need to reiterate over the CFG
@@ -137,32 +103,39 @@ bool MethodLiveVarInfo::doSingleBackwardPass()
 }
 
 
+void MethodLiveVarInfo::releaseMemory() {
+  // First delete all BBLiveVar objects created in constructBBs(). A new object
+  // of type  BBLiveVa is created for every BasicBlock in the method
 
+  // hash map iterator for BB2BBLVMap
+  //
+  BBToBBLiveVarMapType::iterator HMI = BB2BBLVMap.begin(); 
 
-//-----------------------------------------------------------------------------
-// performs live var anal for a method
-//-----------------------------------------------------------------------------
+  for( ; HMI != BB2BBLVMap.end(); ++HMI)
+    delete HMI->second;                // delete all BBLiveVar in BB2BBLVMap
 
-bool MethodLiveVarInfo::runOnMethod(Method *M) {
-  Meth = M;
+  BB2BBLVMap.clear();
 
-  if( DEBUG_LV) cout << "Analysing live variables ...\n";
+  // Then delete all objects of type LiveVarSet created in calcLiveVarSetsForBB
+  // and entered into  MInst2LVSetBI and  MInst2LVSetAI (these are caches
+  // to return LiveVarSet's before/after a machine instruction quickly). It
+  // is sufficient to free up all LiveVarSet using only one cache since 
+  // both caches refer to the same sets
 
-  // create and initialize all the BBLiveVars of the CFG
-  constructBBs();        
+  // hash map iterator for MInst2LVSetBI
+  //
+  MInstToLiveVarSetMapType::iterator MI = MInst2LVSetBI.begin(); 
 
-  bool NeedAnotherIteration = false;
-  do {                                // do one  pass over  CFG
-    NeedAnotherIteration = doSingleBackwardPass( );   
-  } while (NeedAnotherIteration );    // repeat until we need more iterations
+  for( ; MI != MInst2LVSetBI.end(); ++MI)
+    delete MI->second;           // delete all LiveVarSets in  MInst2LVSetBI
 
-  
-  if( DEBUG_LV) cout << "Live Variable Analysis complete!\n";
-  return false;
+  MInst2LVSetBI.clear();
+  MInst2LVSetAI.clear();
 }
 
 
 
+
 //-----------------------------------------------------------------------------
 /* Following functions will give the LiveVar info for any machine instr in
    a method. It should be called after a call to analyze().
@@ -178,23 +151,17 @@ bool MethodLiveVarInfo::runOnMethod(Method *M) {
 //-----------------------------------------------------------------------------
 // Gives live variable information before a machine instruction
 //-----------------------------------------------------------------------------
-const LiveVarSet * 
-MethodLiveVarInfo::getLiveVarSetBeforeMInst(const MachineInstr *const MInst,
-                                           const BasicBlock *const CurBB) 
-{
+const LiveVarSet *
+MethodLiveVarInfo::getLiveVarSetBeforeMInst(const MachineInstr *MInst,
+                                           const BasicBlock *CurBB) {
   const LiveVarSet *LVSet = MInst2LVSetBI[MInst];
 
-  if( LVSet  ) return LVSet;              // if found, just return the set
-  else { 
-    calcLiveVarSetsForBB( CurBB );        // else, calc for all instrs in BB
-
-    /*if(  ! MInst2LVSetBI[ MInst ] ) {
-      cerr << "\nFor BB "; printValue( CurBB);
-      cerr << "\nRequested LVSet for inst: " << *MInst;
-      }*/
-
-    assert( MInst2LVSetBI[ MInst ] );
-    return  MInst2LVSetBI[ MInst ];
+  if (LVSet) {
+    return LVSet;              // if found, just return the set
+  } else { 
+    calcLiveVarSetsForBB(CurBB);        // else, calc for all instrs in BB
+    assert(MInst2LVSetBI[MInst]);
+    return MInst2LVSetBI[MInst];
   }
 }
 
@@ -203,16 +170,16 @@ MethodLiveVarInfo::getLiveVarSetBeforeMInst(const MachineInstr *const MInst,
 // Gives live variable information after a machine instruction
 //-----------------------------------------------------------------------------
 const LiveVarSet * 
-MethodLiveVarInfo::getLiveVarSetAfterMInst(const MachineInstr *const MInst,
-                                           const BasicBlock *const CurBB) 
-{
+MethodLiveVarInfo::getLiveVarSetAfterMInst(const MachineInstr *MInst,
+                                           const BasicBlock *CurBB) {
   const LiveVarSet *LVSet = MInst2LVSetAI[MInst];
 
-  if( LVSet  ) return LVSet;              // if found, just return the set
-  else { 
-    calcLiveVarSetsForBB( CurBB );        // else, calc for all instrs in BB
-    assert( MInst2LVSetAI[ MInst ] );
-    return  MInst2LVSetAI[ MInst ];
+  if(LVSet) {
+    return LVSet;                       // if found, just return the set
+  } else { 
+    calcLiveVarSetsForBB(CurBB);        // else, calc for all instrs in BB
+    assert(MInst2LVSetAI[MInst]);
+    return MInst2LVSetAI[MInst];
   }
 }
 
index 54980d796030c17b237dfc7fdbbf82ab9586d93d..b43f7aaedd532b0b8524649b1d4d99dcaec1c11d 100644 (file)
 #include "llvm/BasicBlock.h"
 #include "Support/PostOrderIterator.h"
 #include <iostream>
-using std::cout;
-using std::endl;
+using std::cerr;
 
 AnalysisID MethodLiveVarInfo::ID(AnalysisID::create<MethodLiveVarInfo>());
 
-void MethodLiveVarInfo::releaseMemory() {
-  // First delete all BBLiveVar objects created in constructBBs(). A new object
-  // of type  BBLiveVa is created for every BasicBlock in the method
 
-  // hash map iterator for BB2BBLVMap
-  //
-  BBToBBLiveVarMapType::iterator HMI = BB2BBLVMap.begin(); 
-
-  for( ; HMI != BB2BBLVMap.end(); ++HMI)
-    delete HMI->second;                // delete all BBLiveVar in BB2BBLVMap
-
-  BB2BBLVMap.clear();
-
-  // Then delete all objects of type LiveVarSet created in calcLiveVarSetsForBB
-  // and entered into  MInst2LVSetBI and  MInst2LVSetAI (these are caches
-  // to return LiveVarSet's before/after a machine instruction quickly). It
-  // is sufficient to free up all LiveVarSet using only one cache since 
-  // both caches refer to the same sets
+//-----------------------------------------------------------------------------
+// Performs live var analysis for a method
+//-----------------------------------------------------------------------------
 
-  // hash map iterator for MInst2LVSetBI
-  //
-  MInstToLiveVarSetMapType::iterator MI = MInst2LVSetBI.begin(); 
+bool MethodLiveVarInfo::runOnMethod(Method *M) {
+  if (DEBUG_LV) cerr << "Analysing live variables ...\n";
 
-  for( ; MI != MInst2LVSetBI.end(); ++MI)
-    delete MI->second;           // delete all LiveVarSets in  MInst2LVSetBI
+  // create and initialize all the BBLiveVars of the CFG
+  constructBBs(M);
 
-  MInst2LVSetBI.clear();
-  MInst2LVSetAI.clear();
+  while (doSingleBackwardPass(M))
+    ; // Iterate until we are done.
+  
+  if (DEBUG_LV) cerr << "Live Variable Analysis complete!\n";
+  return false;
 }
 
 
@@ -54,27 +41,22 @@ void MethodLiveVarInfo::releaseMemory() {
 // constructs BBLiveVars and init Def and In sets
 //-----------------------------------------------------------------------------
 
-void MethodLiveVarInfo::constructBBs()   
-{
+void MethodLiveVarInfo::constructBBs(const Method *M) {
   unsigned int POId = 0;                // Reverse Depth-first Order ID
-
-  po_iterator<const Method*> BBI = po_begin(Meth);
-
-  for(  ; BBI != po_end(Meth) ; ++BBI, ++POId) 
-  { 
-
+  
+  for(po_iterator<const Method*> BBI = po_begin(M), BBE = po_end(M);
+      BBI != BBE; ++BBI, ++POId) { 
     const BasicBlock *BB = *BBI;        // get the current BB 
 
-    if(DEBUG_LV) { cout << " For BB "; printValue(BB); cout << ":" << endl; }
+    if (DEBUG_LV) { cerr << " For BB "; printValue(BB); cerr << ":\n"; }
 
-                                        // create a new BBLiveVar
-    BBLiveVar * LVBB = new BBLiveVar( BB, POId );  
-    
-    BB2BBLVMap[ BB ] = LVBB;            // insert the pair to Map
+    // create a new BBLiveVar
+    BBLiveVar *LVBB = new BBLiveVar(BB, POId);  
+    BB2BBLVMap[BB] = LVBB;              // insert the pair to Map
     
     LVBB->calcDefUseSets();             // calculates the def and in set
 
-    if(DEBUG_LV) 
+    if (DEBUG_LV) 
       LVBB->printAllSets();
   }
 
@@ -82,54 +64,38 @@ void MethodLiveVarInfo::constructBBs()
   // go over the random iterator and init those blocks as well.
   // However, LV info is not correct for those blocks (they are not
   // analyzed)
-
-  Method::const_iterator BBRI = Meth->begin();  // random iterator for BBs   
-
-  for( ; BBRI != Meth->end(); ++BBRI, ++POId) {     
-
-    if(   ! BB2BBLVMap[ *BBRI ] )
-      BB2BBLVMap[ *BBRI ] = new BBLiveVar( *BBRI, POId );
-
-  }
-
-
+  //
+  for (Method::const_iterator BBRI = M->begin(), BBRE = M->end();
+       BBRI != BBRE; ++BBRI, ++POId)
+    if (!BB2BBLVMap[*BBRI])   // Not yet processed?
+      BB2BBLVMap[*BBRI] = new BBLiveVar(*BBRI, POId);
 }
 
 
 //-----------------------------------------------------------------------------
 // do one backward pass over the CFG (for iterative analysis)
 //-----------------------------------------------------------------------------
-bool MethodLiveVarInfo::doSingleBackwardPass()  
-{
+bool MethodLiveVarInfo::doSingleBackwardPass(const Method *M) {
   bool ResultFlow, NeedAnotherIteration = false;
 
-  if(DEBUG_LV) 
-    cout << endl <<  " After Backward Pass ..." << endl;
+  if (DEBUG_LV) 
+    cerr << "\n After Backward Pass ...\n";
 
-  po_iterator<const Method*> BBI = po_begin(Meth);
+  po_iterator<const Method*> BBI = po_begin(M);
 
-  for( ; BBI != po_end(Meth) ; ++BBI) 
-  { 
+  for( ; BBI != po_end(M) ; ++BBI) { 
+    BBLiveVar *LVBB = BB2BBLVMap[*BBI];
+    assert(LVBB);
 
-    BBLiveVar* LVBB = BB2BBLVMap[*BBI];
-    assert( LVBB );
+    if (DEBUG_LV) cerr << " For BB " << (*BBI)->getName() << ":\n";
 
-    if(DEBUG_LV) cout << " For BB " << (*BBI)->getName() << ":"  << endl;
-    // cout << " (POId=" << LVBB->getPOId() << ")" << endl ;
-
-    ResultFlow = false;
-
-    if( LVBB->isOutSetChanged() ) 
+    if(LVBB->isOutSetChanged()) 
       LVBB->applyTransferFunc();        // apply the Tran Func to calc InSet
 
-    if( LVBB->isInSetChanged() )        // to calc Outsets of preds
-      ResultFlow = LVBB->applyFlowFunc(BB2BBLVMap); 
+    if (LVBB->isInSetChanged())        // to calc Outsets of preds
+      NeedAnotherIteration |= LVBB->applyFlowFunc(BB2BBLVMap); 
 
     if(DEBUG_LV) LVBB->printInOutSets();
-
-
-    if( ResultFlow ) NeedAnotherIteration = true;
-
   }
 
   // true if we need to reiterate over the CFG
@@ -137,32 +103,39 @@ bool MethodLiveVarInfo::doSingleBackwardPass()
 }
 
 
+void MethodLiveVarInfo::releaseMemory() {
+  // First delete all BBLiveVar objects created in constructBBs(). A new object
+  // of type  BBLiveVa is created for every BasicBlock in the method
 
+  // hash map iterator for BB2BBLVMap
+  //
+  BBToBBLiveVarMapType::iterator HMI = BB2BBLVMap.begin(); 
 
-//-----------------------------------------------------------------------------
-// performs live var anal for a method
-//-----------------------------------------------------------------------------
+  for( ; HMI != BB2BBLVMap.end(); ++HMI)
+    delete HMI->second;                // delete all BBLiveVar in BB2BBLVMap
 
-bool MethodLiveVarInfo::runOnMethod(Method *M) {
-  Meth = M;
+  BB2BBLVMap.clear();
 
-  if( DEBUG_LV) cout << "Analysing live variables ...\n";
+  // Then delete all objects of type LiveVarSet created in calcLiveVarSetsForBB
+  // and entered into  MInst2LVSetBI and  MInst2LVSetAI (these are caches
+  // to return LiveVarSet's before/after a machine instruction quickly). It
+  // is sufficient to free up all LiveVarSet using only one cache since 
+  // both caches refer to the same sets
 
-  // create and initialize all the BBLiveVars of the CFG
-  constructBBs();        
+  // hash map iterator for MInst2LVSetBI
+  //
+  MInstToLiveVarSetMapType::iterator MI = MInst2LVSetBI.begin(); 
 
-  bool NeedAnotherIteration = false;
-  do {                                // do one  pass over  CFG
-    NeedAnotherIteration = doSingleBackwardPass( );   
-  } while (NeedAnotherIteration );    // repeat until we need more iterations
+  for( ; MI != MInst2LVSetBI.end(); ++MI)
+    delete MI->second;           // delete all LiveVarSets in  MInst2LVSetBI
 
-  
-  if( DEBUG_LV) cout << "Live Variable Analysis complete!\n";
-  return false;
+  MInst2LVSetBI.clear();
+  MInst2LVSetAI.clear();
 }
 
 
 
+
 //-----------------------------------------------------------------------------
 /* Following functions will give the LiveVar info for any machine instr in
    a method. It should be called after a call to analyze().
@@ -178,23 +151,17 @@ bool MethodLiveVarInfo::runOnMethod(Method *M) {
 //-----------------------------------------------------------------------------
 // Gives live variable information before a machine instruction
 //-----------------------------------------------------------------------------
-const LiveVarSet * 
-MethodLiveVarInfo::getLiveVarSetBeforeMInst(const MachineInstr *const MInst,
-                                           const BasicBlock *const CurBB) 
-{
+const LiveVarSet *
+MethodLiveVarInfo::getLiveVarSetBeforeMInst(const MachineInstr *MInst,
+                                           const BasicBlock *CurBB) {
   const LiveVarSet *LVSet = MInst2LVSetBI[MInst];
 
-  if( LVSet  ) return LVSet;              // if found, just return the set
-  else { 
-    calcLiveVarSetsForBB( CurBB );        // else, calc for all instrs in BB
-
-    /*if(  ! MInst2LVSetBI[ MInst ] ) {
-      cerr << "\nFor BB "; printValue( CurBB);
-      cerr << "\nRequested LVSet for inst: " << *MInst;
-      }*/
-
-    assert( MInst2LVSetBI[ MInst ] );
-    return  MInst2LVSetBI[ MInst ];
+  if (LVSet) {
+    return LVSet;              // if found, just return the set
+  } else { 
+    calcLiveVarSetsForBB(CurBB);        // else, calc for all instrs in BB
+    assert(MInst2LVSetBI[MInst]);
+    return MInst2LVSetBI[MInst];
   }
 }
 
@@ -203,16 +170,16 @@ MethodLiveVarInfo::getLiveVarSetBeforeMInst(const MachineInstr *const MInst,
 // Gives live variable information after a machine instruction
 //-----------------------------------------------------------------------------
 const LiveVarSet * 
-MethodLiveVarInfo::getLiveVarSetAfterMInst(const MachineInstr *const MInst,
-                                           const BasicBlock *const CurBB) 
-{
+MethodLiveVarInfo::getLiveVarSetAfterMInst(const MachineInstr *MInst,
+                                           const BasicBlock *CurBB) {
   const LiveVarSet *LVSet = MInst2LVSetAI[MInst];
 
-  if( LVSet  ) return LVSet;              // if found, just return the set
-  else { 
-    calcLiveVarSetsForBB( CurBB );        // else, calc for all instrs in BB
-    assert( MInst2LVSetAI[ MInst ] );
-    return  MInst2LVSetAI[ MInst ];
+  if(LVSet) {
+    return LVSet;                       // if found, just return the set
+  } else { 
+    calcLiveVarSetsForBB(CurBB);        // else, calc for all instrs in BB
+    assert(MInst2LVSetAI[MInst]);
+    return MInst2LVSetAI[MInst];
   }
 }