From 4c3aaa4adb12aa140742eaa1f9e79c2bebf14596 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Wed, 19 Sep 2001 16:09:04 +0000 Subject: [PATCH] * REMOVE extraneous debug info if DEBUG_RA is not set * Spell PhyRegAlloc right. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@645 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/CodeGen/RegAlloc/LiveRangeInfo.cpp | 2 +- .../RegAlloc/{PhyRegAloc.cpp => PhyRegAlloc.cpp} | 10 ++++++---- lib/Target/SparcV9/RegAlloc/LiveRangeInfo.cpp | 2 +- .../RegAlloc/{PhyRegAloc.cpp => PhyRegAlloc.cpp} | 10 ++++++---- 4 files changed, 14 insertions(+), 10 deletions(-) rename lib/CodeGen/RegAlloc/{PhyRegAloc.cpp => PhyRegAlloc.cpp} (98%) rename lib/Target/SparcV9/RegAlloc/{PhyRegAloc.cpp => PhyRegAlloc.cpp} (98%) diff --git a/lib/CodeGen/RegAlloc/LiveRangeInfo.cpp b/lib/CodeGen/RegAlloc/LiveRangeInfo.cpp index 17139e43b74..658f3d276e2 100644 --- a/lib/CodeGen/RegAlloc/LiveRangeInfo.cpp +++ b/lib/CodeGen/RegAlloc/LiveRangeInfo.cpp @@ -96,7 +96,7 @@ void LiveRangeInfo::constructLiveRanges() MachineOperand::MachineOperandType OpTyp = OpI.getMachineOperand().getOperandType(); - if ( OpTyp == MachineOperand::MO_CCRegister) { + if (DEBUG_RA && OpTyp == MachineOperand::MO_CCRegister) { cout << "\n**CC reg found. Is Def=" << OpI.isDef() << " Val:"; printValue( OpI.getMachineOperand().getVRegValue() ); cout << endl; diff --git a/lib/CodeGen/RegAlloc/PhyRegAloc.cpp b/lib/CodeGen/RegAlloc/PhyRegAlloc.cpp similarity index 98% rename from lib/CodeGen/RegAlloc/PhyRegAloc.cpp rename to lib/CodeGen/RegAlloc/PhyRegAlloc.cpp index 7237effe68d..8824b64661c 100644 --- a/lib/CodeGen/RegAlloc/PhyRegAloc.cpp +++ b/lib/CodeGen/RegAlloc/PhyRegAlloc.cpp @@ -267,7 +267,7 @@ void PhyRegAlloc::updateMachineCode() const Value *const Val = Op.getVRegValue(); // delete this condition checking later (must assert if Val is null) - if( !Val ) { + if( !Val && DEBUG_RA) { cout << "Warning: NULL Value found for operand" << endl; continue; } @@ -279,8 +279,10 @@ void PhyRegAlloc::updateMachineCode() // nothing to worry if it's a const or a label - cout << "*NO LR for inst opcode: "; - cout << TargetInstrDescriptors[MInst->getOpCode()].opCodeString; + if (DEBUG_RA) { + cout << "*NO LR for inst opcode: "; + cout << TargetInstrDescriptors[MInst->getOpCode()].opCodeString; + } Op.setRegForValue( -1 ); // mark register as invalid @@ -297,7 +299,7 @@ void PhyRegAlloc::updateMachineCode() //TM.getInstrInfo().isReturn(MInst->getOpCode()) else if(TM.getInstrInfo().isReturn(MInst->getOpCode()) ) { - cout << endl << "RETURN found" << endl; + if (DEBUG_RA) cout << endl << "RETURN found" << endl; Op.setRegForValue( MRI.getReturnAddressReg() ); } diff --git a/lib/Target/SparcV9/RegAlloc/LiveRangeInfo.cpp b/lib/Target/SparcV9/RegAlloc/LiveRangeInfo.cpp index 17139e43b74..658f3d276e2 100644 --- a/lib/Target/SparcV9/RegAlloc/LiveRangeInfo.cpp +++ b/lib/Target/SparcV9/RegAlloc/LiveRangeInfo.cpp @@ -96,7 +96,7 @@ void LiveRangeInfo::constructLiveRanges() MachineOperand::MachineOperandType OpTyp = OpI.getMachineOperand().getOperandType(); - if ( OpTyp == MachineOperand::MO_CCRegister) { + if (DEBUG_RA && OpTyp == MachineOperand::MO_CCRegister) { cout << "\n**CC reg found. Is Def=" << OpI.isDef() << " Val:"; printValue( OpI.getMachineOperand().getVRegValue() ); cout << endl; diff --git a/lib/Target/SparcV9/RegAlloc/PhyRegAloc.cpp b/lib/Target/SparcV9/RegAlloc/PhyRegAlloc.cpp similarity index 98% rename from lib/Target/SparcV9/RegAlloc/PhyRegAloc.cpp rename to lib/Target/SparcV9/RegAlloc/PhyRegAlloc.cpp index 7237effe68d..8824b64661c 100644 --- a/lib/Target/SparcV9/RegAlloc/PhyRegAloc.cpp +++ b/lib/Target/SparcV9/RegAlloc/PhyRegAlloc.cpp @@ -267,7 +267,7 @@ void PhyRegAlloc::updateMachineCode() const Value *const Val = Op.getVRegValue(); // delete this condition checking later (must assert if Val is null) - if( !Val ) { + if( !Val && DEBUG_RA) { cout << "Warning: NULL Value found for operand" << endl; continue; } @@ -279,8 +279,10 @@ void PhyRegAlloc::updateMachineCode() // nothing to worry if it's a const or a label - cout << "*NO LR for inst opcode: "; - cout << TargetInstrDescriptors[MInst->getOpCode()].opCodeString; + if (DEBUG_RA) { + cout << "*NO LR for inst opcode: "; + cout << TargetInstrDescriptors[MInst->getOpCode()].opCodeString; + } Op.setRegForValue( -1 ); // mark register as invalid @@ -297,7 +299,7 @@ void PhyRegAlloc::updateMachineCode() //TM.getInstrInfo().isReturn(MInst->getOpCode()) else if(TM.getInstrInfo().isReturn(MInst->getOpCode()) ) { - cout << endl << "RETURN found" << endl; + if (DEBUG_RA) cout << endl << "RETURN found" << endl; Op.setRegForValue( MRI.getReturnAddressReg() ); }