- Convert the rest of the DOUTs to DEBUG+errs().

- One formatting change.

No intended functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77717 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Bill Wendling 2009-07-31 19:52:24 +00:00
parent d21e55abce
commit 84a832f927

View File

@ -95,33 +95,32 @@ bool Inliner::shouldInline(CallSite CS) {
float FudgeFactor = getInlineFudgeFactor(CS); float FudgeFactor = getInlineFudgeFactor(CS);
if (IC.isAlways()) { if (IC.isAlways()) {
DOUT << " Inlining: cost=always" DEBUG(errs() << " Inlining: cost=always"
<< ", Call: " << *CS.getInstruction() << "\n"; << ", Call: " << *CS.getInstruction() << "\n");
return true; return true;
} }
if (IC.isNever()) { if (IC.isNever()) {
DOUT << " NOT Inlining: cost=never" DEBUG(errs() << " NOT Inlining: cost=never"
<< ", Call: " << *CS.getInstruction() << "\n"; << ", Call: " << *CS.getInstruction() << "\n");
return false; return false;
} }
int Cost = IC.getValue(); int Cost = IC.getValue();
int CurrentThreshold = InlineThreshold; int CurrentThreshold = InlineThreshold;
Function *Fn = CS.getCaller(); Function *Fn = CS.getCaller();
if (Fn && !Fn->isDeclaration() if (Fn && !Fn->isDeclaration() &&
&& Fn->hasFnAttr(Attribute::OptimizeForSize) Fn->hasFnAttr(Attribute::OptimizeForSize) &&
&& InlineThreshold != 50) { InlineThreshold != 50)
CurrentThreshold = 50; CurrentThreshold = 50;
}
if (Cost >= (int)(CurrentThreshold * FudgeFactor)) { if (Cost >= (int)(CurrentThreshold * FudgeFactor)) {
DOUT << " NOT Inlining: cost=" << Cost DEBUG(errs() << " NOT Inlining: cost=" << Cost
<< ", Call: " << *CS.getInstruction() << "\n"; << ", Call: " << *CS.getInstruction() << "\n");
return false; return false;
} else { } else {
DOUT << " Inlining: cost=" << Cost DEBUG(errs() << " Inlining: cost=" << Cost
<< ", Call: " << *CS.getInstruction() << "\n"; << ", Call: " << *CS.getInstruction() << "\n");
return true; return true;
} }
} }
@ -131,7 +130,7 @@ bool Inliner::runOnSCC(const std::vector<CallGraphNode*> &SCC) {
const TargetData *TD = getAnalysisIfAvailable<TargetData>(); const TargetData *TD = getAnalysisIfAvailable<TargetData>();
SmallPtrSet<Function*, 8> SCCFunctions; SmallPtrSet<Function*, 8> SCCFunctions;
DOUT << "Inliner visiting SCC:"; DEBUG(errs() << "Inliner visiting SCC:");
for (unsigned i = 0, e = SCC.size(); i != e; ++i) { for (unsigned i = 0, e = SCC.size(); i != e; ++i) {
Function *F = SCC[i]->getFunction(); Function *F = SCC[i]->getFunction();
if (F) SCCFunctions.insert(F); if (F) SCCFunctions.insert(F);
@ -154,7 +153,7 @@ bool Inliner::runOnSCC(const std::vector<CallGraphNode*> &SCC) {
CallSites.push_back(CS); CallSites.push_back(CS);
} }
DOUT << ": " << CallSites.size() << " call sites.\n"; DEBUG(errs() << ": " << CallSites.size() << " call sites.\n");
// Now that we have all of the call sites, move the ones to functions in the // Now that we have all of the call sites, move the ones to functions in the
// current SCC to the end of the list. // current SCC to the end of the list.