diff options
-rw-r--r-- | lib/Analysis/DataStructure/BottomUpClosure.cpp | 7 | ||||
-rw-r--r-- | lib/Analysis/DataStructure/CompleteBottomUp.cpp | 6 | ||||
-rw-r--r-- | lib/Analysis/DataStructure/EquivClassGraphs.cpp | 3 |
3 files changed, 15 insertions, 1 deletions
diff --git a/lib/Analysis/DataStructure/BottomUpClosure.cpp b/lib/Analysis/DataStructure/BottomUpClosure.cpp index 91cfc7c..7ab7d80 100644 --- a/lib/Analysis/DataStructure/BottomUpClosure.cpp +++ b/lib/Analysis/DataStructure/BottomUpClosure.cpp @@ -305,6 +305,13 @@ void BUDataStructures::calculateGraph(DSGraph &Graph) { CalledFuncs.clear(); + // Fast path for noop calls. Note that we don't care about merging globals + // in the callee with nodes in the caller here. + if (CS.getRetVal().isNull() && CS.getNumPtrArgs() == 0) { + TempFCs.erase(TempFCs.begin()); + continue; + } + if (CS.isDirectCall()) { Function *F = CS.getCalleeFunc(); if (isResolvableFunc(F)) diff --git a/lib/Analysis/DataStructure/CompleteBottomUp.cpp b/lib/Analysis/DataStructure/CompleteBottomUp.cpp index 5a0436c..a70080a 100644 --- a/lib/Analysis/DataStructure/CompleteBottomUp.cpp +++ b/lib/Analysis/DataStructure/CompleteBottomUp.cpp @@ -217,7 +217,11 @@ void CompleteBUDataStructures::processGraph(DSGraph &G) { assert(calls.insert(TheCall).second && "Call instruction occurs multiple times in graph??"); - + + // Fast path for noop calls. Note that we don't care about merging globals + // in the callee with nodes in the caller here. + if (CS.getRetVal().isNull() && CS.getNumPtrArgs() == 0) + continue; // Loop over all of the potentially called functions... // Inline direct calls as well as indirect calls because the direct diff --git a/lib/Analysis/DataStructure/EquivClassGraphs.cpp b/lib/Analysis/DataStructure/EquivClassGraphs.cpp index ef78d66..c1789ef 100644 --- a/lib/Analysis/DataStructure/EquivClassGraphs.cpp +++ b/lib/Analysis/DataStructure/EquivClassGraphs.cpp @@ -406,6 +406,9 @@ void EquivClassGraphs::processGraph(DSGraph &G) { assert(calls.insert(TheCall).second && "Call instruction occurs multiple times in graph??"); + if (CS.getRetVal().isNull() && CS.getNumPtrArgs() == 0) + continue; + // Inline the common callee graph into the current graph, if the callee // graph has not changed. Note that all callees should have the same // graph so we only need to do this once. |