summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Analysis/DataStructure
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2005-03-18 23:19:47 +0000
committerChris Lattner <sabre@nondot.org>2005-03-18 23:19:47 +0000
commitbed1c18a443505c2af689045e7bbb6b1ba200150 (patch)
tree944e6fee6d263d51fd329effac8a43ba0a557556 /llvm/lib/Analysis/DataStructure
parent30525a04c1a3a5be02e914674f9383c21cbe37d1 (diff)
downloadbcm5719-llvm-bed1c18a443505c2af689045e7bbb6b1ba200150.tar.gz
bcm5719-llvm-bed1c18a443505c2af689045e7bbb6b1ba200150.zip
do not bother inlining nullary functions without return values. The only
effect these calls can have is due to global variables, and these passes all use the globals graph to capture their effect anyway. This speeds up the BU pass very slightly on perlbmk, reducing the number of dsnodes allocated from 98913 to 96423. llvm-svn: 20676
Diffstat (limited to 'llvm/lib/Analysis/DataStructure')
-rw-r--r--llvm/lib/Analysis/DataStructure/BottomUpClosure.cpp7
-rw-r--r--llvm/lib/Analysis/DataStructure/CompleteBottomUp.cpp6
-rw-r--r--llvm/lib/Analysis/DataStructure/EquivClassGraphs.cpp3
3 files changed, 15 insertions, 1 deletions
diff --git a/llvm/lib/Analysis/DataStructure/BottomUpClosure.cpp b/llvm/lib/Analysis/DataStructure/BottomUpClosure.cpp
index 91cfc7c14eb..7ab7d805643 100644
--- a/llvm/lib/Analysis/DataStructure/BottomUpClosure.cpp
+++ b/llvm/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/llvm/lib/Analysis/DataStructure/CompleteBottomUp.cpp b/llvm/lib/Analysis/DataStructure/CompleteBottomUp.cpp
index 5a0436c0616..a70080a8c66 100644
--- a/llvm/lib/Analysis/DataStructure/CompleteBottomUp.cpp
+++ b/llvm/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/llvm/lib/Analysis/DataStructure/EquivClassGraphs.cpp b/llvm/lib/Analysis/DataStructure/EquivClassGraphs.cpp
index ef78d66f7a5..c1789ef44a7 100644
--- a/llvm/lib/Analysis/DataStructure/EquivClassGraphs.cpp
+++ b/llvm/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.
OpenPOWER on IntegriCloud