aboutsummaryrefslogtreecommitdiff
path: root/lib/Analysis/DataStructure/TopDownClosure.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2004-01-28 03:12:48 +0000
committerChris Lattner <sabre@nondot.org>2004-01-28 03:12:48 +0000
commit6d8f3dcd75c784caba92042f1a5184ed0a8ad175 (patch)
treebc7f4d85f4e40f4650667284436a5fc158be14b8 /lib/Analysis/DataStructure/TopDownClosure.cpp
parent34741cf0ddf947132781a42a1613ba20c1d8b9c1 (diff)
In the TD pass, iterate over globals directly instead of through the whole scalar
map. This saves 5s in the TD pass, from 22->17s on perlbmk git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10998 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis/DataStructure/TopDownClosure.cpp')
-rw-r--r--lib/Analysis/DataStructure/TopDownClosure.cpp17
1 files changed, 8 insertions, 9 deletions
diff --git a/lib/Analysis/DataStructure/TopDownClosure.cpp b/lib/Analysis/DataStructure/TopDownClosure.cpp
index 67ea400dce..45c1788e7a 100644
--- a/lib/Analysis/DataStructure/TopDownClosure.cpp
+++ b/lib/Analysis/DataStructure/TopDownClosure.cpp
@@ -60,7 +60,7 @@ bool TDDataStructures::run(Module &M) {
// they are accessible outside this compilation unit. Currently, these
// arguments are functions which are reachable by global variables in the
// globals graph.
- const DSGraph::ScalarMapTy &GGSM = GlobalsGraph->getScalarMap();
+ const DSScalarMap &GGSM = GlobalsGraph->getScalarMap();
hash_set<DSNode*> Visited;
for (DSScalarMap::global_iterator I = GGSM.global_begin(), E = GGSM.global_end();
I != E; ++I)
@@ -260,14 +260,13 @@ void TDDataStructures::inlineGraphIntoCallees(DSGraph &Graph) {
ReachabilityCloner RC(CalleeGraph, Graph, DSGraph::StripModRefBits);
// Clone over any global nodes that appear in both graphs.
- for (DSGraph::ScalarMapTy::const_iterator
- SI = CalleeGraph.getScalarMap().begin(),
- SE = CalleeGraph.getScalarMap().end(); SI != SE; ++SI)
- if (GlobalValue *GV = dyn_cast<GlobalValue>(SI->first)) {
- DSGraph::ScalarMapTy::const_iterator GI = Graph.getScalarMap().find(GV);
- if (GI != Graph.getScalarMap().end())
- RC.merge(SI->second, GI->second);
- }
+ for (DSScalarMap::global_iterator
+ SI = CalleeGraph.getScalarMap().global_begin(),
+ SE = CalleeGraph.getScalarMap().global_end(); SI != SE; ++SI) {
+ DSScalarMap::const_iterator GI = Graph.getScalarMap().find(*SI);
+ if (GI != Graph.getScalarMap().end())
+ RC.merge(CalleeGraph.getNodeForValue(*SI), GI->second);
+ }
// Loop over all of the distinct call sites in the caller of the callee.
for (; CSI != CallSites.end() && CSI->first == &CalleeGraph; ++CSI) {