[llvm-commits] [poolalloc] r78617 - in /poolalloc/trunk/lib/rDSA: BottomUpClosure.cpp DataStructure.cpp Steensgaard.cpp TopDownClosure.cpp
Andrew Lenharth
alenhar2 at cs.uiuc.edu
Mon Aug 10 16:40:46 PDT 2009
Author: alenhar2
Date: Mon Aug 10 18:40:45 2009
New Revision: 78617
URL: http://llvm.org/viewvc/llvm-project?rev=78617&view=rev
Log:
do away with setGlobalsGrpah
Modified:
poolalloc/trunk/lib/rDSA/BottomUpClosure.cpp
poolalloc/trunk/lib/rDSA/DataStructure.cpp
poolalloc/trunk/lib/rDSA/Steensgaard.cpp
poolalloc/trunk/lib/rDSA/TopDownClosure.cpp
Modified: poolalloc/trunk/lib/rDSA/BottomUpClosure.cpp
URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/lib/rDSA/BottomUpClosure.cpp?rev=78617&r1=78616&r2=78617&view=diff
==============================================================================
--- poolalloc/trunk/lib/rDSA/BottomUpClosure.cpp (original)
+++ poolalloc/trunk/lib/rDSA/BottomUpClosure.cpp Mon Aug 10 18:40:45 2009
@@ -516,8 +516,8 @@
E = CalledFuncs.end();
// Start with a copy of the first graph.
- GI = IndCallGraph.first = new DSGraph(getDSGraph(*I), GlobalECs);
- GI->setGlobalsGraph(Graph->getGlobalsGraph());
+ GI = IndCallGraph.first =
+ new DSGraph(getDSGraph(*I), GlobalECs, Graph->getGlobalsGraph(), 0);
std::vector<DSNodeHandle> &Args = IndCallGraph.second;
// Get the argument nodes for the first callee. The return value is
@@ -665,8 +665,8 @@
E = CalledFuncs.end();
// Start with a copy of the first graph.
- GI = IndCallGraph.first = new DSGraph(getDSGraph(*I), GlobalECs);
- GI->setGlobalsGraph(Graph->getGlobalsGraph());
+ GI = IndCallGraph.first =
+ new DSGraph(getDSGraph(*I), GlobalECs, Graph->getGlobalsGraph(), 0);
std::vector<DSNodeHandle> &Args = IndCallGraph.second;
// Get the argument nodes for the first callee. The return value is
Modified: poolalloc/trunk/lib/rDSA/DataStructure.cpp
URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/lib/rDSA/DataStructure.cpp?rev=78617&r1=78616&r2=78617&view=diff
==============================================================================
--- poolalloc/trunk/lib/rDSA/DataStructure.cpp (original)
+++ poolalloc/trunk/lib/rDSA/DataStructure.cpp Mon Aug 10 18:40:45 2009
@@ -1420,8 +1420,8 @@
DSGraph::DSGraph(DSGraph* G, EquivalenceClasses<const GlobalValue*> &ECs,
- unsigned CloneFlags)
- : GlobalsGraph(0), ScalarMap(ECs), TD(G->TD) {
+ DSGraph* GG, unsigned CloneFlags)
+ : GlobalsGraph(GG), ScalarMap(ECs), TD(G->TD) {
PrintAuxCalls = false;
cloneInto(G, CloneFlags);
}
@@ -2684,7 +2684,7 @@
if (Function *FromF = dyn_cast<Function>(From)) {
Function *ToF = cast<Function>(To);
assert(!DSInfo.count(ToF) && "New Function already exists!");
- DSGraph *NG = new DSGraph(getDSGraph(FromF), GlobalECs);
+ DSGraph *NG = new DSGraph(getDSGraph(FromF), GlobalECs, GlobalsGraph, 0);
DSInfo[ToF] = NG;
assert(NG->getReturnNodes().size() == 1 && "Cannot copy SCC's yet!");
@@ -2713,15 +2713,16 @@
//Clone or Steal the Source Graph
DSGraph* BaseGraph = GraphSource->getDSGraph(F);
if (Clone) {
- G = new DSGraph(BaseGraph, GlobalECs, DSGraph::DontCloneAuxCallNodes);
+ G = new DSGraph(BaseGraph, GlobalECs, GlobalsGraph,
+ DSGraph::DontCloneAuxCallNodes);
} else {
- G = new DSGraph(GlobalECs, GraphSource->getTargetData());
+ G = new DSGraph(GlobalECs, GraphSource->getTargetData(),
+ GlobalsGraph);
G->spliceFrom(BaseGraph);
if (resetAuxCalls)
G->getAuxFunctionCalls() = G->getFunctionCalls();
}
G->setPrintAuxCalls();
- G->setGlobalsGraph(GlobalsGraph);
// Note that this graph is the graph for ALL of the function in the SCC, not
// just F.
@@ -2838,7 +2839,7 @@
TD = D->TD;
ActualCallees = D->ActualCallees;
GlobalECs = D->getGlobalECs();
- GlobalsGraph = new DSGraph(D->getGlobalsGraph(), GlobalECs,
+ GlobalsGraph = new DSGraph(D->getGlobalsGraph(), GlobalECs, 0,
copyGlobalAuxCalls?0:DSGraph::DontCloneAuxCallNodes);
if (printAuxCalls) GlobalsGraph->setPrintAuxCalls();
@@ -2853,7 +2854,7 @@
GraphSource = 0;
Clone = false;
TD = T;
- GlobalsGraph = new DSGraph(GlobalECs, *T);
+ GlobalsGraph = new DSGraph(GlobalECs, *T, 0);
}
void DataStructures::releaseMemory() {
Modified: poolalloc/trunk/lib/rDSA/Steensgaard.cpp
URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/lib/rDSA/Steensgaard.cpp?rev=78617&r1=78616&r2=78617&view=diff
==============================================================================
--- poolalloc/trunk/lib/rDSA/Steensgaard.cpp (original)
+++ poolalloc/trunk/lib/rDSA/Steensgaard.cpp Mon Aug 10 18:40:45 2009
@@ -59,13 +59,10 @@
// Get a copy for the globals graph.
DSGraph * GG = DS->getGlobalsGraph();
- GlobalsGraph = new DSGraph(GG, GG->getGlobalECs());
+ GlobalsGraph = new DSGraph(GG, GG->getGlobalECs(), 0, 0);
// Create a new, empty, graph...
- ResultGraph = new DSGraph(GG->getGlobalECs(), getTargetData());
- ResultGraph->setGlobalsGraph(GlobalsGraph);
- // ResultGraph->spliceFrom(DS->getGlobalsGraph());
-
+ ResultGraph = new DSGraph(GG->getGlobalECs(), getTargetData(), GlobalsGraph);
// Loop over the rest of the module, merging graphs for non-external functions
// into this graph.
Modified: poolalloc/trunk/lib/rDSA/TopDownClosure.cpp
URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/lib/rDSA/TopDownClosure.cpp?rev=78617&r1=78616&r2=78617&view=diff
==============================================================================
--- poolalloc/trunk/lib/rDSA/TopDownClosure.cpp (original)
+++ poolalloc/trunk/lib/rDSA/TopDownClosure.cpp Mon Aug 10 18:40:45 2009
@@ -344,7 +344,7 @@
IndCallGraph = IndCallRecI->second;
} else {
// Otherwise, create a new DSGraph to represent this.
- IndCallGraph = new DSGraph(DSG->getGlobalECs(), DSG->getTargetData());
+ IndCallGraph = new DSGraph(DSG->getGlobalECs(), DSG->getTargetData(), GlobalsGraph);
// Make a nullary dummy call site, which will eventually get some content
// merged into it. The actual callee function doesn't matter here, so we
// just pass it something to keep the ctor happy.
More information about the llvm-commits
mailing list