mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-02-21 21:29:41 +00:00
Deinline methods, add fast exit
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12102 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
3d549b18a3
commit
2c7725abb4
@ -1191,6 +1191,10 @@ void DSGraph::mergeInGraph(const DSCallSite &CS, Function &F,
|
|||||||
const DSGraph &Graph, unsigned CloneFlags) {
|
const DSGraph &Graph, unsigned CloneFlags) {
|
||||||
TIME_REGION(X, "mergeInGraph");
|
TIME_REGION(X, "mergeInGraph");
|
||||||
|
|
||||||
|
// Fastpath for a noop inline.
|
||||||
|
if (CS.getNumPtrArgs() == 0 && CS.getRetVal().isNull())
|
||||||
|
return;
|
||||||
|
|
||||||
// If this is not a recursive call, clone the graph into this graph...
|
// If this is not a recursive call, clone the graph into this graph...
|
||||||
if (&Graph != this) {
|
if (&Graph != this) {
|
||||||
// Clone the callee's graph into the current graph, keeping track of where
|
// Clone the callee's graph into the current graph, keeping track of where
|
||||||
@ -1799,6 +1803,29 @@ void DSGraph::removeDeadNodes(unsigned Flags) {
|
|||||||
DEBUG(AssertGraphOK(); GlobalsGraph->AssertGraphOK());
|
DEBUG(AssertGraphOK(); GlobalsGraph->AssertGraphOK());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void DSGraph::AssertCallSiteInGraph(const DSCallSite &CS) const {
|
||||||
|
if (CS.isIndirectCall()) {
|
||||||
|
AssertNodeInGraph(CS.getCalleeNode());
|
||||||
|
#if 0
|
||||||
|
if (CS.getNumPtrArgs() && CS.getCalleeNode() == CS.getPtrArg(0).getNode() &&
|
||||||
|
CS.getCalleeNode() && CS.getCalleeNode()->getGlobals().empty())
|
||||||
|
std::cerr << "WARNING: WIERD CALL SITE FOUND!\n";
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
AssertNodeInGraph(CS.getRetVal().getNode());
|
||||||
|
for (unsigned j = 0, e = CS.getNumPtrArgs(); j != e; ++j)
|
||||||
|
AssertNodeInGraph(CS.getPtrArg(j).getNode());
|
||||||
|
}
|
||||||
|
|
||||||
|
void DSGraph::AssertCallNodesInGraph() const {
|
||||||
|
for (unsigned i = 0, e = FunctionCalls.size(); i != e; ++i)
|
||||||
|
AssertCallSiteInGraph(FunctionCalls[i]);
|
||||||
|
}
|
||||||
|
void DSGraph::AssertAuxCallNodesInGraph() const {
|
||||||
|
for (unsigned i = 0, e = AuxFunctionCalls.size(); i != e; ++i)
|
||||||
|
AssertCallSiteInGraph(AuxFunctionCalls[i]);
|
||||||
|
}
|
||||||
|
|
||||||
void DSGraph::AssertGraphOK() const {
|
void DSGraph::AssertGraphOK() const {
|
||||||
for (node_iterator NI = node_begin(), E = node_end(); NI != E; ++NI)
|
for (node_iterator NI = node_begin(), E = node_end(); NI != E; ++NI)
|
||||||
(*NI)->assertOK();
|
(*NI)->assertOK();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user