aboutsummaryrefslogtreecommitdiff
path: root/lib/Analysis/DataStructure/Steensgaard.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2003-02-05 21:59:58 +0000
committerChris Lattner <sabre@nondot.org>2003-02-05 21:59:58 +0000
commit923fc05b3a95efad270b283f97b2670152a41efb (patch)
treef57c34bd5de4a4e4b59c46847c9da54894f2bf9e /lib/Analysis/DataStructure/Steensgaard.cpp
parentbbe5ac1458f3719fd51785f086e9166ccbb0c464 (diff)
Implement optimization for direct function call case. This dramatically
reduces the number of function nodes created and speeds up analysis by about 10% overall. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5495 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis/DataStructure/Steensgaard.cpp')
-rw-r--r--lib/Analysis/DataStructure/Steensgaard.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/Analysis/DataStructure/Steensgaard.cpp b/lib/Analysis/DataStructure/Steensgaard.cpp
index b166ff1ec3..d7a4948205 100644
--- a/lib/Analysis/DataStructure/Steensgaard.cpp
+++ b/lib/Analysis/DataStructure/Steensgaard.cpp
@@ -163,8 +163,12 @@ bool Steens::run(Module &M) {
DSCallSite &CurCall = Calls[i];
// Loop over the called functions, eliminating as many as possible...
- std::vector<GlobalValue*> CallTargets =
- CurCall.getCallee().getNode()->getGlobals();
+ std::vector<GlobalValue*> CallTargets;
+ if (CurCall.isDirectCall())
+ CallTargets.push_back(CurCall.getCalleeFunc());
+ else
+ CallTargets = CurCall.getCalleeNode()->getGlobals();
+
for (unsigned c = 0; c != CallTargets.size(); ) {
// If we can eliminate this function call, do so!
bool Eliminated = false;