Remove a copy of a bunch of code
authorChris Lattner <sabre@nondot.org>
Tue, 18 Sep 2001 18:15:40 +0000 (18:15 +0000)
committerChris Lattner <sabre@nondot.org>
Tue, 18 Sep 2001 18:15:40 +0000 (18:15 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@630 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/RegAlloc/PhyRegAloc.cpp
lib/Target/SparcV9/RegAlloc/PhyRegAloc.cpp

index e0bf4006fdd8e4deeada30094de808b1e4bd8da7..32dec6329c6d83f5aeba756e00d6af7ea2580582 100644 (file)
@@ -435,116 +435,3 @@ void PhyRegAlloc::allocateRegisters()
   printMachineCode();                   // only for DEBUGGING
 }
 
-
-
-
-#if 0
-
-void PhyRegAlloc::printMachineCode()
-{
-
-  cout << endl << ";************** Method ";
-  cout << Meth->getName() << " *****************" << endl;
-
-  Method::const_iterator BBI = Meth->begin();  // random iterator for BBs   
-
-  for( ; BBI != Meth->end(); ++BBI) {          // traverse BBs in random order
-
-    cout << endl ; printLabel( *BBI); cout << ": ";
-
-    // get the iterator for machine instructions
-    MachineCodeForBasicBlock& MIVec = (*BBI)->getMachineInstrVec();
-    MachineCodeForBasicBlock::iterator MInstIterator = MIVec.begin();
-
-    // iterate over all the machine instructions in BB
-    for( ; MInstIterator != MIVec.end(); ++MInstIterator) {  
-      
-      MachineInstr *const MInst = *MInstIterator; 
-
-
-      cout << endl << "\t";
-      cout << TargetInstrDescriptors[MInst->getOpCode()].opCodeString;
-      
-
-      //for(MachineInstr::val_op_const_iterator OpI(MInst);!OpI.done();++OpI) {
-
-      for(unsigned OpNum=0; OpNum < MInst->getNumOperands(); ++OpNum) {
-
-       MachineOperand& Op = MInst->getOperand(OpNum);
-
-       if( Op.getOperandType() ==  MachineOperand::MO_VirtualRegister || 
-           Op.getOperandType() ==  MachineOperand::MO_CCRegister) {
-
-         const Value *const Val =  Op.getVRegValue();
-
-         if( !Val ) { 
-           cout << "\t<*NULL Value*>";
-           continue;
-         }
-         assert( Val && "Value is NULL");
-
-         const LiveRange *const LR = LRI.getLiveRangeForValue(Val);
-
-         if ( !LR ) {
-
-           
-           if( ! ( (Val->getType())->isLabelType() || 
-                   (Val->getValueType() == Value::ConstantVal) ) ) {
-             cout <<  "\t" << "<*No LiveRange for: ";
-             printValue( Val); cout << "*>";
-           }
-
-
-           //assert( LR && "No LR found for Value");
-           continue;
-         }
-       
-         unsigned RCID = (LR->getRegClass())->getID();
-
-         //cout << "Setting reg for value: "; printValue( Val );
-         //cout << endl;
-
-         Op.setRegForValue( MRI.getUnifiedRegNum(RCID, LR->getColor()) );
-
-         int RegNum = MRI.getUnifiedRegNum(RCID, LR->getColor());
-
-         cout << "\t" << "%" << MRI.getUnifiedRegName( RegNum );
-
-       }
-       else if( Op.getOperandType() ==  MachineOperand:: MO_MachineRegister) {
-         cout << "\t" << "%"<< MRI.getUnifiedRegName( Op.getMachineRegNum() );
-       }
-       else if( Op.getOperandType() ==  MachineOperand::MO_PCRelativeDisp ) {
-         const Value *const Val = Op.getVRegValue () ;
-         if( !Val ) {
-           cout << "\t<*NULL Value*>";
-           continue;
-         }
-         if( (Val->getValueType() == Value::BasicBlockVal))
-           { cout << "\t"; printLabel( Op.getVRegValue () ); }
-         else { cout << "\t"; printValue( Val ); }
-       }
-
-       else 
-         cout << "\t" << Op;      // use dump field
-
-      }
-
-    }
-
-    cout << endl;
-
-  }
-
-  cout << endl;
-}
-
-void PhyRegAlloc::printLabel(const Value *const Val)
-{
-  if( Val->hasName() )
-    cout  << Val->getName();
-  else
-    cout << "Label" <<  Val;
-}
-
-#endif
index e0bf4006fdd8e4deeada30094de808b1e4bd8da7..32dec6329c6d83f5aeba756e00d6af7ea2580582 100644 (file)
@@ -435,116 +435,3 @@ void PhyRegAlloc::allocateRegisters()
   printMachineCode();                   // only for DEBUGGING
 }
 
