[llvm-commits] [poolalloc] r56803 - in /poolalloc/trunk: include/poolalloc/PoolAllocate.h lib/PoolAllocate/PASimple.cpp

John Criswell criswell at uiuc.edu
Mon Sep 29 14:16:49 PDT 2008


Author: criswell
Date: Mon Sep 29 16:16:48 2008
New Revision: 56803

URL: http://llvm.org/viewvc/llvm-project?rev=56803&view=rev
Log:
Back out changes to use Top-Down DSA when using SAFECode.  SAFECode and
automatic pool allocation require both Top-Down DSA and EquivClassGraphs.

Modified:
    poolalloc/trunk/include/poolalloc/PoolAllocate.h
    poolalloc/trunk/lib/PoolAllocate/PASimple.cpp

Modified: poolalloc/trunk/include/poolalloc/PoolAllocate.h
URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/include/poolalloc/PoolAllocate.h?rev=56803&r1=56802&r2=56803&view=diff

==============================================================================
--- poolalloc/trunk/include/poolalloc/PoolAllocate.h (original)
+++ poolalloc/trunk/include/poolalloc/PoolAllocate.h Mon Sep 29 16:16:48 2008
@@ -120,24 +120,15 @@
   virtual const Type * getPoolType() {return 0;}
 
   virtual bool hasDSGraph (const Function & F) const {
-    if (SAFECodeEnabled)
-      return TDGraphs->hasGraph (F);
-    else
-      return ECGraphs->hasGraph (F);
+    return ECGraphs->hasGraph (F);
   }
 
   virtual DSGraph & getDSGraph (const Function & F) const {
-    if (SAFECodeEnabled)
-      return TDGraphs->getDSGraph (F);
-    else
-      return ECGraphs->getDSGraph (F);
+    return ECGraphs->getDSGraph (F);
   }
 
   virtual DSGraph & getGlobalsGraph () const {
-    if (SAFECodeEnabled)
-      return TDGraphs->getGlobalsGraph ();
-    else
-      return ECGraphs->getGlobalsGraph ();
+    return ECGraphs->getGlobalsGraph ();
   }
 
   virtual Value * getPool (const DSNode * N, Function & F) {return 0;}
@@ -249,17 +240,11 @@
   }
 
   virtual DSGraph & getDSGraph (const Function & F) const {
-    if (SAFECodeEnabled)
-      return TDGraphs->getDSGraph (F);
-    else
-      return ECGraphs->getDSGraph (F);
+    return ECGraphs->getDSGraph (F);
   }
 
   virtual DSGraph & getGlobalsGraph () const {
-    if (SAFECodeEnabled)
-      return TDGraphs->getGlobalsGraph ();
-    else
-      return ECGraphs->getGlobalsGraph ();
+    return ECGraphs->getGlobalsGraph ();
   }
 
   virtual Value * getPool (const DSNode * N, Function & F) {

Modified: poolalloc/trunk/lib/PoolAllocate/PASimple.cpp
URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/lib/PoolAllocate/PASimple.cpp?rev=56803&r1=56802&r2=56803&view=diff

==============================================================================
--- poolalloc/trunk/lib/PoolAllocate/PASimple.cpp (original)
+++ poolalloc/trunk/lib/PoolAllocate/PASimple.cpp Mon Sep 29 16:16:48 2008
@@ -74,9 +74,9 @@
 void PoolAllocateSimple::getAnalysisUsage(AnalysisUsage &AU) const {
   AU.addRequired<TargetData>();
   AU.addRequiredTransitive<EquivClassGraphs>();
-  AU.addRequiredTransitive<TDDataStructures>();
+
   AU.addPreserved<EquivClassGraphs>();
-  AU.addPreserved<TDDataStructures>();
+
   AU.setPreservesAll();
 }
 
@@ -103,10 +103,6 @@
   // Get the Target Data information and the ECGraphs
   ECGraphs = &getAnalysis<EquivClassGraphs>();   // folded inlined CBU graphs
   assert (ECGraphs && "No ECGraphs pass available!\n");
-  if (SAFECodeEnabled) {
-    TDGraphs = &getAnalysis<TDDataStructures>();   // folded inlined CBU graphs
-    assert (TDGraphs && "No TDGraphs pass available!\n");
-  }
   TargetData & TD = getAnalysis<TargetData>();
 
   // Add the pool* prototypes to the module
@@ -124,17 +120,14 @@
   //
   // Merge all of the DSNodes in the DSGraphs.
   //
-  if (SAFECodeEnabled)
-    GlobalECs = &(TDGraphs->getGlobalECs());
-  else
-    GlobalECs = &(ECGraphs->getGlobalECs());
-  CombinedDSGraph = new DSGraph (*GlobalECs, TD, &(getGlobalsGraph()));
+  GlobalECs = &(TDGraphs->getGlobalECs());
+  CombinedDSGraph = new DSGraph (*GlobalECs, TD, &(ECGraphs->getGlobalsGraph()));
   //CombinedDSGraph.cloneInto (getGlobalsGraph());
   for (Module::iterator I = M.begin(), E = M.end(); I != E; ++I) {
-    if (hasDSGraph (*I))
-      CombinedDSGraph->cloneInto (getDSGraph(*I));
+    if (ECGraphs->hasGraph (*I))
+      CombinedDSGraph->cloneInto (ECGraphs->getDSGraph(*I));
   }
-  CombinedDSGraph->cloneInto (getGlobalsGraph());
+  CombinedDSGraph->cloneInto (ECGraphs->getGlobalsGraph());
   MergeNodesInDSGraph (*CombinedDSGraph);
 
   //
@@ -168,7 +161,7 @@
   //
   // Get the DSGraph for this function.
   //
-  DSGraph &ECG = getDSGraph(F);
+  DSGraph &ECG = ECGraphs->getDSGraph(F);
 
   for (Function::iterator i = F.begin(), e = F.end(); i != e; ++i)
     for (BasicBlock::iterator ii = i->begin(), ee = i->end(); ii != ee; ++ii) {





More information about the llvm-commits mailing list