[llvm-commits] [poolalloc] r78091 - in /poolalloc/trunk/lib/DSA: BottomUpClosure.cpp CallTargets.cpp DataStructureStats.cpp Local.cpp Printer.cpp StdLibPass.cpp TopDownClosure.cpp

Andrew Lenharth alenhar2 at cs.uiuc.edu
Tue Aug 4 12:34:15 PDT 2009


Author: alenhar2
Date: Tue Aug  4 14:33:52 2009
New Revision: 78091

URL: http://llvm.org/viewvc/llvm-project?rev=78091&view=rev
Log:
wrong output

Modified:
    poolalloc/trunk/lib/DSA/BottomUpClosure.cpp
    poolalloc/trunk/lib/DSA/CallTargets.cpp
    poolalloc/trunk/lib/DSA/DataStructureStats.cpp
    poolalloc/trunk/lib/DSA/Local.cpp
    poolalloc/trunk/lib/DSA/Printer.cpp
    poolalloc/trunk/lib/DSA/StdLibPass.cpp
    poolalloc/trunk/lib/DSA/TopDownClosure.cpp

Modified: poolalloc/trunk/lib/DSA/BottomUpClosure.cpp
URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/lib/DSA/BottomUpClosure.cpp?rev=78091&r1=78090&r2=78091&view=diff