-
-
-
-#if 0
-
-void PhyRegAlloc::printMachineCode()
-{
-
-  cout << endl << ";************** Method ";
-  cout << Meth->getName() << " *****************" << endl;
-
-  Method::const_iterator BBI = Meth->begin();  // random iterator for BBs   
-
-  for( ; BBI != Meth->end(); ++BBI) {          // traverse BBs in random order
-
-    cout << endl ; printLabel( *BBI); cout << ": ";
-
-    // get the iterator for machine instructions
-    MachineCodeForBasicBlock& MIVec = (*BBI)->getMachineInstrVec();
-    MachineCodeForBasicBlock::iterator MInstIterator = MIVec.begin();
-
-    // iterate over all the machine instructions in BB
-    for( ; MInstIterator != MIVec.end(); ++MInstIterator) {  
-      
-      MachineInstr *const MInst = *MInstIterator; 
-
-
-      cout << endl << "\t";
-      cout << TargetInstrDescriptors[MInst->getOpCode()].opCodeString;
-      
-
-      //for(MachineInstr::val_op_const_iterator OpI(MInst);!OpI.done();++OpI) {
-
-      for(unsigned OpNum=0; OpNum < MInst->getNumOperands(); ++OpNum) {
-
-       MachineOperand& Op = MInst->getOperand(OpNum);
-
-       if( Op.getOperandType() ==  MachineOperand::MO_VirtualRegister || 
-           Op.getOperandType() ==  MachineOperand::MO_CCRegister) {
-
-         const Value *const Val =  Op.getVRegValue();
-
-         if( !Val ) { 
-           cout << "\t<*NULL Value*>";
-           continue;
-         }
-         assert( Val && "Value is NULL");
-
-         const LiveRange *const LR = LRI.getLiveRangeForValue(Val);
-
-         if ( !LR ) {
-
-           
-           if( ! ( (Val->getType())->isLabelType() || 
-                   (Val->getValueType() == Value::ConstantVal) ) ) {
-             cout <<  "\t" << "<*No LiveRange for: ";
-             printValue( Val); cout << "*>";
-           }
-
-
-           //assert( LR && "No LR found for Value");
-           continue;
-         }
-       
-         unsigned RCID = (LR->getRegClass())->getID();
-
-         //cout << "Setting reg for value: "; printValue( Val );
-         //cout << endl;
-
-         Op.setRegForValue( MRI.getUnifiedRegNum(RCID, LR->getColor()) );
-
-         int RegNum = MRI.getUnifiedRegNum(RCID, LR->getColor());
-
-         cout << "\t" << "%" << MRI.getUnifiedRegName( RegNum );
-
-       }
-       else if( Op.getOperandType() ==  MachineOperand:: MO_MachineRegister) {
-         cout << "\t" << "%"<< MRI.getUnifiedRegName( Op.getMachineRegNum() );
-       }
-       else if( Op.getOperandType() ==  MachineOperand::MO_PCRelativeDisp ) {
-         const Value *const Val = Op.getVRegValue () ;
-         if( !Val ) {
-           cout << "\t<*NULL Value*>";
-           continue;
-         }
-         if( (Val->getValueType() == Value::BasicBlockVal))
-           { cout << "\t"; printLabel( Op.getVRegValue () ); }
-         else { cout << "\t"; printValue( Val ); }
-       }
-
-       else 
-         cout << "\t" << Op;      // use dump field
-
-      }
-
-    }
-
-    cout << endl;
-
-  }
-
-  cout << endl;
-}
-
-void PhyRegAlloc::printLabel(const Value *const Val)
-{
-  if( Val->hasName() )
-    cout  << Val->getName();
-  else
-    cout << "Label" <<  Val;
-}
-
-#endif