}
} 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()
//
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?
getValueDest(*I);
visit(G.getFunction()); // Single pass over the function
-
- // Not inlining, only eliminate trivially dead nodes.
- G.removeTriviallyDeadNodes();
}
private:
// 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);
}
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;
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);
}