[llvm-commits] CVS: llvm/lib/Analysis/DataStructure/BottomUpClosure.cpp CompleteBottomUp.cpp Local.cpp TopDownClosure.cpp

Andrew Lenharth alenhar2 at cs.uiuc.edu
Fri Oct 13 10:38:51 PDT 2006



Changes in directory llvm/lib/Analysis/DataStructure:

BottomUpClosure.cpp updated: 1.120 -> 1.121
CompleteBottomUp.cpp updated: 1.36 -> 1.37
Local.cpp updated: 1.153 -> 1.154
TopDownClosure.cpp updated: 1.91 -> 1.92
---
Log message:

Move some warnings to debug mode.

---
Diffs of the changes:  (+23 -21)

 BottomUpClosure.cpp  |   19 +++++++++----------
 CompleteBottomUp.cpp |   11 +++++------
 Local.cpp            |   10 +++++++---
 TopDownClosure.cpp   |    4 ++--
 4 files changed, 23 insertions(+), 21 deletions(-)


Index: llvm/lib/Analysis/DataStructure/BottomUpClosure.cpp
diff -u llvm/lib/Analysis/DataStructure/BottomUpClosure.cpp:1.120 llvm/lib/Analysis/DataStructure/BottomUpClosure.cpp:1.121
--- llvm/lib/Analysis/DataStructure/BottomUpClosure.cpp:1.120	Sun Aug 27 17:30:17 2006
+++ llvm/lib/Analysis/DataStructure/BottomUpClosure.cpp	Fri Oct 13 12:38:22 2006
@@ -171,11 +171,9 @@
   // 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->isExternal() && !DSInfo.count(I)) {
-#ifndef NDEBUG
       if (MainFunc)
-        std::cerr << "*** BU: Function unreachable from main: "
-                  << I->getName() << "\n";
-#endif
+        DEBUG(std::cerr << "*** BU: Function unreachable from main: "
+              << I->getName() << "\n");
       calculateGraphs(I, Stack, NextID, ValMap);     // Calculate all graphs.
     }
 
@@ -206,7 +204,7 @@
   BuildGlobalECs(*GlobalsGraph, ECGlobals);
   if (!ECGlobals.empty()) {
     NamedRegionTimer X("Bottom-UP EC Cleanup");
-    std::cerr << "Eliminating " << ECGlobals.size() << " EC Globals!\n";
+    DEBUG(std::cerr << "Eliminating " << ECGlobals.size() << " EC Globals!\n");
     for (hash_map<Function*, DSGraph*>::iterator I = DSInfo.begin(),
            E = DSInfo.end(); I != E; ++I)
       EliminateUsesOfECGlobals(*I->second, ECGlobals);
@@ -237,11 +235,12 @@
 	  ee = MainGraph.afc_end(); ii != ee; ++ii) {
       std::vector<Function*> Funcs;
       GetAllCallees(*ii, Funcs);
-      std::cerr << "Lost site\n";
+      DEBUG(std::cerr << "Lost site\n");
+      DEBUG(ii->getCallSite().getInstruction()->dump());
       for (std::vector<Function*>::iterator iif = Funcs.begin(), eef = Funcs.end();
 	   iif != eef; ++iif) {
 	AddGlobalToNode(this, *ii, *iif);
-	std::cerr << "Adding\n";
+	DEBUG(std::cerr << "Adding\n");
 	ActualCallees.insert(std::make_pair(ii->getCallSite().getInstruction(), *iif));
       }
     }
@@ -421,8 +420,8 @@
     }
     Stack.pop_back();
 
-    std::cerr << "Calculating graph for SCC #: " << MyID << " of size: "
-              << SCCSize << "\n";
+    DEBUG(std::cerr << "Calculating graph for SCC #: " << MyID << " of size: "
+          << SCCSize << "\n");
 
     // Compute the Max SCC Size.
     if (MaxSCC < SCCSize)
@@ -441,7 +440,7 @@
       DEBUG(std::cerr << "MISSING REDO\n");
     }
 
