Change errs() to dbgs().

llvm-svn: 92584
This commit is contained in:
David Greene 2010-01-05 01:25:39 +00:00
parent 025e934d54
commit 0c1e7772fb
1 changed files with 37 additions and 37 deletions

View File

@ -185,7 +185,7 @@ void PEI::placeCSRSpillsAndRestores(MachineFunction &Fn) {
initShrinkWrappingInfo(); initShrinkWrappingInfo();
DEBUG(if (ShrinkWrapThisFunction) { DEBUG(if (ShrinkWrapThisFunction) {
errs() << "Place CSR spills/restores for " dbgs() << "Place CSR spills/restores for "
<< MF->getFunction()->getName() << "\n"; << MF->getFunction()->getName() << "\n";
}); });
@ -299,7 +299,7 @@ void PEI::calculateAnticAvail(MachineFunction &Fn) {
DEBUG({ DEBUG({
if (ShrinkWrapDebugging >= Details) { if (ShrinkWrapDebugging >= Details) {
errs() dbgs()
<< "-----------------------------------------------------------\n" << "-----------------------------------------------------------\n"
<< " Antic/Avail Sets:\n" << " Antic/Avail Sets:\n"
<< "-----------------------------------------------------------\n" << "-----------------------------------------------------------\n"
@ -314,7 +314,7 @@ void PEI::calculateAnticAvail(MachineFunction &Fn) {
dumpSets(MBB); dumpSets(MBB);
} }
errs() dbgs()
<< "-----------------------------------------------------------\n"; << "-----------------------------------------------------------\n";
} }
}); });
@ -363,7 +363,7 @@ bool PEI::calculateSets(MachineFunction &Fn) {
// If no CSRs used, we are done. // If no CSRs used, we are done.
if (CSI.empty()) { if (CSI.empty()) {
DEBUG(if (ShrinkWrapThisFunction) DEBUG(if (ShrinkWrapThisFunction)
errs() << "DISABLED: " << Fn.getFunction()->getName() dbgs() << "DISABLED: " << Fn.getFunction()->getName()
<< ": uses no callee-saved registers\n"); << ": uses no callee-saved registers\n");
return false; return false;
} }
@ -383,7 +383,7 @@ bool PEI::calculateSets(MachineFunction &Fn) {
// implementation to functions with <= 500 MBBs. // implementation to functions with <= 500 MBBs.
if (Fn.size() > 500) { if (Fn.size() > 500) {
DEBUG(if (ShrinkWrapThisFunction) DEBUG(if (ShrinkWrapThisFunction)
errs() << "DISABLED: " << Fn.getFunction()->getName() dbgs() << "DISABLED: " << Fn.getFunction()->getName()
<< ": too large (" << Fn.size() << " MBBs)\n"); << ": too large (" << Fn.size() << " MBBs)\n");
ShrinkWrapThisFunction = false; ShrinkWrapThisFunction = false;
} }
@ -465,7 +465,7 @@ bool PEI::calculateSets(MachineFunction &Fn) {
} }
if (allCSRUsesInEntryBlock) { if (allCSRUsesInEntryBlock) {
DEBUG(errs() << "DISABLED: " << Fn.getFunction()->getName() DEBUG(dbgs() << "DISABLED: " << Fn.getFunction()->getName()
<< ": all CSRs used in EntryBlock\n"); << ": all CSRs used in EntryBlock\n");
ShrinkWrapThisFunction = false; ShrinkWrapThisFunction = false;
} else { } else {
@ -477,7 +477,7 @@ bool PEI::calculateSets(MachineFunction &Fn) {
allCSRsUsedInEntryFanout = false; allCSRsUsedInEntryFanout = false;
} }
if (allCSRsUsedInEntryFanout) { if (allCSRsUsedInEntryFanout) {
DEBUG(errs() << "DISABLED: " << Fn.getFunction()->getName() DEBUG(dbgs() << "DISABLED: " << Fn.getFunction()->getName()
<< ": all CSRs used in imm successors of EntryBlock\n"); << ": all CSRs used in imm successors of EntryBlock\n");
ShrinkWrapThisFunction = false; ShrinkWrapThisFunction = false;
} }
@ -504,7 +504,7 @@ bool PEI::calculateSets(MachineFunction &Fn) {
if (dominatesExitNodes) { if (dominatesExitNodes) {
CSRUsedInChokePoints |= CSRUsed[MBB]; CSRUsedInChokePoints |= CSRUsed[MBB];
if (CSRUsedInChokePoints == UsedCSRegs) { if (CSRUsedInChokePoints == UsedCSRegs) {
DEBUG(errs() << "DISABLED: " << Fn.getFunction()->getName() DEBUG(dbgs() << "DISABLED: " << Fn.getFunction()->getName()
<< ": all CSRs used in choke point(s) at " << ": all CSRs used in choke point(s) at "
<< getBasicBlockName(MBB) << "\n"); << getBasicBlockName(MBB) << "\n");
ShrinkWrapThisFunction = false; ShrinkWrapThisFunction = false;
@ -520,16 +520,16 @@ bool PEI::calculateSets(MachineFunction &Fn) {
return false; return false;
DEBUG({ DEBUG({
errs() << "ENABLED: " << Fn.getFunction()->getName(); dbgs() << "ENABLED: " << Fn.getFunction()->getName();
if (HasFastExitPath) if (HasFastExitPath)
errs() << " (fast exit path)"; dbgs() << " (fast exit path)";
errs() << "\n"; dbgs() << "\n";
if (ShrinkWrapDebugging >= BasicInfo) { if (ShrinkWrapDebugging >= BasicInfo) {
errs() << "------------------------------" dbgs() << "------------------------------"
<< "-----------------------------\n"; << "-----------------------------\n";
errs() << "UsedCSRegs = " << stringifyCSRegSet(UsedCSRegs) << "\n"; dbgs() << "UsedCSRegs = " << stringifyCSRegSet(UsedCSRegs) << "\n";
if (ShrinkWrapDebugging >= Details) { if (ShrinkWrapDebugging >= Details) {
errs() << "------------------------------" dbgs() << "------------------------------"
<< "-----------------------------\n"; << "-----------------------------\n";
dumpAllUsed(); dumpAllUsed();
} }
@ -602,7 +602,7 @@ bool PEI::addUsesForMEMERegion(MachineBasicBlock* MBB,
addedUses = true; addedUses = true;
blks.push_back(SUCC); blks.push_back(SUCC);
DEBUG(if (ShrinkWrapDebugging >= Iterations) DEBUG(if (ShrinkWrapDebugging >= Iterations)
errs() << getBasicBlockName(MBB) dbgs() << getBasicBlockName(MBB)
<< "(" << stringifyCSRegSet(prop) << ")->" << "(" << stringifyCSRegSet(prop) << ")->"
<< "successor " << getBasicBlockName(SUCC) << "\n"); << "successor " << getBasicBlockName(SUCC) << "\n");
} }
@ -618,7 +618,7 @@ bool PEI::addUsesForMEMERegion(MachineBasicBlock* MBB,
addedUses = true; addedUses = true;
blks.push_back(PRED); blks.push_back(PRED);
DEBUG(if (ShrinkWrapDebugging >= Iterations) DEBUG(if (ShrinkWrapDebugging >= Iterations)
errs() << getBasicBlockName(MBB) dbgs() << getBasicBlockName(MBB)
<< "(" << stringifyCSRegSet(prop) << ")->" << "(" << stringifyCSRegSet(prop) << ")->"
<< "predecessor " << getBasicBlockName(PRED) << "\n"); << "predecessor " << getBasicBlockName(PRED) << "\n");
} }
@ -656,7 +656,7 @@ bool PEI::addUsesForTopLevelLoops(SmallVector<MachineBasicBlock*, 4>& blks) {
CSRUsed[EXB] |= loopSpills; CSRUsed[EXB] |= loopSpills;
addedUses = true; addedUses = true;
DEBUG(if (ShrinkWrapDebugging >= Iterations) DEBUG(if (ShrinkWrapDebugging >= Iterations)
errs() << "LOOP " << getBasicBlockName(MBB) dbgs() << "LOOP " << getBasicBlockName(MBB)
<< "(" << stringifyCSRegSet(loopSpills) << ")->" << "(" << stringifyCSRegSet(loopSpills) << ")->"
<< getBasicBlockName(EXB) << "\n"); << getBasicBlockName(EXB) << "\n");
if (EXB->succ_size() > 1 || EXB->pred_size() > 1) if (EXB->succ_size() > 1 || EXB->pred_size() > 1)
@ -723,7 +723,7 @@ bool PEI::calcSpillPlacements(MachineBasicBlock* MBB,
blks.push_back(MBB); blks.push_back(MBB);
DEBUG(if (! CSRSave[MBB].empty() && ShrinkWrapDebugging >= Iterations) DEBUG(if (! CSRSave[MBB].empty() && ShrinkWrapDebugging >= Iterations)
errs() << "SAVE[" << getBasicBlockName(MBB) << "] = " dbgs() << "SAVE[" << getBasicBlockName(MBB) << "] = "
<< stringifyCSRegSet(CSRSave[MBB]) << "\n"); << stringifyCSRegSet(CSRSave[MBB]) << "\n");
return placedSpills; return placedSpills;
@ -784,7 +784,7 @@ bool PEI::calcRestorePlacements(MachineBasicBlock* MBB,
blks.push_back(MBB); blks.push_back(MBB);
DEBUG(if (! CSRRestore[MBB].empty() && ShrinkWrapDebugging >= Iterations) DEBUG(if (! CSRRestore[MBB].empty() && ShrinkWrapDebugging >= Iterations)
errs() << "RESTORE[" << getBasicBlockName(MBB) << "] = " dbgs() << "RESTORE[" << getBasicBlockName(MBB) << "] = "
<< stringifyCSRegSet(CSRRestore[MBB]) << "\n"); << stringifyCSRegSet(CSRRestore[MBB]) << "\n");
return placedRestores; return placedRestores;
@ -808,7 +808,7 @@ void PEI::placeSpillsAndRestores(MachineFunction &Fn) {
++iterations; ++iterations;
DEBUG(if (ShrinkWrapDebugging >= Iterations) DEBUG(if (ShrinkWrapDebugging >= Iterations)
errs() << "iter " << iterations dbgs() << "iter " << iterations
<< " --------------------------------------------------\n"); << " --------------------------------------------------\n");
// Calculate CSR{Save,Restore} sets using Antic, Avail on the MCFG, // Calculate CSR{Save,Restore} sets using Antic, Avail on the MCFG,
@ -858,15 +858,15 @@ void PEI::placeSpillsAndRestores(MachineFunction &Fn) {
unsigned numSRReducedThisFunc = notSpilledInEntryBlock.count(); unsigned numSRReducedThisFunc = notSpilledInEntryBlock.count();
numSRReduced += numSRReducedThisFunc; numSRReduced += numSRReducedThisFunc;
DEBUG(if (ShrinkWrapDebugging >= BasicInfo) { DEBUG(if (ShrinkWrapDebugging >= BasicInfo) {
errs() << "-----------------------------------------------------------\n"; dbgs() << "-----------------------------------------------------------\n";
errs() << "total iterations = " << iterations << " ( " dbgs() << "total iterations = " << iterations << " ( "
<< Fn.getFunction()->getName() << Fn.getFunction()->getName()
<< " " << numSRReducedThisFunc << " " << numSRReducedThisFunc
<< " " << Fn.size() << " " << Fn.size()
<< " )\n"; << " )\n";
errs() << "-----------------------------------------------------------\n"; dbgs() << "-----------------------------------------------------------\n";
dumpSRSets(); dumpSRSets();
errs() << "-----------------------------------------------------------\n"; dbgs() << "-----------------------------------------------------------\n";
if (numSRReducedThisFunc) if (numSRReducedThisFunc)
verifySpillRestorePlacement(); verifySpillRestorePlacement();
}); });
@ -899,7 +899,7 @@ void PEI::findFastExitPath() {
// Check the immediate successors. // Check the immediate successors.
if (isReturnBlock(SUCC)) { if (isReturnBlock(SUCC)) {
if (ShrinkWrapDebugging >= BasicInfo) if (ShrinkWrapDebugging >= BasicInfo)
errs() << "Fast exit path: " << getBasicBlockName(EntryBlock) dbgs() << "Fast exit path: " << getBasicBlockName(EntryBlock)
<< "->" << getBasicBlockName(SUCC) << "\n"; << "->" << getBasicBlockName(SUCC) << "\n";
break; break;
} }
@ -917,7 +917,7 @@ void PEI::findFastExitPath() {
} }
if (HasFastExitPath) { if (HasFastExitPath) {
if (ShrinkWrapDebugging >= BasicInfo) if (ShrinkWrapDebugging >= BasicInfo)
errs() << "Fast exit path: " << getBasicBlockName(EntryBlock) dbgs() << "Fast exit path: " << getBasicBlockName(EntryBlock)
<< "->" << exitPath << "\n"; << "->" << exitPath << "\n";
break; break;
} }
@ -951,7 +951,7 @@ void PEI::verifySpillRestorePlacement() {
if (spilled.empty()) if (spilled.empty())
continue; continue;
DEBUG(errs() << "SAVE[" << getBasicBlockName(MBB) << "] = " DEBUG(dbgs() << "SAVE[" << getBasicBlockName(MBB) << "] = "
<< stringifyCSRegSet(spilled) << stringifyCSRegSet(spilled)
<< " RESTORE[" << getBasicBlockName(MBB) << "] = " << " RESTORE[" << getBasicBlockName(MBB) << "] = "
<< stringifyCSRegSet(CSRRestore[MBB]) << "\n"); << stringifyCSRegSet(CSRRestore[MBB]) << "\n");
@ -983,7 +983,7 @@ void PEI::verifySpillRestorePlacement() {
if (isReturnBlock(SBB) || SBB->succ_size() == 0) { if (isReturnBlock(SBB) || SBB->succ_size() == 0) {
if (restored != spilled) { if (restored != spilled) {
CSRegSet notRestored = (spilled - restored); CSRegSet notRestored = (spilled - restored);
DEBUG(errs() << MF->getFunction()->getName() << ": " DEBUG(dbgs() << MF->getFunction()->getName() << ": "
<< stringifyCSRegSet(notRestored) << stringifyCSRegSet(notRestored)
<< " spilled at " << getBasicBlockName(MBB) << " spilled at " << getBasicBlockName(MBB)
<< " are never restored on path to return " << " are never restored on path to return "
@ -1004,7 +1004,7 @@ void PEI::verifySpillRestorePlacement() {
if (restored.empty()) if (restored.empty())
continue; continue;
DEBUG(errs() << "SAVE[" << getBasicBlockName(MBB) << "] = " DEBUG(dbgs() << "SAVE[" << getBasicBlockName(MBB) << "] = "
<< stringifyCSRegSet(CSRSave[MBB]) << stringifyCSRegSet(CSRSave[MBB])
<< " RESTORE[" << getBasicBlockName(MBB) << "] = " << " RESTORE[" << getBasicBlockName(MBB) << "] = "
<< stringifyCSRegSet(restored) << "\n"); << stringifyCSRegSet(restored) << "\n");
@ -1031,7 +1031,7 @@ void PEI::verifySpillRestorePlacement() {
} }
if (spilled != restored) { if (spilled != restored) {
CSRegSet notSpilled = (restored - spilled); CSRegSet notSpilled = (restored - spilled);
DEBUG(errs() << MF->getFunction()->getName() << ": " DEBUG(dbgs() << MF->getFunction()->getName() << ": "
<< stringifyCSRegSet(notSpilled) << stringifyCSRegSet(notSpilled)
<< " restored at " << getBasicBlockName(MBB) << " restored at " << getBasicBlockName(MBB)
<< " are never spilled\n"); << " are never spilled\n");
@ -1078,13 +1078,13 @@ std::string PEI::stringifyCSRegSet(const CSRegSet& s) {
} }
void PEI::dumpSet(const CSRegSet& s) { void PEI::dumpSet(const CSRegSet& s) {
DEBUG(errs() << stringifyCSRegSet(s) << "\n"); DEBUG(dbgs() << stringifyCSRegSet(s) << "\n");
} }
void PEI::dumpUsed(MachineBasicBlock* MBB) { void PEI::dumpUsed(MachineBasicBlock* MBB) {
DEBUG({ DEBUG({
if (MBB) if (MBB)
errs() << "CSRUsed[" << getBasicBlockName(MBB) << "] = " dbgs() << "CSRUsed[" << getBasicBlockName(MBB) << "] = "
<< stringifyCSRegSet(CSRUsed[MBB]) << "\n"; << stringifyCSRegSet(CSRUsed[MBB]) << "\n";
}); });
} }
@ -1100,7 +1100,7 @@ void PEI::dumpAllUsed() {
void PEI::dumpSets(MachineBasicBlock* MBB) { void PEI::dumpSets(MachineBasicBlock* MBB) {
DEBUG({ DEBUG({
if (MBB) if (MBB)
errs() << getBasicBlockName(MBB) << " | " dbgs() << getBasicBlockName(MBB) << " | "
<< stringifyCSRegSet(CSRUsed[MBB]) << " | " << stringifyCSRegSet(CSRUsed[MBB]) << " | "
<< stringifyCSRegSet(AnticIn[MBB]) << " | " << stringifyCSRegSet(AnticIn[MBB]) << " | "
<< stringifyCSRegSet(AnticOut[MBB]) << " | " << stringifyCSRegSet(AnticOut[MBB]) << " | "
@ -1112,7 +1112,7 @@ void PEI::dumpSets(MachineBasicBlock* MBB) {
void PEI::dumpSets1(MachineBasicBlock* MBB) { void PEI::dumpSets1(MachineBasicBlock* MBB) {
DEBUG({ DEBUG({
if (MBB) if (MBB)
errs() << getBasicBlockName(MBB) << " | " dbgs() << getBasicBlockName(MBB) << " | "
<< stringifyCSRegSet(CSRUsed[MBB]) << " | " << stringifyCSRegSet(CSRUsed[MBB]) << " | "
<< stringifyCSRegSet(AnticIn[MBB]) << " | " << stringifyCSRegSet(AnticIn[MBB]) << " | "
<< stringifyCSRegSet(AnticOut[MBB]) << " | " << stringifyCSRegSet(AnticOut[MBB]) << " | "
@ -1136,14 +1136,14 @@ void PEI::dumpSRSets() {
for (MachineFunction::iterator MBB = MF->begin(), E = MF->end(); for (MachineFunction::iterator MBB = MF->begin(), E = MF->end();
MBB != E; ++MBB) { MBB != E; ++MBB) {
if (!CSRSave[MBB].empty()) { if (!CSRSave[MBB].empty()) {
errs() << "SAVE[" << getBasicBlockName(MBB) << "] = " dbgs() << "SAVE[" << getBasicBlockName(MBB) << "] = "
<< stringifyCSRegSet(CSRSave[MBB]); << stringifyCSRegSet(CSRSave[MBB]);
if (CSRRestore[MBB].empty()) if (CSRRestore[MBB].empty())
errs() << '\n'; dbgs() << '\n';
} }
if (!CSRRestore[MBB].empty() && !CSRSave[MBB].empty()) if (!CSRRestore[MBB].empty() && !CSRSave[MBB].empty())
errs() << " " dbgs() << " "
<< "RESTORE[" << getBasicBlockName(MBB) << "] = " << "RESTORE[" << getBasicBlockName(MBB) << "] = "
<< stringifyCSRegSet(CSRRestore[MBB]) << "\n"; << stringifyCSRegSet(CSRRestore[MBB]) << "\n";
} }