Convert DOUT to DEBUG(errs()...).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79762 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Bill Wendling 2009-08-22 20:46:59 +00:00
parent 960bb85b21
commit 9c52affd37

View File

@ -297,20 +297,26 @@ void PEI::calculateAnticAvail(MachineFunction &Fn) {
} }
} }
DEBUG(if (ShrinkWrapDebugging >= Details) { DEBUG({
DOUT << "-----------------------------------------------------------\n"; if (ShrinkWrapDebugging >= Details) {
DOUT << " Antic/Avail Sets:\n"; errs()
DOUT << "-----------------------------------------------------------\n"; << "-----------------------------------------------------------\n"
DOUT << "iterations = " << iterations << "\n"; << " Antic/Avail Sets:\n"
DOUT << "-----------------------------------------------------------\n"; << "-----------------------------------------------------------\n"
DOUT << "MBB | USED | ANTIC_IN | ANTIC_OUT | AVAIL_IN | AVAIL_OUT\n"; << "iterations = " << iterations << "\n"
DOUT << "-----------------------------------------------------------\n"; << "-----------------------------------------------------------\n"
for (MachineFunction::iterator MBBI = Fn.begin(), MBBE = Fn.end(); << "MBB | USED | ANTIC_IN | ANTIC_OUT | AVAIL_IN | AVAIL_OUT\n"
MBBI != MBBE; ++MBBI) { << "-----------------------------------------------------------\n";
MachineBasicBlock* MBB = MBBI;
dumpSets(MBB); for (MachineFunction::iterator MBBI = Fn.begin(), MBBE = Fn.end();
MBBI != MBBE; ++MBBI) {
MachineBasicBlock* MBB = MBBI;
dumpSets(MBB);
}
errs()
<< "-----------------------------------------------------------\n";
} }
DOUT << "-----------------------------------------------------------\n";
}); });
} }
@ -460,7 +466,7 @@ bool PEI::calculateSets(MachineFunction &Fn) {
if (allCSRUsesInEntryBlock) { if (allCSRUsesInEntryBlock) {
DEBUG(errs() << "DISABLED: " << Fn.getFunction()->getName() DEBUG(errs() << "DISABLED: " << Fn.getFunction()->getName()
<< ": all CSRs used in EntryBlock\n"); << ": all CSRs used in EntryBlock\n");
ShrinkWrapThisFunction = false; ShrinkWrapThisFunction = false;
} else { } else {
bool allCSRsUsedInEntryFanout = true; bool allCSRsUsedInEntryFanout = true;
@ -472,7 +478,7 @@ bool PEI::calculateSets(MachineFunction &Fn) {
} }
if (allCSRsUsedInEntryFanout) { if (allCSRsUsedInEntryFanout) {
DEBUG(errs() << "DISABLED: " << Fn.getFunction()->getName() DEBUG(errs() << "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;
} }
} }
@ -499,8 +505,8 @@ bool PEI::calculateSets(MachineFunction &Fn) {
CSRUsedInChokePoints |= CSRUsed[MBB]; CSRUsedInChokePoints |= CSRUsed[MBB];
if (CSRUsedInChokePoints == UsedCSRegs) { if (CSRUsedInChokePoints == UsedCSRegs) {
DEBUG(errs() << "DISABLED: " << Fn.getFunction()->getName() DEBUG(errs() << "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;
break; break;
} }
@ -945,10 +951,10 @@ void PEI::verifySpillRestorePlacement() {
if (spilled.empty()) if (spilled.empty())
continue; continue;
DOUT << "SAVE[" << getBasicBlockName(MBB) << "] = " DEBUG(errs() << "SAVE[" << getBasicBlockName(MBB) << "] = "
<< stringifyCSRegSet(spilled) << stringifyCSRegSet(spilled)
<< " RESTORE[" << getBasicBlockName(MBB) << "] = " << " RESTORE[" << getBasicBlockName(MBB) << "] = "
<< stringifyCSRegSet(CSRRestore[MBB]) << "\n"; << stringifyCSRegSet(CSRRestore[MBB]) << "\n");
if (CSRRestore[MBB].intersects(spilled)) { if (CSRRestore[MBB].intersects(spilled)) {
restored |= (CSRRestore[MBB] & spilled); restored |= (CSRRestore[MBB] & spilled);
@ -978,10 +984,10 @@ void PEI::verifySpillRestorePlacement() {
if (restored != spilled) { if (restored != spilled) {
CSRegSet notRestored = (spilled - restored); CSRegSet notRestored = (spilled - restored);
DEBUG(errs() << MF->getFunction()->getName() << ": " DEBUG(errs() << 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 "
<< getBasicBlockName(SBB) << "\n"); << getBasicBlockName(SBB) << "\n");
} }
restored.clear(); restored.clear();
} }
@ -998,10 +1004,10 @@ void PEI::verifySpillRestorePlacement() {
if (restored.empty()) if (restored.empty())
continue; continue;
DOUT << "SAVE[" << getBasicBlockName(MBB) << "] = " DEBUG(errs() << "SAVE[" << getBasicBlockName(MBB) << "] = "
<< stringifyCSRegSet(CSRSave[MBB]) << stringifyCSRegSet(CSRSave[MBB])
<< " RESTORE[" << getBasicBlockName(MBB) << "] = " << " RESTORE[" << getBasicBlockName(MBB) << "] = "
<< stringifyCSRegSet(restored) << "\n"; << stringifyCSRegSet(restored) << "\n");
if (CSRSave[MBB].intersects(restored)) { if (CSRSave[MBB].intersects(restored)) {
spilled |= (CSRSave[MBB] & restored); spilled |= (CSRSave[MBB] & restored);
@ -1026,9 +1032,9 @@ void PEI::verifySpillRestorePlacement() {
if (spilled != restored) { if (spilled != restored) {
CSRegSet notSpilled = (restored - spilled); CSRegSet notSpilled = (restored - spilled);
DEBUG(errs() << MF->getFunction()->getName() << ": " DEBUG(errs() << MF->getFunction()->getName() << ": "
<< stringifyCSRegSet(notSpilled) << stringifyCSRegSet(notSpilled)
<< " restored at " << getBasicBlockName(MBB) << " restored at " << getBasicBlockName(MBB)
<< " are never spilled\n"); << " are never spilled\n");
} }
} }
} }
@ -1072,14 +1078,15 @@ std::string PEI::stringifyCSRegSet(const CSRegSet& s) {
} }
void PEI::dumpSet(const CSRegSet& s) { void PEI::dumpSet(const CSRegSet& s) {
DOUT << stringifyCSRegSet(s) << "\n"; DEBUG(errs() << stringifyCSRegSet(s) << "\n");
} }
void PEI::dumpUsed(MachineBasicBlock* MBB) { void PEI::dumpUsed(MachineBasicBlock* MBB) {
if (MBB) { DEBUG({
DOUT << "CSRUsed[" << getBasicBlockName(MBB) << "] = " if (MBB)
<< stringifyCSRegSet(CSRUsed[MBB]) << "\n"; errs() << "CSRUsed[" << getBasicBlockName(MBB) << "] = "
} << stringifyCSRegSet(CSRUsed[MBB]) << "\n";
});
} }
void PEI::dumpAllUsed() { void PEI::dumpAllUsed() {
@ -1091,27 +1098,29 @@ void PEI::dumpAllUsed() {
} }
void PEI::dumpSets(MachineBasicBlock* MBB) { void PEI::dumpSets(MachineBasicBlock* MBB) {
if (MBB) { DEBUG({
DOUT << getBasicBlockName(MBB) << " | " if (MBB)
<< stringifyCSRegSet(CSRUsed[MBB]) << " | " errs() << getBasicBlockName(MBB) << " | "
<< stringifyCSRegSet(AnticIn[MBB]) << " | " << stringifyCSRegSet(CSRUsed[MBB]) << " | "
<< stringifyCSRegSet(AnticOut[MBB]) << " | " << stringifyCSRegSet(AnticIn[MBB]) << " | "
<< stringifyCSRegSet(AvailIn[MBB]) << " | " << stringifyCSRegSet(AnticOut[MBB]) << " | "
<< stringifyCSRegSet(AvailOut[MBB]) << "\n"; << stringifyCSRegSet(AvailIn[MBB]) << " | "
} << stringifyCSRegSet(AvailOut[MBB]) << "\n";
});
} }
void PEI::dumpSets1(MachineBasicBlock* MBB) { void PEI::dumpSets1(MachineBasicBlock* MBB) {
if (MBB) { DEBUG({
DOUT << getBasicBlockName(MBB) << " | " if (MBB)
<< stringifyCSRegSet(CSRUsed[MBB]) << " | " errs() << getBasicBlockName(MBB) << " | "
<< stringifyCSRegSet(AnticIn[MBB]) << " | " << stringifyCSRegSet(CSRUsed[MBB]) << " | "
<< stringifyCSRegSet(AnticOut[MBB]) << " | " << stringifyCSRegSet(AnticIn[MBB]) << " | "
<< stringifyCSRegSet(AvailIn[MBB]) << " | " << stringifyCSRegSet(AnticOut[MBB]) << " | "
<< stringifyCSRegSet(AvailOut[MBB]) << " | " << stringifyCSRegSet(AvailIn[MBB]) << " | "
<< stringifyCSRegSet(CSRSave[MBB]) << " | " << stringifyCSRegSet(AvailOut[MBB]) << " | "
<< stringifyCSRegSet(CSRRestore[MBB]) << "\n"; << stringifyCSRegSet(CSRSave[MBB]) << " | "
} << stringifyCSRegSet(CSRRestore[MBB]) << "\n";
});
} }
void PEI::dumpAllSets() { void PEI::dumpAllSets() {
@ -1123,20 +1132,21 @@ void PEI::dumpAllSets() {
} }
void PEI::dumpSRSets() { void PEI::dumpSRSets() {
for (MachineFunction::iterator MBB = MF->begin(), E = MF->end(); DEBUG({
MBB != E; ++MBB) { for (MachineFunction::iterator MBB = MF->begin(), E = MF->end();
if (! CSRSave[MBB].empty()) { MBB != E; ++MBB) {
DOUT << "SAVE[" << getBasicBlockName(MBB) << "] = " if (!CSRSave[MBB].empty()) {
<< stringifyCSRegSet(CSRSave[MBB]); errs() << "SAVE[" << getBasicBlockName(MBB) << "] = "
if (CSRRestore[MBB].empty()) << stringifyCSRegSet(CSRSave[MBB]);
DOUT << "\n"; if (CSRRestore[MBB].empty())
} errs() << '\n';
if (! CSRRestore[MBB].empty()) { }
if (! CSRSave[MBB].empty())
DOUT << " "; if (!CSRRestore[MBB].empty() && !CSRSave[MBB].empty())
DOUT << "RESTORE[" << getBasicBlockName(MBB) << "] = " errs() << " "
<< stringifyCSRegSet(CSRRestore[MBB]) << "\n"; << "RESTORE[" << getBasicBlockName(MBB) << "] = "
} << stringifyCSRegSet(CSRRestore[MBB]) << "\n";
} }
});
} }
#endif #endif