Convert debug messages to use dbgs(). Generally this means
s/errs/dbgs/g except for certain special cases. llvm-svn: 92060
This commit is contained in:
parent
398932a619
commit
cf1884c246
|
@ -163,7 +163,7 @@ double ProfileInfoT<MachineFunction, MachineBasicBlock>::
|
||||||
template<>
|
template<>
|
||||||
void ProfileInfoT<Function,BasicBlock>::
|
void ProfileInfoT<Function,BasicBlock>::
|
||||||
setExecutionCount(const BasicBlock *BB, double w) {
|
setExecutionCount(const BasicBlock *BB, double w) {
|
||||||
DEBUG(errs() << "Creating Block " << BB->getName()
|
DEBUG(dbgs() << "Creating Block " << BB->getName()
|
||||||
<< " (weight: " << format("%.20g",w) << ")\n");
|
<< " (weight: " << format("%.20g",w) << ")\n");
|
||||||
BlockInformation[BB->getParent()][BB] = w;
|
BlockInformation[BB->getParent()][BB] = w;
|
||||||
}
|
}
|
||||||
|
@ -171,7 +171,7 @@ void ProfileInfoT<Function,BasicBlock>::
|
||||||
template<>
|
template<>
|
||||||
void ProfileInfoT<MachineFunction, MachineBasicBlock>::
|
void ProfileInfoT<MachineFunction, MachineBasicBlock>::
|
||||||
setExecutionCount(const MachineBasicBlock *MBB, double w) {
|
setExecutionCount(const MachineBasicBlock *MBB, double w) {
|
||||||
DEBUG(errs() << "Creating Block " << MBB->getBasicBlock()->getName()
|
DEBUG(dbgs() << "Creating Block " << MBB->getBasicBlock()->getName()
|
||||||
<< " (weight: " << format("%.20g",w) << ")\n");
|
<< " (weight: " << format("%.20g",w) << ")\n");
|
||||||
BlockInformation[MBB->getParent()][MBB] = w;
|
BlockInformation[MBB->getParent()][MBB] = w;
|
||||||
}
|
}
|
||||||
|
@ -180,7 +180,7 @@ template<>
|
||||||
void ProfileInfoT<Function,BasicBlock>::addEdgeWeight(Edge e, double w) {
|
void ProfileInfoT<Function,BasicBlock>::addEdgeWeight(Edge e, double w) {
|
||||||
double oldw = getEdgeWeight(e);
|
double oldw = getEdgeWeight(e);
|
||||||
assert (oldw != MissingValue && "Adding weight to Edge with no previous weight");
|
assert (oldw != MissingValue && "Adding weight to Edge with no previous weight");
|
||||||
DEBUG(errs() << "Adding to Edge " << e
|
DEBUG(dbgs() << "Adding to Edge " << e
|
||||||
<< " (new weight: " << format("%.20g",oldw + w) << ")\n");
|
<< " (new weight: " << format("%.20g",oldw + w) << ")\n");
|
||||||
EdgeInformation[getFunction(e)][e] = oldw + w;
|
EdgeInformation[getFunction(e)][e] = oldw + w;
|
||||||
}
|
}
|
||||||
|
@ -190,7 +190,7 @@ void ProfileInfoT<Function,BasicBlock>::
|
||||||
addExecutionCount(const BasicBlock *BB, double w) {
|
addExecutionCount(const BasicBlock *BB, double w) {
|
||||||
double oldw = getExecutionCount(BB);
|
double oldw = getExecutionCount(BB);
|
||||||
assert (oldw != MissingValue && "Adding weight to Block with no previous weight");
|
assert (oldw != MissingValue && "Adding weight to Block with no previous weight");
|
||||||
DEBUG(errs() << "Adding to Block " << BB->getName()
|
DEBUG(dbgs() << "Adding to Block " << BB->getName()
|
||||||
<< " (new weight: " << format("%.20g",oldw + w) << ")\n");
|
<< " (new weight: " << format("%.20g",oldw + w) << ")\n");
|
||||||
BlockInformation[BB->getParent()][BB] = oldw + w;
|
BlockInformation[BB->getParent()][BB] = oldw + w;
|
||||||
}
|
}
|
||||||
|
@ -201,7 +201,7 @@ void ProfileInfoT<Function,BasicBlock>::removeBlock(const BasicBlock *BB) {
|
||||||
BlockInformation.find(BB->getParent());
|
BlockInformation.find(BB->getParent());
|
||||||
if (J == BlockInformation.end()) return;
|
if (J == BlockInformation.end()) return;
|
||||||
|
|
||||||
DEBUG(errs() << "Deleting " << BB->getName() << "\n");
|
DEBUG(dbgs() << "Deleting " << BB->getName() << "\n");
|
||||||
J->second.erase(BB);
|
J->second.erase(BB);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -211,7 +211,7 @@ void ProfileInfoT<Function,BasicBlock>::removeEdge(Edge e) {
|
||||||
EdgeInformation.find(getFunction(e));
|
EdgeInformation.find(getFunction(e));
|
||||||
if (J == EdgeInformation.end()) return;
|
if (J == EdgeInformation.end()) return;
|
||||||
|
|
||||||
DEBUG(errs() << "Deleting" << e << "\n");
|
DEBUG(dbgs() << "Deleting" << e << "\n");
|
||||||
J->second.erase(e);
|
J->second.erase(e);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -221,10 +221,10 @@ void ProfileInfoT<Function,BasicBlock>::
|
||||||
double w;
|
double w;
|
||||||
if ((w = getEdgeWeight(newedge)) == MissingValue) {
|
if ((w = getEdgeWeight(newedge)) == MissingValue) {
|
||||||
w = getEdgeWeight(oldedge);
|
w = getEdgeWeight(oldedge);
|
||||||
DEBUG(errs() << "Replacing " << oldedge << " with " << newedge << "\n");
|
DEBUG(dbgs() << "Replacing " << oldedge << " with " << newedge << "\n");
|
||||||
} else {
|
} else {
|
||||||
w += getEdgeWeight(oldedge);
|
w += getEdgeWeight(oldedge);
|
||||||
DEBUG(errs() << "Adding " << oldedge << " to " << newedge << "\n");
|
DEBUG(dbgs() << "Adding " << oldedge << " to " << newedge << "\n");
|
||||||
}
|
}
|
||||||
setEdgeWeight(newedge,w);
|
setEdgeWeight(newedge,w);
|
||||||
removeEdge(oldedge);
|
removeEdge(oldedge);
|
||||||
|
@ -277,7 +277,7 @@ const BasicBlock *ProfileInfoT<Function,BasicBlock>::
|
||||||
template<>
|
template<>
|
||||||
void ProfileInfoT<Function,BasicBlock>::
|
void ProfileInfoT<Function,BasicBlock>::
|
||||||
divertFlow(const Edge &oldedge, const Edge &newedge) {
|
divertFlow(const Edge &oldedge, const Edge &newedge) {
|
||||||
DEBUG(errs() << "Diverting " << oldedge << " via " << newedge );
|
DEBUG(dbgs() << "Diverting " << oldedge << " via " << newedge );
|
||||||
|
|
||||||
// First check if the old edge was taken, if not, just delete it...
|
// First check if the old edge was taken, if not, just delete it...
|
||||||
if (getEdgeWeight(oldedge) == 0) {
|
if (getEdgeWeight(oldedge) == 0) {
|
||||||
|
@ -291,7 +291,7 @@ void ProfileInfoT<Function,BasicBlock>::
|
||||||
const BasicBlock *BB = GetPath(newedge.second,oldedge.second,P,GetPathToExit | GetPathToDest);
|
const BasicBlock *BB = GetPath(newedge.second,oldedge.second,P,GetPathToExit | GetPathToDest);
|
||||||
|
|
||||||
double w = getEdgeWeight (oldedge);
|
double w = getEdgeWeight (oldedge);
|
||||||
DEBUG(errs() << ", Weight: " << format("%.20g",w) << "\n");
|
DEBUG(dbgs() << ", Weight: " << format("%.20g",w) << "\n");
|
||||||
do {
|
do {
|
||||||
const BasicBlock *Parent = P.find(BB)->second;
|
const BasicBlock *Parent = P.find(BB)->second;
|
||||||
Edge e = getEdge(Parent,BB);
|
Edge e = getEdge(Parent,BB);
|
||||||
|
@ -312,7 +312,7 @@ void ProfileInfoT<Function,BasicBlock>::
|
||||||
template<>
|
template<>
|
||||||
void ProfileInfoT<Function,BasicBlock>::
|
void ProfileInfoT<Function,BasicBlock>::
|
||||||
replaceAllUses(const BasicBlock *RmBB, const BasicBlock *DestBB) {
|
replaceAllUses(const BasicBlock *RmBB, const BasicBlock *DestBB) {
|
||||||
DEBUG(errs() << "Replacing " << RmBB->getName()
|
DEBUG(dbgs() << "Replacing " << RmBB->getName()
|
||||||
<< " with " << DestBB->getName() << "\n");
|
<< " with " << DestBB->getName() << "\n");
|
||||||
const Function *F = DestBB->getParent();
|
const Function *F = DestBB->getParent();
|
||||||
std::map<const Function*, EdgeWeights>::iterator J =
|
std::map<const Function*, EdgeWeights>::iterator J =
|
||||||
|
@ -413,7 +413,7 @@ void ProfileInfoT<Function,BasicBlock>::splitBlock(const BasicBlock *Old,
|
||||||
EdgeInformation.find(F);
|
EdgeInformation.find(F);
|
||||||
if (J == EdgeInformation.end()) return;
|
if (J == EdgeInformation.end()) return;
|
||||||
|
|
||||||
DEBUG(errs() << "Splitting " << Old->getName() << " to " << New->getName() << "\n");
|
DEBUG(dbgs() << "Splitting " << Old->getName() << " to " << New->getName() << "\n");
|
||||||
|
|
||||||
std::set<Edge> Edges;
|
std::set<Edge> Edges;
|
||||||
for (EdgeWeights::iterator ewi = J->second.begin(), ewe = J->second.end();
|
for (EdgeWeights::iterator ewi = J->second.begin(), ewe = J->second.end();
|
||||||
|
@ -444,7 +444,7 @@ void ProfileInfoT<Function,BasicBlock>::splitBlock(const BasicBlock *BB,
|
||||||
EdgeInformation.find(F);
|
EdgeInformation.find(F);
|
||||||
if (J == EdgeInformation.end()) return;
|
if (J == EdgeInformation.end()) return;
|
||||||
|
|
||||||
DEBUG(errs() << "Splitting " << NumPreds << " Edges from " << BB->getName()
|
DEBUG(dbgs() << "Splitting " << NumPreds << " Edges from " << BB->getName()
|
||||||
<< " to " << NewBB->getName() << "\n");
|
<< " to " << NewBB->getName() << "\n");
|
||||||
|
|
||||||
// Collect weight that was redirected over NewBB.
|
// Collect weight that was redirected over NewBB.
|
||||||
|
@ -474,7 +474,7 @@ void ProfileInfoT<Function,BasicBlock>::splitBlock(const BasicBlock *BB,
|
||||||
template<>
|
template<>
|
||||||
void ProfileInfoT<Function,BasicBlock>::transfer(const Function *Old,
|
void ProfileInfoT<Function,BasicBlock>::transfer(const Function *Old,
|
||||||
const Function *New) {
|
const Function *New) {
|
||||||
DEBUG(errs() << "Replacing Function " << Old->getName() << " with "
|
DEBUG(dbgs() << "Replacing Function " << Old->getName() << " with "
|
||||||
<< New->getName() << "\n");
|
<< New->getName() << "\n");
|
||||||
std::map<const Function*, EdgeWeights>::iterator J =
|
std::map<const Function*, EdgeWeights>::iterator J =
|
||||||
EdgeInformation.find(Old);
|
EdgeInformation.find(Old);
|
||||||
|
@ -552,7 +552,7 @@ bool ProfileInfoT<Function,BasicBlock>::
|
||||||
} else {
|
} else {
|
||||||
EdgeInformation[BB->getParent()][edgetocalc] = incount-outcount;
|
EdgeInformation[BB->getParent()][edgetocalc] = incount-outcount;
|
||||||
}
|
}
|
||||||
DEBUG(errs() << "--Calc Edge Counter for " << edgetocalc << ": "
|
DEBUG(dbgs() << "--Calc Edge Counter for " << edgetocalc << ": "
|
||||||
<< format("%.20g", getEdgeWeight(edgetocalc)) << "\n");
|
<< format("%.20g", getEdgeWeight(edgetocalc)) << "\n");
|
||||||
removed = edgetocalc;
|
removed = edgetocalc;
|
||||||
return true;
|
return true;
|
||||||
|
@ -978,17 +978,17 @@ void ProfileInfoT<Function,BasicBlock>::repair(const Function *F) {
|
||||||
}
|
}
|
||||||
if (FoundPath) continue;
|
if (FoundPath) continue;
|
||||||
|
|
||||||
errs() << "{";
|
dbgs() << "{";
|
||||||
FI = Unvisited.begin(), FE = Unvisited.end();
|
FI = Unvisited.begin(), FE = Unvisited.end();
|
||||||
while(FI != FE) {
|
while(FI != FE) {
|
||||||
const BasicBlock *BB = *FI; ++FI;
|
const BasicBlock *BB = *FI; ++FI;
|
||||||
errs() << BB->getName();
|
dbgs() << BB->getName();
|
||||||
if (FI != FE)
|
if (FI != FE)
|
||||||
errs() << ",";
|
dbgs() << ",";
|
||||||
}
|
}
|
||||||
errs() << "}";
|
dbgs() << "}";
|
||||||
|
|
||||||
errs() << "ASSERT: could not repair function";
|
dbgs() << "ASSERT: could not repair function";
|
||||||
assert(0 && "could not repair function");
|
assert(0 && "could not repair function");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue