diff options
| author | Chris Lattner <sabre@nondot.org> | 2003-02-05 21:59:58 +0000 |
|---|---|---|
| committer | Chris Lattner <sabre@nondot.org> | 2003-02-05 21:59:58 +0000 |
| commit | 80614ee5ef9129cb3d6a7eefccad0ec31fd2e3a3 (patch) | |
| tree | 3f673a8f067a74d590664cac2261c794015f6905 /llvm/lib/Analysis/DataStructure/Steensgaard.cpp | |
| parent | 5981c63e6e0a339c49441235a68426ed159b3cd6 (diff) | |
| download | bcm5719-llvm-80614ee5ef9129cb3d6a7eefccad0ec31fd2e3a3.tar.gz bcm5719-llvm-80614ee5ef9129cb3d6a7eefccad0ec31fd2e3a3.zip | |
Implement optimization for direct function call case. This dramatically
reduces the number of function nodes created and speeds up analysis by
about 10% overall.
llvm-svn: 5495
Diffstat (limited to 'llvm/lib/Analysis/DataStructure/Steensgaard.cpp')
| -rw-r--r-- | llvm/lib/Analysis/DataStructure/Steensgaard.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/llvm/lib/Analysis/DataStructure/Steensgaard.cpp b/llvm/lib/Analysis/DataStructure/Steensgaard.cpp index b166ff1ec3a..d7a49482051 100644 --- a/llvm/lib/Analysis/DataStructure/Steensgaard.cpp +++ b/llvm/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; |