==============================================================================
--- poolalloc/trunk/lib/DSA/BottomUpClosure.cpp (original)
+++ poolalloc/trunk/lib/DSA/BottomUpClosure.cpp Tue Aug  4 14:33:52 2009
@@ -54,14 +54,14 @@
     calculateGraphs(MainFunc, Stack, NextID, ValMap);
     CloneAuxIntoGlobal(getDSGraph(*MainFunc));
   } else {
-    DEBUG(ferrs() << debugname << ": No 'main' function found!\n");
+    DEBUG(errs() << debugname << ": No 'main' function found!\n");
   }
 
   // Calculate the graphs for any functions that are unreachable from main...
   for (Module::iterator I = M.begin(), E = M.end(); I != E; ++I)
     if (!I->isDeclaration() && !hasDSGraph(*I)) {
       if (MainFunc)
-        DEBUG(ferrs() << debugname << ": Function unreachable from main: "
+        DEBUG(errs() << debugname << ": Function unreachable from main: "
 	      << I->getName() << "\n");
       calculateGraphs(I, Stack, NextID, ValMap);     // Calculate all graphs.
       CloneAuxIntoGlobal(getDSGraph(*I));
@@ -263,12 +263,12 @@
 
   // If this is a new SCC, process it now.
   if (Stack.back() == F) {           // Special case the single "SCC" case here.
-    DEBUG(ferrs() << "Visiting single node SCC #: " << MyID << " fn: "
+    DEBUG(errs() << "Visiting single node SCC #: " << MyID << " fn: "
 	  << F->getName() << "\n");
     Stack.pop_back();
-    DEBUG(ferrs() << "  [BU] Calculating graph for: " << F->getName()<< "\n");
+    DEBUG(errs() << "  [BU] Calculating graph for: " << F->getName()<< "\n");
     calculateGraph(Graph);
-    DEBUG(ferrs() << "  [BU] Done inlining: " << F->getName() << " ["
+    DEBUG(errs() << "  [BU] Done inlining: " << F->getName() << " ["
 	  << Graph->getGraphSize() << "+" << Graph->getAuxFunctionCalls().size()
 	  << "]\n");
 
@@ -297,7 +297,7 @@
     ResolvedFuncs.resize(uid - ResolvedFuncs.begin());
 
     if (ResolvedFuncs.size() || NewCalleeFuncs.size()) {
-      DEBUG(ferrs() << "Recalculating " << F->getName() << " due to new knowledge\n");
+      DEBUG(errs() << "Recalculating " << F->getName() << " due to new knowledge\n");
       ValMap.erase(F);
       return calculateGraphs(F, Stack, NextID, ValMap);
     } else {
@@ -341,7 +341,7 @@
     }
     Stack.pop_back();
 
-    DEBUG(ferrs() << "Calculating graph for SCC #: " << MyID << " of size: "
+    DEBUG(errs() << "Calculating graph for SCC #: " << MyID << " of size: "
 	  << SCCSize << "\n");
 
     // Compute the Max SCC Size.
@@ -354,7 +354,7 @@
     // Now that we have one big happy family, resolve all of the call sites in
     // the graph...
     calculateGraph(SCCGraph);
-    DEBUG(ferrs() << "  [BU] Done inlining SCC  [" << SCCGraph->getGraphSize()
+    DEBUG(errs() << "  [BU] Done inlining SCC  [" << SCCGraph->getGraphSize()
 	  << "+" << SCCGraph->getAuxFunctionCalls().size() << "]\n"
 	  << "DONE with SCC #: " << MyID << "\n");
 
@@ -473,7 +473,7 @@
       // Get the data structure graph for the called function.
       GI = getDSGraph(*Callee);  // Graph to inline
       DEBUG(GI->AssertGraphOK(); GI->getGlobalsGraph()->AssertGraphOK());
-      DEBUG(ferrs() << "    Inlining graph for " << Callee->getName()
+      DEBUG(errs() << "    Inlining graph for " << Callee->getName()
 	    << "[" << GI->getGraphSize() << "+"
 	    << GI->getAuxFunctionCalls().size() << "] into '"
 	    << Graph->getFunctionNames() << "' [" << Graph->getGraphSize() <<"+"
@@ -484,19 +484,19 @@
       ++NumInlines;
       DEBUG(Graph->AssertGraphOK(););
     } else if (CalledFuncs.size() > 1) {
-      DEBUG(ferrs() << "In Fns: " << Graph->getFunctionNames() << "\n");
-      DEBUG(ferrs() << "  calls " << CalledFuncs.size()
+      DEBUG(errs() << "In Fns: " << Graph->getFunctionNames() << "\n");
+      DEBUG(errs() << "  calls " << CalledFuncs.size()
             << " fns from site: " << CS.getCallSite().getInstruction()
             << "  " << *CS.getCallSite().getInstruction());
-      DEBUG(ferrs() << "   Fns =");
+      DEBUG(errs() << "   Fns =");
       unsigned NumPrinted = 0;
       
       for (std::vector<const Function*>::iterator I = CalledFuncs.begin(),
              E = CalledFuncs.end(); I != E; ++I)
         if (NumPrinted++ < 8) {
-	  DEBUG(ferrs() << " " << (*I)->getName());
+	  DEBUG(errs() << " " << (*I)->getName());
 	}
-      DEBUG(ferrs() << "\n");
+      DEBUG(errs() << "\n");
       
       if (!isComplete) {
         for (unsigned x = 0; x < CalledFuncs.size(); )
@@ -547,13 +547,13 @@
           // Clean up the final graph!
           GI->removeDeadNodes(DSGraph::KeepUnreachableGlobals);
         } else {
-          DEBUG(ferrs() << "***\n*** RECYCLED GRAPH ***\n***\n");
+          DEBUG(errs() << "***\n*** RECYCLED GRAPH ***\n***\n");
         }
         
         GI = IndCallGraph.first;
         
         // Merge the unified graph into this graph now.
-        DEBUG(ferrs() << "    Inlining multi callee graph "
+        DEBUG(errs() << "    Inlining multi callee graph "
 	      << "[" << GI->getGraphSize() << "+"
 	      << GI->getAuxFunctionCalls().size() << "] into '"
 	      << Graph->getFunctionNames() << "' [" << Graph->getGraphSize() <<"+"
@@ -622,7 +622,7 @@
       // Get the data structure graph for the called function.
       GI = getDSGraph(*Callee);  // Graph to inline
       if (GI == Graph) continue;
-      DEBUG(ferrs() << "    Inlining graph for " << Callee->getName()
+      DEBUG(errs() << "    Inlining graph for " << Callee->getName()
 	    << "[" << GI->getGraphSize() << "+"
 	    << GI->getAuxFunctionCalls().size() << "] into '"
 	    << Graph->getFunctionNames() << "' [" << Graph->getGraphSize() <<"+"
@@ -631,19 +631,19 @@
                          DSGraph::StripAllocaBit|DSGraph::DontCloneCallNodes);
       ++NumInlines;
     } else {
-      DEBUG(ferrs() << "In Fns: " << Graph->getFunctionNames() << "\n");
+      DEBUG(errs() << "In Fns: " << Graph->getFunctionNames() << "\n");
       DEBUG(std::cerr << "  calls " << CalledFuncs.size()
             << " fns from site: " << CS.getCallSite().getInstruction()
             << "  " << *CS.getCallSite().getInstruction());
-      DEBUG(ferrs() << "   Fns =");
+      DEBUG(errs() << "   Fns =");
       unsigned NumPrinted = 0;
       
       for (std::vector<const Function*>::iterator I = CalledFuncs.begin(),
              E = CalledFuncs.end(); I != E; ++I)
         if (NumPrinted++ < 8) {
-	  DEBUG(ferrs() << " " << (*I)->getName());
+	  DEBUG(errs() << " " << (*I)->getName());
 	}
-      DEBUG(ferrs() << "\n");
+      DEBUG(errs() << "\n");
       
       for (unsigned x = 0; x < CalledFuncs.size(); )
         if (!hasDSGraph(*CalledFuncs[x]))
@@ -696,13 +696,13 @@
         // Clean up the final graph!
         GI->removeDeadNodes(DSGraph::KeepUnreachableGlobals);
       } else {
-        DEBUG(ferrs() << "***\n*** RECYCLED GRAPH ***\n***\n");
+        DEBUG(errs() << "***\n*** RECYCLED GRAPH ***\n***\n");
       }
       
       GI = IndCallGraph.first;
       
       // Merge the unified graph into this graph now.
-      DEBUG(ferrs() << "    Inlining multi callee graph "
+      DEBUG(errs() << "    Inlining multi callee graph "
             << "[" << GI->getGraphSize() << "+"
             << GI->getAuxFunctionCalls().size() << "] into '"
             << Graph->getFunctionNames() << "' [" << Graph->getGraphSize() <<"+"

Modified: poolalloc/trunk/lib/DSA/CallTargets.cpp
URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/lib/DSA/CallTargets.cpp?rev=78091&r1=78090&r2=78091&view=diff

==============================================================================
--- poolalloc/trunk/lib/DSA/CallTargets.cpp (original)
+++ poolalloc/trunk/lib/DSA/CallTargets.cpp Tue Aug  4 14:33:52 2009
@@ -74,7 +74,7 @@
                 } 
                 if (N->isCompleteNode() && !IndMap[cs].size()) {
                   ++CompleteEmpty;
-                  DEBUG(ferrs() << "Call site empty: '"
+                  DEBUG(errs() << "Call site empty: '"
 			<< cs.getInstruction()->getName() 
 			<< "' In '"
 			<< cs.getInstruction()->getParent()->getParent()->getName()

Modified: poolalloc/trunk/lib/DSA/DataStructureStats.cpp
URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/lib/DSA/DataStructureStats.cpp?rev=78091&r1=78090&r2=78091&view=diff

==============================================================================
--- poolalloc/trunk/lib/DSA/DataStructureStats.cpp (original)
+++ poolalloc/trunk/lib/DSA/DataStructureStats.cpp Tue Aug  4 14:33:52 2009
@@ -97,7 +97,7 @@
         totalNumCallees  += Callees.size();
         ++numIndirectCalls;
       } else {
-        DEBUG(ferrs() << "WARNING: No callee in Function '" 
+        DEBUG(errs() << "WARNING: No callee in Function '" 
 	      << F.getNameStr() << "' at call: \n"
 	      << *I->getCallSite().getInstruction());
       }
@@ -107,7 +107,7 @@
   NumIndirectCalls += numIndirectCalls;
 
   if (numIndirectCalls) {
-    DEBUG(ferrs() << "  In function " << F.getName() << ":  "
+    DEBUG(errs() << "  In function " << F.getName() << ":  "
 	  << (totalNumCallees / (double) numIndirectCalls)
 	  << " average callees per indirect call\n");
   }

Modified: poolalloc/trunk/lib/DSA/Local.cpp
URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/lib/DSA/Local.cpp?rev=78091&r1=78090&r2=78091&view=diff

==============================================================================
--- poolalloc/trunk/lib/DSA/Local.cpp (original)
+++ poolalloc/trunk/lib/DSA/Local.cpp Tue Aug  4 14:33:52 2009
@@ -250,7 +250,7 @@
       NH = getValueDest(*(cast<GlobalAlias>(C)->getAliasee()));
       return 0;
     } else {
-      DEBUG(ferrs() << "Unknown constant: " << *C << "\n");
+      DEBUG(errs() << "Unknown constant: " << *C << "\n");
       assert(0 && "Unknown constant type!");
     }
     N = createNode(); // just create a shadow node
@@ -488,7 +488,7 @@
         // Variable index into a node.  We must merge all of the elements of the
         // sequential type here.
         if (isa<PointerType>(STy)) {
-          DEBUG(ferrs() << "Pointer indexing not handled yet!\n");
+          DEBUG(errs() << "Pointer indexing not handled yet!\n");
 	} else {
           const ArrayType *ATy = cast<ArrayType>(STy);
           unsigned ElSize = TD.getTypeAllocSize(CurTy);
@@ -537,7 +537,7 @@
     {
       if (G.getPoolDescriptorsMap().count(N) != 0)
         if (G.getPoolDescriptorsMap()[N]) {
-	  DEBUG(ferrs() << "LLVA: GEP[" << 0 << "]: Pool for " << GEP.getName() << " is " << G.getPoolDescriptorsMap()[N]->getName() << "\n");
+	  DEBUG(errs() << "LLVA: GEP[" << 0 << "]: Pool for " << GEP.getName() << " is " << G.getPoolDescriptorsMap()[N]->getName() << "\n");
 	}
     }
   }
@@ -697,7 +697,7 @@
         return true;
     }
 
-    DEBUG(ferrs() << "[dsa:local] Unhandled intrinsic: " << F->getName() << "\n");
+    DEBUG(errs() << "[dsa:local] Unhandled intrinsic: " << F->getName() << "\n");
     assert(0 && "Unhandled intrinsic");
     return false;
   }
@@ -728,7 +728,7 @@
   if (!isa<Function>(Callee)) {
     CalleeNode = getValueDest(*Callee).getNode();
     if (CalleeNode == 0) {
-      DEBUG(ferrs() << "WARNING: Program is calling through a null pointer?\n" << *I);
+      DEBUG(errs() << "WARNING: Program is calling through a null pointer?\n" << *I);
       return;  // Calling a null pointer?
     }
   }

Modified: poolalloc/trunk/lib/DSA/Printer.cpp
URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/lib/DSA/Printer.cpp?rev=78091&r1=78090&r2=78091&view=diff

==============================================================================
--- poolalloc/trunk/lib/DSA/Printer.cpp (original)
+++ poolalloc/trunk/lib/DSA/Printer.cpp Tue Aug  4 14:33:52 2009
@@ -343,13 +343,13 @@
 void DataStructures::dumpCallGraph() const {
   for(  ActualCalleesTy::const_iterator ii = ActualCallees.begin(), ee = ActualCallees.end();
         ii != ee; ++ii) {
-    if (ii->first) ferrs() << ii->first->getParent()->getParent()->getName() << " ";
-    ferrs() << ii->first << ": [";
+    if (ii->first) errs() << ii->first->getParent()->getParent()->getName() << " ";
+    errs() << ii->first << ": [";
     for (callee_iterator cbi = ii->second.begin(), cbe = ii->second.end();
          cbi != cbe; ++cbi) {
-      ferrs() << (*cbi)->getName() << " ";
+      errs() << (*cbi)->getName() << " ";
     }
-    ferrs() << "]\n";
+    errs() << "]\n";
     if (ii->first) ii->first->dump();
   }
 }

Modified: poolalloc/trunk/lib/DSA/StdLibPass.cpp
URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/lib/DSA/StdLibPass.cpp?rev=78091&r1=78090&r2=78091&view=diff

==============================================================================
--- poolalloc/trunk/lib/DSA/StdLibPass.cpp (original)
+++ poolalloc/trunk/lib/DSA/StdLibPass.cpp Tue Aug  4 14:33:52 2009
@@ -183,7 +183,7 @@
       if (CI->getOperand(0) == F) {
         DSGraph* Graph = getDSGraph(*CI->getParent()->getParent());
         //delete the call
-        DEBUG(ferrs() << "Removing " << F->getNameStr() << " from " 
+        DEBUG(errs() << "Removing " << F->getNameStr() << " from " 
 	      << CI->getParent()->getParent()->getNameStr() << "\n");
         Graph->removeFunctionCalls(*F);
       }

Modified: poolalloc/trunk/lib/DSA/TopDownClosure.cpp
URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/lib/DSA/TopDownClosure.cpp?rev=78091&r1=78090&r2=78091&view=diff

==============================================================================
--- poolalloc/trunk/lib/DSA/TopDownClosure.cpp (original)
+++ poolalloc/trunk/lib/DSA/TopDownClosure.cpp Tue Aug  4 14:33:52 2009
@@ -198,7 +198,7 @@
       RC.getClonedNH(GG->getNodeForValue(*GI));
   }
 
-  DEBUG(ferrs() << "[TD] Inlining callers into '" 
+  DEBUG(errs() << "[TD] Inlining callers into '" 
 	<< DSG->getFunctionNames() << "'\n");
 
   // Iteratively inline caller graphs into this graph.
@@ -215,15 +215,15 @@
     do {
       const DSCallSite &CS = *EdgesFromCaller.back().CS;
       const Function &CF = *EdgesFromCaller.back().CalledFunction;
-      DEBUG(ferrs() << "   [TD] Inlining graph into Fn '" 
+      DEBUG(errs() << "   [TD] Inlining graph into Fn '" 
 	    << CF.getNameStr() << "' from ");
       if (CallerGraph->getReturnNodes().empty()) {
-        DEBUG(ferrs() << "SYNTHESIZED INDIRECT GRAPH");
+        DEBUG(errs() << "SYNTHESIZED INDIRECT GRAPH");
       } else {
-        DEBUG(ferrs() << "Fn '" << CS.getCallSite().getInstruction()->
+        DEBUG(errs() << "Fn '" << CS.getCallSite().getInstruction()->
 	      getParent()->getParent()->getNameStr() << "'");
       }
-      DEBUG(ferrs() << ": " << CF.getFunctionType()->getNumParams() 
+      DEBUG(errs() << ": " << CF.getFunctionType()->getNumParams() 
 	    << " args\n");
 
       // Get the formal argument and return nodes for the called function and
@@ -339,7 +339,7 @@
 
     // If we already have this graph, recycle it.
     if (IndCallRecI != IndCallMap.end() && IndCallRecI->first == Callees) {
-      DEBUG(ferrs() << "  [TD] *** Reuse of indcall graph for " << Callees.size()
+      DEBUG(errs() << "  [TD] *** Reuse of indcall graph for " << Callees.size()
 	    << " callees!\n");
       IndCallGraph = IndCallRecI->second;
     } else {





More information about the llvm-commits mailing list