-    std::cerr << "DONE with SCC #: " << MyID << "\n";
+    DEBUG(std::cerr << "DONE with SCC #: " << MyID << "\n");
 
     // We never have to revisit "SCC" processed functions...
     return MyID;


Index: llvm/lib/Analysis/DataStructure/CompleteBottomUp.cpp
diff -u llvm/lib/Analysis/DataStructure/CompleteBottomUp.cpp:1.36 llvm/lib/Analysis/DataStructure/CompleteBottomUp.cpp:1.37
--- llvm/lib/Analysis/DataStructure/CompleteBottomUp.cpp:1.36	Sun Aug 27 17:30:17 2006
+++ llvm/lib/Analysis/DataStructure/CompleteBottomUp.cpp	Fri Oct 13 12:38:22 2006
@@ -52,16 +52,15 @@
     if (!MainFunc->isExternal())
       calculateSCCGraphs(getOrCreateGraph(*MainFunc), Stack, NextID, ValMap);
   } else {
-    std::cerr << "CBU-DSA: No 'main' function found!\n";
+    DEBUG(std::cerr << "CBU-DSA: No 'main' function found!\n");
   }
 
   for (Module::iterator I = M.begin(), E = M.end(); I != E; ++I)
     if (!I->isExternal() && !DSInfo.count(I)) {
-#ifndef NDEBUG
-      if (MainFunc)
-        std::cerr << "*** CBU: Function unreachable from main: "
-                  << I->getName() << "\n";
-#endif
+      if (MainFunc) {
+        DEBUG(std::cerr << "*** CBU: Function unreachable from main: "
+              << I->getName() << "\n");
+      }
       calculateSCCGraphs(getOrCreateGraph(*I), Stack, NextID, ValMap);
     }
 


Index: llvm/lib/Analysis/DataStructure/Local.cpp
diff -u llvm/lib/Analysis/DataStructure/Local.cpp:1.153 llvm/lib/Analysis/DataStructure/Local.cpp:1.154
--- llvm/lib/Analysis/DataStructure/Local.cpp:1.153	Sun Aug 27 17:30:17 2006
+++ llvm/lib/Analysis/DataStructure/Local.cpp	Fri Oct 13 12:38:22 2006
@@ -544,6 +544,9 @@
           mergeWith(getValueDest(**(CS.arg_begin())));
         return;
       case Intrinsic::vaend:
+      case Intrinsic::dbg_func_start:
+      case Intrinsic::dbg_region_end:
+      case Intrinsic::dbg_stoppoint:
         return;  // noop
       case Intrinsic::memcpy_i32: 
       case Intrinsic::memcpy_i64:
@@ -1028,9 +1031,10 @@
                 Warn = true;
                 break;
               }
-          if (Warn)
-            std::cerr << "WARNING: Call to unknown external function '"
-                      << F->getName() << "' will cause pessimistic results!\n";
+          if (Warn) {
+            DEBUG(std::cerr << "WARNING: Call to unknown external function '"
+                  << F->getName() << "' will cause pessimistic results!\n");
+          }
         }
       }
 


Index: llvm/lib/Analysis/DataStructure/TopDownClosure.cpp
diff -u llvm/lib/Analysis/DataStructure/TopDownClosure.cpp:1.91 llvm/lib/Analysis/DataStructure/TopDownClosure.cpp:1.92
--- llvm/lib/Analysis/DataStructure/TopDownClosure.cpp:1.91	Sun Aug 27 17:30:17 2006
+++ llvm/lib/Analysis/DataStructure/TopDownClosure.cpp	Fri Oct 13 12:38:22 2006
@@ -371,8 +371,8 @@
 
     // If we already have this graph, recycle it.
     if (IndCallRecI != IndCallMap.end() && IndCallRecI->first == Callees) {
-      std::cerr << "  [TD] *** Reuse of indcall graph for " << Callees.size()
-                << " callees!\n";
+      DEBUG(std::cerr << "  [TD] *** Reuse of indcall graph for " << Callees.size()
+            << " callees!\n");
       IndCallGraph = IndCallRecI->second;
     } else {
       // Otherwise, create a new DSGraph to represent this.






More information about the llvm-commits mailing list