mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-02-03 00:33:09 +00:00
Make removeTriviallyDeadNodes a private interface of DSGraph
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4659 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
3ce235a161
commit
96517253a1
@ -154,10 +154,11 @@ DSGraph &BUDataStructures::calculateGraph(Function &F) {
|
||||
}
|
||||
} while (Inlined && !FCs.empty());
|
||||
|
||||
#if 0
|
||||
Graph->maskIncompleteMarkers();
|
||||
Graph->markIncompleteNodes();
|
||||
Graph->removeTriviallyDeadNodes(false);
|
||||
Graph->removeDeadNodes(/*KeepAllGlobals*/ true, /*KeepCalls*/ true);
|
||||
#endif
|
||||
|
||||
DEBUG(std::cerr << " [BU] Done inlining: " << F.getName() << " ["
|
||||
<< Graph->getGraphSize() << "+" << Graph->getFunctionCalls().size()
|
||||
|
@ -772,8 +772,7 @@ static void removeRefsToGlobal(DSNode* N,
|
||||
//
|
||||
bool DSGraph::isNodeDead(DSNode *N) {
|
||||
// Is it a trivially dead shadow node...
|
||||
if (N->getReferrers().empty() &&
|
||||
(N->NodeType == 0 || N->NodeType == DSNode::DEAD))
|
||||
if (N->getReferrers().empty() && (N->NodeType & ~DSNode::DEAD) == 0)
|
||||
return true;
|
||||
|
||||
// Is it a function node or some other trivially unused global?
|
||||
|
@ -74,9 +74,6 @@ namespace {
|
||||
getValueDest(*I);
|
||||
|
||||
visit(G.getFunction()); // Single pass over the function
|
||||
|
||||
// Not inlining, only eliminate trivially dead nodes.
|
||||
G.removeTriviallyDeadNodes();
|
||||
}
|
||||
|
||||
private:
|
||||
@ -135,6 +132,9 @@ DSGraph::DSGraph(Function &F, DSGraph *GG) : Func(&F), GlobalsGraph(GG) {
|
||||
// Use the graph builder to construct the local version of the graph
|
||||
GraphBuilder B(*this, Nodes, RetNode, ScalarMap, FunctionCalls);
|
||||
markIncompleteNodes();
|
||||
|
||||
// Remove any nodes made dead due to merging...
|
||||
removeDeadNodes(true, true);
|
||||
}
|
||||
|
||||
|
||||
|
@ -194,7 +194,7 @@ bool Steens::run(Module &M) {
|
||||
ResultGraph->markIncompleteNodes(false);
|
||||
|
||||
// Remove any nodes that are dead after all of the merging we have done...
|
||||
ResultGraph->removeTriviallyDeadNodes();
|
||||
ResultGraph->removeDeadNodes(true, true);
|
||||
|
||||
DEBUG(print(std::cerr, &M));
|
||||
return false;
|
||||
|
@ -180,7 +180,6 @@ void TDDataStructures::calculateGraph(Function &F) {
|
||||
CG.maskIncompleteMarkers();
|
||||
CG.markIncompleteNodes(/*markFormals*/ !F.hasInternalLinkage()
|
||||
/*&& FIXME: NEED TO CHECK IF ALL CALLERS FOUND!*/);
|
||||
CG.removeTriviallyDeadNodes(false);
|
||||
CG.removeDeadNodes(false, true) ;///*KeepAllGlobals*/ false, true);
|
||||
///*KeepCalls*/ false);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user