summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Analysis/DataStructure
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
commit5e14d69d6ba113ab0adfe58f3fa810e9705846d1 (patch)
treec15b1398e917c36a0fb97d042f10c54725c1a415 /llvm/lib/Analysis/DataStructure
parent461310139ae1a735cf987261083fc9f673cc5cd0 (diff)
downloadbcm5719-llvm-5e14d69d6ba113ab0adfe58f3fa810e9705846d1.tar.gz
bcm5719-llvm-5e14d69d6ba113ab0adfe58f3fa810e9705846d1.zip
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 llvm-svn: 10998
Diffstat (limited to 'llvm/lib/Analysis/DataStructure')
-rw-r--r--llvm/lib/Analysis/DataStructure/TopDownClosure.cpp17
1 files changed, 8 insertions, 9 deletions
diff --git a/llvm/lib/Analysis/DataStructure/TopDownClosure.cpp b/llvm/lib/Analysis/DataStructure/TopDownClosure.cpp
index 67ea400dced..45c1788e7a2 100644
--- a/llvm/lib/Analysis/DataStructure/TopDownClosure.cpp
+++ b/llvm/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) {
OpenPOWER on IntegriCloud