summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Analysis/DataStructure/DataStructure.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2004-03-03 20:55:27 +0000
committerChris Lattner <sabre@nondot.org>2004-03-03 20:55:27 +0000
commit5fc189157ce13548e77b575fab97552e799ace9b (patch)
tree4e9e1abf65d2d084aa7ebbfafb53546a950d606d /llvm/lib/Analysis/DataStructure/DataStructure.cpp
parent06bd20676d3fb3fca62c522d1f9aa36725c3237e (diff)
downloadbcm5719-llvm-5fc189157ce13548e77b575fab97552e799ace9b.tar.gz
bcm5719-llvm-5fc189157ce13548e77b575fab97552e799ace9b.zip
Deinline methods, add fast exit
llvm-svn: 12102
Diffstat (limited to 'llvm/lib/Analysis/DataStructure/DataStructure.cpp')
-rw-r--r--llvm/lib/Analysis/DataStructure/DataStructure.cpp27
1 files changed, 27 insertions, 0 deletions
diff --git a/llvm/lib/Analysis/DataStructure/DataStructure.cpp b/llvm/lib/Analysis/DataStructure/DataStructure.cpp
index 3bae138d697..a99c59f927b 100644
--- a/llvm/lib/Analysis/DataStructure/DataStructure.cpp
+++ b/llvm/lib/Analysis/DataStructure/DataStructure.cpp
@@ -1191,6 +1191,10 @@ void DSGraph::mergeInGraph(const DSCallSite &CS, Function &F,
const DSGraph &Graph, unsigned CloneFlags) {
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 (&Graph != this) {
// 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());
}
+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 {
for (node_iterator NI = node_begin(), E = node_end(); NI != E; ++NI)
(*NI)->assertOK();
OpenPOWER on IntegriCloud