summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Analysis/DataStructure/EquivClassGraphs.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2005-03-19 22:23:45 +0000
committerChris Lattner <sabre@nondot.org>2005-03-19 22:23:45 +0000
commit9379e69af961cb6be0dcfd05d04ccb1b66dc8428 (patch)
tree66b252182fbaad752c619708f30fb878b0679c80 /llvm/lib/Analysis/DataStructure/EquivClassGraphs.cpp
parent403704830036ff302a1b29c1fd96a716d6535533 (diff)
downloadbcm5719-llvm-9379e69af961cb6be0dcfd05d04ccb1b66dc8428.tar.gz
bcm5719-llvm-9379e69af961cb6be0dcfd05d04ccb1b66dc8428.zip
Create an equivalence class of global variables that DSA will never be able
to tell apart anyway, and only track the leader for of these equivalence classes in our graphs. This dramatically reduces the number of GlobalValue*'s that appear in scalar maps, which A) reduces memory usage, by eliminating many many scalarmap entries and B) reduces time for operations that need to execute an operation for each global in the scalar map. As an example, this reduces the memory used to analyze 176.gcc from 1GB to 511MB, which (while it's still way too much) is better because it doesn't hit swap anymore. On eon, this shrinks the local graphs from 14MB to 6.8MB, shrinks the bu+td graphs of povray from 50M to 40M, shrinks the TD graphs of 130.li from 8.8M to 3.6M, etc. This change also speeds up DSA on large programs where this makes a big difference. For example, 130.li goes from 1.17s -> 0.56s, 134.perl goes from 2.14 -> 0.93s, povray goes from 15.63s->7.99s (!!!). This also apparently either fixes the problem that caused DSA to crash on perlbmk and gcc, or it hides it, because DSA now works on these. These both take entirely too much time in the TD pass (147s for perl, 538s for gcc, vs 7.67/5.9s in the bu pass for either one), but this is a known problem that I'll deal with later. llvm-svn: 20696
Diffstat (limited to 'llvm/lib/Analysis/DataStructure/EquivClassGraphs.cpp')
-rw-r--r--llvm/lib/Analysis/DataStructure/EquivClassGraphs.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/llvm/lib/Analysis/DataStructure/EquivClassGraphs.cpp b/llvm/lib/Analysis/DataStructure/EquivClassGraphs.cpp
index 02b7fb7d824..447b36d7808 100644
--- a/llvm/lib/Analysis/DataStructure/EquivClassGraphs.cpp
+++ b/llvm/lib/Analysis/DataStructure/EquivClassGraphs.cpp
@@ -72,9 +72,10 @@ Function *EquivClassGraphs::getSomeCalleeForCallSite(const CallSite &CS) const{
//
bool EquivClassGraphs::runOnModule(Module &M) {
CBU = &getAnalysis<CompleteBUDataStructures>();
+ GlobalECs = CBU->getGlobalECs();
DEBUG(CheckAllGraphs(&M, *CBU));
- GlobalsGraph = new DSGraph(CBU->getGlobalsGraph());
+ GlobalsGraph = new DSGraph(CBU->getGlobalsGraph(), GlobalECs);
GlobalsGraph->setPrintAuxCalls();
ActualCallees = CBU->getActualCallees();
@@ -305,7 +306,7 @@ DSGraph &EquivClassGraphs::getOrCreateGraph(Function &F) {
DSGraph &CBUGraph = CBU->getDSGraph(F);
// Copy the CBU graph...
- Graph = new DSGraph(CBUGraph); // updates the map via reference
+ Graph = new DSGraph(CBUGraph, GlobalECs); // updates the map via reference
Graph->setGlobalsGraph(&getGlobalsGraph());
Graph->setPrintAuxCalls();
OpenPOWER on IntegriCloud