summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Analysis/DataStructure
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
commit63c649a9fad85e78946d98a22c96853efe22d768 (patch)
treefcaf367b85c728b901b73b091f4804b80285725d /llvm/lib/Analysis/DataStructure
parent0c0e0d8d6c61df2b65d58442148a8640e97eaa16 (diff)
downloadbcm5719-llvm-63c649a9fad85e78946d98a22c96853efe22d768.tar.gz
bcm5719-llvm-63c649a9fad85e78946d98a22c96853efe22d768.zip
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. llvm-svn: 10996
Diffstat (limited to 'llvm/lib/Analysis/DataStructure')
-rw-r--r--llvm/lib/Analysis/DataStructure/DataStructure.cpp15
1 files changed, 7 insertions, 8 deletions
diff --git a/llvm/lib/Analysis/DataStructure/DataStructure.cpp b/llvm/lib/Analysis/DataStructure/DataStructure.cpp
index a4038052a7b..0e7d3e69b9d 100644
--- a/llvm/lib/Analysis/DataStructure/DataStructure.cpp
+++ b/llvm/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();
OpenPOWER on IntegriCloud