[llvm-commits] [poolalloc] r116896 - in /poolalloc/trunk: include/dsa/DSGraph.h include/dsa/DataStructure.h include/rdsa/DSGraph.h include/rdsa/DataStructure.h lib/DSA/DSGraph.cpp lib/DSA/DSTest.cpp lib/DSA/DataStructure.cpp lib/DSA/Printer.cpp lib/rDSA/DataStructure.cpp lib/rDSA/Printer.cpp
Arushi Aggarwal
aggarwa4 at illinois.edu
Tue Oct 19 18:05:13 PDT 2010
Author: aggarwa4
Date: Tue Oct 19 20:05:12 2010
New Revision: 116896
URL: http://llvm.org/viewvc/llvm-project?rev=116896&view=rev
Log:
Rename PrintAuxCalls to UseAuxCalls
Modified:
poolalloc/trunk/include/dsa/DSGraph.h
poolalloc/trunk/include/dsa/DataStructure.h
poolalloc/trunk/include/rdsa/DSGraph.h
poolalloc/trunk/include/rdsa/DataStructure.h
poolalloc/trunk/lib/DSA/DSGraph.cpp
poolalloc/trunk/lib/DSA/DSTest.cpp
poolalloc/trunk/lib/DSA/DataStructure.cpp
poolalloc/trunk/lib/DSA/Printer.cpp
poolalloc/trunk/lib/rDSA/DataStructure.cpp
poolalloc/trunk/lib/rDSA/Printer.cpp
Modified: poolalloc/trunk/include/dsa/DSGraph.h
URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/include/dsa/DSGraph.h?rev=116896&r1=116895&r2=116896&view=diff
==============================================================================
--- poolalloc/trunk/include/dsa/DSGraph.h (original)
+++ poolalloc/trunk/include/dsa/DSGraph.h Tue Oct 19 20:05:12 2010
@@ -209,7 +209,15 @@
typedef std::multimap<DSNodeHandle, const DSNode*> InvNodeMapTy;
private:
DSGraph *GlobalsGraph; // Pointer to the common graph of global objects
- bool PrintAuxCalls; // Should this graph print the Aux calls vector?
+
+ // This is use to differentiate between Local and the rest of the passes.
+ // Local should use the FunctionCalls vector that has all the DSCallSites.
+ // All other passes, shoud use the Aux calls vector, as they process and
+ // subsequently might remove some DSCall Sites. Once those call sites
+ // have been resolved, we must not revisit them again.
+ // UseAuxCalls is false for Local. And true for the other passes.
+
+ bool UseAuxCalls; // Should this pass use the Aux calls vector?
NodeListTy Nodes;
ScalarMapTy ScalarMap;
@@ -251,7 +259,7 @@
DSGraph(EquivalenceClasses<const GlobalValue*> &ECs, const TargetData &td,
SuperSet<const Type*>& tss,
DSGraph *GG = 0)
- :GlobalsGraph(GG), PrintAuxCalls(false),
+ :GlobalsGraph(GG), UseAuxCalls(false),
ScalarMap(ECs), TD(td), TypeSS(tss)
{ }
@@ -285,11 +293,11 @@
///
const TargetData &getTargetData() const { return TD; }
- /// setPrintAuxCalls - If you call this method, the auxillary call vector will
- /// be printed instead of the standard call vector to the dot file.
+ /// setUseAuxCalls - If you call this method, the auxillary call vector will
+ /// be used instead of the standard call vector to the dot file.
///
- void setPrintAuxCalls() { PrintAuxCalls = true; }
- bool shouldPrintAuxCalls() const { return PrintAuxCalls; }
+ void setUseAuxCalls() { UseAuxCalls = true; }
+ bool shouldUseAuxCalls() const { return UseAuxCalls; }
/// node_iterator/begin/end - Iterate over all of the nodes in the graph. Be
/// extremely careful with these methods because any merging of nodes could
Modified: poolalloc/trunk/include/dsa/DataStructure.h
URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/include/dsa/DataStructure.h?rev=116896&r1=116895&r2=116896&view=diff
==============================================================================
--- poolalloc/trunk/include/dsa/DataStructure.h (original)
+++ poolalloc/trunk/include/dsa/DataStructure.h Tue Oct 19 20:05:12 2010
@@ -81,7 +81,7 @@
// Callgraph, as computed so far
DSCallGraph callgraph;
- void init(DataStructures* D, bool clone, bool printAuxCalls, bool copyGlobalAuxCalls, bool resetAux);
+ void init(DataStructures* D, bool clone, bool useAuxCalls, bool copyGlobalAuxCalls, bool resetAux);
void init(TargetData* T);
void formGlobalECs();
Modified: poolalloc/trunk/include/rdsa/DSGraph.h
URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/include/rdsa/DSGraph.h?rev=116896&r1=116895&r2=116896&view=diff
==============================================================================
--- poolalloc/trunk/include/rdsa/DSGraph.h (original)
+++ poolalloc/trunk/include/rdsa/DSGraph.h Tue Oct 19 20:05:12 2010
@@ -209,7 +209,7 @@
typedef hash_multimap<DSNodeHandle, const DSNode*> InvNodeMapTy;
private:
DSGraph *GlobalsGraph; // Pointer to the common graph of global objects
- bool PrintAuxCalls; // Should this graph print the Aux calls vector?
+ bool UseAuxCalls; // Should this graph print the Aux calls vector?
NodeListTy Nodes;
ScalarMapTy ScalarMap;
@@ -244,7 +244,7 @@
// Create a new, empty, DSGraph.
DSGraph(EquivalenceClasses<const GlobalValue*> &ECs, const TargetData &td,
DSGraph *GG)
- :GlobalsGraph(GG), PrintAuxCalls(false),
+ :GlobalsGraph(GG), UseAuxCalls(false),
ScalarMap(ECs), TD(td)
{ }
@@ -272,11 +272,11 @@
///
const TargetData &getTargetData() const { return TD; }
- /// setPrintAuxCalls - If you call this method, the auxillary call vector will
+ /// setUseAuxCalls - If you call this method, the auxillary call vector will
/// be printed instead of the standard call vector to the dot file.
///
- void setPrintAuxCalls() { PrintAuxCalls = true; }
- bool shouldPrintAuxCalls() const { return PrintAuxCalls; }
+ void setUseAuxCalls() { UseAuxCalls = true; }
+ bool shouldUseAuxCalls() const { return UseAuxCalls; }
/// node_iterator/begin/end - Iterate over all of the nodes in the graph. Be
/// extremely careful with these methods because any merging of nodes could
Modified: poolalloc/trunk/include/rdsa/DataStructure.h
URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/include/rdsa/DataStructure.h?rev=116896&r1=116895&r2=116896&view=diff
==============================================================================
--- poolalloc/trunk/include/rdsa/DataStructure.h (original)
+++ poolalloc/trunk/include/rdsa/DataStructure.h Tue Oct 19 20:05:12 2010
@@ -131,7 +131,7 @@
EquivalenceClasses<const GlobalValue*> GlobalECs;
- void init(DataStructures* D, bool clone, bool printAuxCalls, bool copyGlobalAuxCalls, bool resetAux);
+ void init(DataStructures* D, bool clone, bool useAuxCalls, bool copyGlobalAuxCalls, bool resetAux);
void init(TargetData* T);
void formGlobalECs();
Modified: poolalloc/trunk/lib/DSA/DSGraph.cpp
URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/lib/DSA/DSGraph.cpp?rev=116896&r1=116895&r2=116896&view=diff
==============================================================================
--- poolalloc/trunk/lib/DSA/DSGraph.cpp (original)
+++ poolalloc/trunk/lib/DSA/DSGraph.cpp Tue Oct 19 20:05:12 2010
@@ -99,7 +99,7 @@
SuperSet<const Type*>& tss,
unsigned CloneFlags)
: GlobalsGraph(0), ScalarMap(ECs), TD(G->TD), TypeSS(tss) {
- PrintAuxCalls = false;
+ UseAuxCalls = false;
cloneInto(G, CloneFlags);
}
@@ -639,7 +639,7 @@
}
// Mark stuff passed into functions calls as being incomplete.
- if (!shouldPrintAuxCalls())
+ if (!shouldUseAuxCalls())
for (std::list<DSCallSite>::iterator I = FunctionCalls.begin(),
E = FunctionCalls.end(); I != E; ++I)
markIncomplete(*I);
@@ -1582,7 +1582,7 @@
//
// Get the list of unresolved call sites.
//
- const std::list<DSCallSite>& Calls = getAuxFunctionCalls();
+ const std::list<DSCallSite>& Calls = getFunctionCalls();
for (std::list<DSCallSite>::const_iterator ii = Calls.begin(),
ee = Calls.end();
ii != ee; ++ii) {
Modified: poolalloc/trunk/lib/DSA/DSTest.cpp
URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/lib/DSA/DSTest.cpp?rev=116896&r1=116895&r2=116896&view=diff
==============================================================================
--- poolalloc/trunk/lib/DSA/DSTest.cpp (original)
+++ poolalloc/trunk/lib/DSA/DSTest.cpp Tue Oct 19 20:05:12 2010
@@ -15,6 +15,8 @@
// -print-only-types Only print the types for the given values
// -check-same-node=<list> Verify the given values' nodes were merged.
// -check-not-same-node=<list> Verify the given values' nodes weren't merged.
+// -check-type=<list>,type Verify the given nodes have the given type
+// -check-callees=caller,<list> Verify the given caller has the following callees
// -verify-flags=<list> Verify the given values match the flag specifications.
//
// In general a 'value' query on the DSA results looks like this:
@@ -548,6 +550,7 @@
/// functions in the list
static bool checkCallees(llvm::raw_ostream &O, const Module *M, const DataStructures *DS) {
+ //Mangled names must be provided for C++
cl::list<std::string>::iterator I = CheckCallees.begin(),
E = CheckCallees.end();
// If the user specified that a set of values should be in the same node...
Modified: poolalloc/trunk/lib/DSA/DataStructure.cpp
URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/lib/DSA/DataStructure.cpp?rev=116896&r1=116895&r2=116896&view=diff
==============================================================================
--- poolalloc/trunk/lib/DSA/DataStructure.cpp (original)
+++ poolalloc/trunk/lib/DSA/DataStructure.cpp Tue Oct 19 20:05:12 2010
@@ -1259,7 +1259,7 @@
if (resetAuxCalls)
G->getAuxFunctionCalls() = G->getFunctionCalls();
}
- G->setPrintAuxCalls();
+ G->setUseAuxCalls();
G->setGlobalsGraph(GlobalsGraph);
// Note that this graph is the graph for ALL of the function in the SCC, not
@@ -1373,7 +1373,7 @@
DEBUG(if(MadeChange) G.AssertGraphOK());
}
-void DataStructures::init(DataStructures* D, bool clone, bool printAuxCalls,
+void DataStructures::init(DataStructures* D, bool clone, bool useAuxCalls,
bool copyGlobalAuxCalls, bool resetAux) {
assert (!GraphSource && "Already init");
GraphSource = D;
@@ -1386,7 +1386,7 @@
GlobalsGraph = new DSGraph(D->getGlobalsGraph(), GlobalECs, *TypeSS,
copyGlobalAuxCalls? DSGraph::CloneAuxCallNodes
:DSGraph::DontCloneAuxCallNodes);
- if (printAuxCalls) GlobalsGraph->setPrintAuxCalls();
+ if (useAuxCalls) GlobalsGraph->setUseAuxCalls();
//
// Tell the other DSA pass if we're stealing its graph.
Modified: poolalloc/trunk/lib/DSA/Printer.cpp
URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/lib/DSA/Printer.cpp?rev=116896&r1=116895&r2=116896&view=diff
==============================================================================
--- poolalloc/trunk/lib/DSA/Printer.cpp (original)
+++ poolalloc/trunk/lib/DSA/Printer.cpp Tue Oct 19 20:05:12 2010
@@ -246,7 +246,7 @@
// Output all of the call nodes...
const std::list<DSCallSite> &FCs =
- G->shouldPrintAuxCalls() ? G->getAuxFunctionCalls()
+ G->shouldUseAuxCalls() ? G->getAuxFunctionCalls()
: G->getFunctionCalls();
for (std::list<DSCallSite>::const_iterator I = FCs.begin(), E = FCs.end();
I != E; ++I) {
@@ -305,7 +305,7 @@
if (!Error.size()) {
print(F);
- unsigned NumCalls = shouldPrintAuxCalls() ?
+ unsigned NumCalls = shouldUseAuxCalls() ?
getAuxFunctionCalls().size() : getFunctionCalls().size();
O << " [" << getGraphSize() << "+" << NumCalls << "]\n";
} else {
@@ -333,7 +333,7 @@
for (Module::const_iterator I = M->begin(), E = M->end(); I != E; ++I)
if (C.hasDSGraph(*I)) {
DSGraph* Gr = C.getDSGraph((Function&)*I);
- unsigned NumCalls = Gr->shouldPrintAuxCalls() ?
+ unsigned NumCalls = Gr->shouldUseAuxCalls() ?
Gr->getAuxFunctionCalls().size() : Gr->getFunctionCalls().size();
bool IsDuplicateGraph = false;
Modified: poolalloc/trunk/lib/rDSA/DataStructure.cpp
URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/lib/rDSA/DataStructure.cpp?rev=116896&r1=116895&r2=116896&view=diff
==============================================================================
--- poolalloc/trunk/lib/rDSA/DataStructure.cpp (original)
+++ poolalloc/trunk/lib/rDSA/DataStructure.cpp Tue Oct 19 20:05:12 2010
@@ -1245,7 +1245,7 @@
DSGraph::DSGraph(DSGraph* G, EquivalenceClasses<const GlobalValue*> &ECs,
DSGraph* GG, unsigned CloneFlags)
: GlobalsGraph(GG), ScalarMap(ECs), TD(G->TD) {
- PrintAuxCalls = false;
+ UseAuxCalls = false;
cloneInto(G, CloneFlags);
}
@@ -1763,7 +1763,7 @@
}
// Mark stuff passed into functions calls as being incomplete.
- if (!shouldPrintAuxCalls())
+ if (!shouldUseAuxCalls())
for (std::list<DSCallSite>::iterator I = FunctionCalls.begin(),
E = FunctionCalls.end(); I != E; ++I)
markIncomplete(*I);
@@ -2533,7 +2533,7 @@
if (resetAuxCalls)
G->getAuxFunctionCalls() = G->getFunctionCalls();
}
- G->setPrintAuxCalls();
+ G->setUseAuxCalls();
// Note that this graph is the graph for ALL of the function in the SCC, not
// just F.
@@ -2643,7 +2643,7 @@
}
}
-void DataStructures::init(DataStructures* D, bool clone, bool printAuxCalls,
+void DataStructures::init(DataStructures* D, bool clone, bool useAuxCalls,
bool copyGlobalAuxCalls, bool resetAux) {
assert (!GraphSource && "Already init");
GraphSource = D;
@@ -2654,7 +2654,7 @@
GlobalECs = D->getGlobalECs();
GlobalsGraph = new DSGraph(D->getGlobalsGraph(), GlobalECs, 0,
copyGlobalAuxCalls?0:DSGraph::DontCloneAuxCallNodes);
- if (printAuxCalls) GlobalsGraph->setPrintAuxCalls();
+ if (useAuxCalls) GlobalsGraph->setUseAuxCalls();
//
// Tell the other DSA pass if we're stealing its graph.
Modified: poolalloc/trunk/lib/rDSA/Printer.cpp
URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/lib/rDSA/Printer.cpp?rev=116896&r1=116895&r2=116896&view=diff
==============================================================================
--- poolalloc/trunk/lib/rDSA/Printer.cpp (original)
+++ poolalloc/trunk/lib/rDSA/Printer.cpp Tue Oct 19 20:05:12 2010
@@ -193,7 +193,7 @@
// Output all of the call nodes...
const std::list<DSCallSite> &FCs =
- G->shouldPrintAuxCalls() ? G->getAuxFunctionCalls()
+ G->shouldUseAuxCalls() ? G->getAuxFunctionCalls()
: G->getFunctionCalls();
for (std::list<DSCallSite>::const_iterator I = FCs.begin(), E = FCs.end();
I != E; ++I) {
@@ -249,7 +249,7 @@
if (F.good()) {
print(F);
- unsigned NumCalls = shouldPrintAuxCalls() ?
+ unsigned NumCalls = shouldUseAuxCalls() ?
getAuxFunctionCalls().size() : getFunctionCalls().size();
O << " [" << getGraphSize() << "+" << NumCalls << "]\n";
} else {
@@ -277,7 +277,7 @@
for (Module::const_iterator I = M->begin(), E = M->end(); I != E; ++I)
if (C.hasDSGraph(I)) {
DSGraph* Gr = C.getDSGraph(I);
- unsigned NumCalls = Gr->shouldPrintAuxCalls() ?
+ unsigned NumCalls = Gr->shouldUseAuxCalls() ?
Gr->getAuxFunctionCalls().size() : Gr->getFunctionCalls().size();
bool IsDuplicateGraph = false;
More information about the llvm-commits
mailing list