[llvm-commits] [see] CVS: llvm-poolalloc/lib/DSA/BottomUpClosure.cpp DataStructure.cpp Local.cpp TopDownClosure.cpp
Andrew Lenharth
alenhar2 at cs.uiuc.edu
Wed Feb 28 09:36:11 PST 2007
Changes in directory llvm-poolalloc/lib/DSA:
BottomUpClosure.cpp updated: 1.123.2.1 -> 1.123.2.1.2.1
DataStructure.cpp updated: 1.248.2.4 -> 1.248.2.4.2.1
Local.cpp updated: 1.158.2.4.2.1 -> 1.158.2.4.2.2
TopDownClosure.cpp updated: 1.92.2.1 -> 1.92.2.1.2.1
---
Log message:
Add recursive unknown
---
Diffs of the changes: (+42 -0)
BottomUpClosure.cpp | 2 ++
DataStructure.cpp | 36 ++++++++++++++++++++++++++++++++++++
Local.cpp | 2 ++
TopDownClosure.cpp | 2 ++
4 files changed, 42 insertions(+)
Index: llvm-poolalloc/lib/DSA/BottomUpClosure.cpp
diff -u llvm-poolalloc/lib/DSA/BottomUpClosure.cpp:1.123.2.1 llvm-poolalloc/lib/DSA/BottomUpClosure.cpp:1.123.2.1.2.1
--- llvm-poolalloc/lib/DSA/BottomUpClosure.cpp:1.123.2.1 Tue Dec 12 16:42:41 2006
+++ llvm-poolalloc/lib/DSA/BottomUpClosure.cpp Wed Feb 28 11:35:32 2007
@@ -672,6 +672,8 @@
Graph.maskIncompleteMarkers();
Graph.markIncompleteNodes(DSGraph::MarkFormalArgs);
+ Graph.markUnknownNodes();
+
// Delete dead nodes. Treat globals that are unreachable but that can
// reach live nodes as live.
Graph.removeDeadNodes(DSGraph::KeepUnreachableGlobals);
Index: llvm-poolalloc/lib/DSA/DataStructure.cpp
diff -u llvm-poolalloc/lib/DSA/DataStructure.cpp:1.248.2.4 llvm-poolalloc/lib/DSA/DataStructure.cpp:1.248.2.4.2.1
--- llvm-poolalloc/lib/DSA/DataStructure.cpp:1.248.2.4 Tue Feb 13 16:02:36 2007
+++ llvm-poolalloc/lib/DSA/DataStructure.cpp Wed Feb 28 11:35:32 2007
@@ -43,6 +43,7 @@
Statistic<> NumDNE ("dsa", "Number of nodes removed by reachability");
Statistic<> NumTrivialDNE ("dsa", "Number of nodes trivially removed");
Statistic<> NumTrivialGlobalDNE("dsa", "Number of globals trivially removed");
+ Statistic<> NumRecUnknown("dsa", "Number of Unknown nodes marked recursively");
#ifdef LLVA_KERNEL
Statistic<> LostPools ("dsa", "Number of pools lost to DSNode Merge");
#endif
@@ -50,6 +51,9 @@
DSAFieldLimit("dsa-field-limit", cl::Hidden,
cl::desc("Number of fields to track before collapsing a node"),
cl::init(256));
+ static cl::opt<bool>
+ DSAMarkU("dsa-mark-U-rec", cl::Hidden,
+ cl::desc("Recursively mark unknown nodes"));
}
#if 0
@@ -1995,6 +1999,38 @@
markIncompleteNode(ScalarMap[GV].getNode());
}
+//mark any node reached by an unknown node as unknown
+void DSGraph::markUnknownNodes() {
+ if (!DSAMarkU)
+ return;
+ std::vector<DSNodeHandle> WorkList;
+ for (DSScalarMap::iterator I = ScalarMap.begin(),
+ E = ScalarMap.end(); I != E; ++I) {
+ if (I->second.getNode()->isUnknownNode()) {
+ for(DSNode::edge_iterator EI = I->second.getNode()->edge_begin(),
+ EE = I->second.getNode()->edge_end(); EI != EE; ++EI) {
+ if (EI->getNode() && !EI->getNode()->isUnknownNode()) {
+ EI->getNode()->setUnknownNodeMarker();
+ WorkList.push_back(*EI);
+ ++NumRecUnknown;
+ }
+ }
+ }
+ }
+ while (WorkList.size()) {
+ DSNodeHandle DH = WorkList.back();
+ WorkList.pop_back();
+ for(DSNode::edge_iterator EI = DH.getNode()->edge_begin(),
+ EE = DH.getNode()->edge_end(); EI != EE; ++EI) {
+ if (EI->getNode() && !EI->getNode()->isUnknownNode()) {
+ EI->getNode()->setUnknownNodeMarker();
+ WorkList.push_back(*EI);
+ ++NumRecUnknown;
+ }
+ }
+ }
+}
+
static inline void killIfUselessEdge(DSNodeHandle &Edge) {
if (DSNode *N = Edge.getNode()) // Is there an edge?
if (N->getNumReferrers() == 1) // Does it point to a lonely node?
Index: llvm-poolalloc/lib/DSA/Local.cpp
diff -u llvm-poolalloc/lib/DSA/Local.cpp:1.158.2.4.2.1 llvm-poolalloc/lib/DSA/Local.cpp:1.158.2.4.2.2
--- llvm-poolalloc/lib/DSA/Local.cpp:1.158.2.4.2.1 Tue Feb 27 12:52:19 2007
+++ llvm-poolalloc/lib/DSA/Local.cpp Wed Feb 28 11:35:32 2007
@@ -247,6 +247,8 @@
markIncompleteNodes(DSGraph::MarkFormalArgs);
+ markUnknownNodes();
+
// Remove any nodes made dead due to merging...
removeDeadNodes(DSGraph::KeepUnreachableGlobals);
}
Index: llvm-poolalloc/lib/DSA/TopDownClosure.cpp
diff -u llvm-poolalloc/lib/DSA/TopDownClosure.cpp:1.92.2.1 llvm-poolalloc/lib/DSA/TopDownClosure.cpp:1.92.2.1.2.1
--- llvm-poolalloc/lib/DSA/TopDownClosure.cpp:1.92.2.1 Tue Dec 12 16:42:42 2006
+++ llvm-poolalloc/lib/DSA/TopDownClosure.cpp Wed Feb 28 11:35:33 2007
@@ -300,6 +300,8 @@
= HasIncompleteArgs ? DSGraph::MarkFormalArgs : DSGraph::IgnoreFormalArgs;
DSG.markIncompleteNodes(Flags | DSGraph::IgnoreGlobals);
+ DSG.markUnknownNodes();
+
// Delete dead nodes. Treat globals that are unreachable as dead also.
DSG.removeDeadNodes(DSGraph::RemoveUnreachableGlobals);
More information about the llvm-commits
mailing list