mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-05 12:31:33 +00:00
Change errs() to dbgs().
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92625 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
cb33fd17cc
commit
c0aa67950a
@ -147,7 +147,7 @@ static bool InlineCallIfPossible(CallSite CS, CallGraph &CG,
|
|||||||
|
|
||||||
// Otherwise, we *can* reuse it, RAUW AI into AvailableAlloca and declare
|
// Otherwise, we *can* reuse it, RAUW AI into AvailableAlloca and declare
|
||||||
// success!
|
// success!
|
||||||
DEBUG(errs() << " ***MERGED ALLOCA: " << *AI);
|
DEBUG(dbgs() << " ***MERGED ALLOCA: " << *AI);
|
||||||
|
|
||||||
AI->replaceAllUsesWith(AvailableAlloca);
|
AI->replaceAllUsesWith(AvailableAlloca);
|
||||||
AI->eraseFromParent();
|
AI->eraseFromParent();
|
||||||
@ -178,13 +178,13 @@ bool Inliner::shouldInline(CallSite CS) {
|
|||||||
InlineCost IC = getInlineCost(CS);
|
InlineCost IC = getInlineCost(CS);
|
||||||
|
|
||||||
if (IC.isAlways()) {
|
if (IC.isAlways()) {
|
||||||
DEBUG(errs() << " Inlining: cost=always"
|
DEBUG(dbgs() << " Inlining: cost=always"
|
||||||
<< ", Call: " << *CS.getInstruction() << "\n");
|
<< ", Call: " << *CS.getInstruction() << "\n");
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (IC.isNever()) {
|
if (IC.isNever()) {
|
||||||
DEBUG(errs() << " NOT Inlining: cost=never"
|
DEBUG(dbgs() << " NOT Inlining: cost=never"
|
||||||
<< ", Call: " << *CS.getInstruction() << "\n");
|
<< ", Call: " << *CS.getInstruction() << "\n");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -200,7 +200,7 @@ bool Inliner::shouldInline(CallSite CS) {
|
|||||||
|
|
||||||
float FudgeFactor = getInlineFudgeFactor(CS);
|
float FudgeFactor = getInlineFudgeFactor(CS);
|
||||||
if (Cost >= (int)(CurrentThreshold * FudgeFactor)) {
|
if (Cost >= (int)(CurrentThreshold * FudgeFactor)) {
|
||||||
DEBUG(errs() << " NOT Inlining: cost=" << Cost
|
DEBUG(dbgs() << " NOT Inlining: cost=" << Cost
|
||||||
<< ", Call: " << *CS.getInstruction() << "\n");
|
<< ", Call: " << *CS.getInstruction() << "\n");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -263,14 +263,14 @@ bool Inliner::shouldInline(CallSite CS) {
|
|||||||
|
|
||||||
if (outerCallsFound && someOuterCallWouldNotBeInlined &&
|
if (outerCallsFound && someOuterCallWouldNotBeInlined &&
|
||||||
TotalSecondaryCost < Cost) {
|
TotalSecondaryCost < Cost) {
|
||||||
DEBUG(errs() << " NOT Inlining: " << *CS.getInstruction() <<
|
DEBUG(dbgs() << " NOT Inlining: " << *CS.getInstruction() <<
|
||||||
" Cost = " << Cost <<
|
" Cost = " << Cost <<
|
||||||
", outer Cost = " << TotalSecondaryCost << '\n');
|
", outer Cost = " << TotalSecondaryCost << '\n');
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
DEBUG(errs() << " Inlining: cost=" << Cost
|
DEBUG(dbgs() << " Inlining: cost=" << Cost
|
||||||
<< ", Call: " << *CS.getInstruction() << '\n');
|
<< ", Call: " << *CS.getInstruction() << '\n');
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@ -280,11 +280,11 @@ bool Inliner::runOnSCC(std::vector<CallGraphNode*> &SCC) {
|
|||||||
const TargetData *TD = getAnalysisIfAvailable<TargetData>();
|
const TargetData *TD = getAnalysisIfAvailable<TargetData>();
|
||||||
|
|
||||||
SmallPtrSet<Function*, 8> SCCFunctions;
|
SmallPtrSet<Function*, 8> SCCFunctions;
|
||||||
DEBUG(errs() << "Inliner visiting SCC:");
|
DEBUG(dbgs() << "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);
|
||||||
DEBUG(errs() << " " << (F ? F->getName() : "INDIRECTNODE"));
|
DEBUG(dbgs() << " " << (F ? F->getName() : "INDIRECTNODE"));
|
||||||
}
|
}
|
||||||
|
|
||||||
// Scan through and identify all call sites ahead of time so that we only
|
// Scan through and identify all call sites ahead of time so that we only
|
||||||
@ -314,7 +314,7 @@ bool Inliner::runOnSCC(std::vector<CallGraphNode*> &SCC) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
DEBUG(errs() << ": " << CallSites.size() << " call sites.\n");
|
DEBUG(dbgs() << ": " << 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.
|
||||||
@ -346,7 +346,7 @@ bool Inliner::runOnSCC(std::vector<CallGraphNode*> &SCC) {
|
|||||||
// size. This happens because IPSCCP propagates the result out of the
|
// size. This happens because IPSCCP propagates the result out of the
|
||||||
// call and then we're left with the dead call.
|
// call and then we're left with the dead call.
|
||||||
if (isInstructionTriviallyDead(CS.getInstruction())) {
|
if (isInstructionTriviallyDead(CS.getInstruction())) {
|
||||||
DEBUG(errs() << " -> Deleting dead call: "
|
DEBUG(dbgs() << " -> Deleting dead call: "
|
||||||
<< *CS.getInstruction() << "\n");
|
<< *CS.getInstruction() << "\n");
|
||||||
// Update the call graph by deleting the edge from Callee to Caller.
|
// Update the call graph by deleting the edge from Callee to Caller.
|
||||||
CG[Caller]->removeCallEdgeFor(CS);
|
CG[Caller]->removeCallEdgeFor(CS);
|
||||||
@ -377,7 +377,7 @@ bool Inliner::runOnSCC(std::vector<CallGraphNode*> &SCC) {
|
|||||||
// callgraph references to the node, we cannot delete it yet, this
|
// callgraph references to the node, we cannot delete it yet, this
|
||||||
// could invalidate the CGSCC iterator.
|
// could invalidate the CGSCC iterator.
|
||||||
CG[Callee]->getNumReferences() == 0) {
|
CG[Callee]->getNumReferences() == 0) {
|
||||||
DEBUG(errs() << " -> Deleting dead function: "
|
DEBUG(dbgs() << " -> Deleting dead function: "
|
||||||
<< Callee->getName() << "\n");
|
<< Callee->getName() << "\n");
|
||||||
CallGraphNode *CalleeNode = CG[Callee];
|
CallGraphNode *CalleeNode = CG[Callee];
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user