aboutsummaryrefslogtreecommitdiff
path: root/lib/Analysis/DataStructure/DataStructure.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2004-01-28 03:03:06 +0000
committerChris Lattner <sabre@nondot.org>2004-01-28 03:03:06 +0000
commitbdce7b78442b719256e914a983fcb58873f7d5b5 (patch)
tree99de50b27ac0053f53a85f994a2ef3e532d58740 /lib/Analysis/DataStructure/DataStructure.cpp
parent14c67ccf02ab1de28c7e726493619881a41c4438 (diff)
In updateFromGlobalsGraph, instead of iterating over all of the scalars in the
function to find the globals, iterate over all of the globals directly. This speeds the function up from 14s to 6.3s on perlbmk, reducing DSA time from 53->46s. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10996 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis/DataStructure/DataStructure.cpp')
-rw-r--r--lib/Analysis/DataStructure/DataStructure.cpp15
1 files changed, 7 insertions, 8 deletions
diff --git a/lib/Analysis/DataStructure/DataStructure.cpp b/lib/Analysis/DataStructure/DataStructure.cpp
index a4038052a7..0e7d3e69b9 100644
--- a/lib/Analysis/DataStructure/DataStructure.cpp
+++ b/lib/Analysis/DataStructure/DataStructure.cpp
@@ -1064,14 +1064,13 @@ void DSGraph::updateFromGlobalGraph() {
ReachabilityCloner RC(*this, *GlobalsGraph, 0);
// Clone the non-up-to-date global nodes into this graph.
- for (ScalarMapTy::const_iterator I = getScalarMap().begin(),
- E = getScalarMap().end(); I != E; ++I)
- if (GlobalValue* GV = dyn_cast<GlobalValue>(I->first))
- if (InlinedGlobals.count(GV) == 0) { // GNode is not up-to-date
- ScalarMapTy::iterator It = GlobalsGraph->ScalarMap.find(GV);
- if (It != GlobalsGraph->ScalarMap.end())
- RC.merge(I->second, It->second);
- }
+ for (DSScalarMap::global_iterator I = getScalarMap().global_begin(),
+ E = getScalarMap().global_end(); I != E; ++I)
+ if (InlinedGlobals.count(*I) == 0) { // GNode is not up-to-date
+ ScalarMapTy::iterator It = GlobalsGraph->ScalarMap.find(*I);
+ if (It != GlobalsGraph->ScalarMap.end())
+ RC.merge(getNodeForValue(*I), It->second);
+ }
// Merging global nodes leaves behind unused nodes: get rid of them now.
removeTriviallyDeadNodes();