[llvm] r292755 - [PM] Improve the debug logging to always include the IR unit's name when

Chandler Carruth via llvm-commits llvm-commits at lists.llvm.org
Sun Jan 22 02:33:55 PST 2017


Author: chandlerc
Date: Sun Jan 22 04:33:54 2017
New Revision: 292755

URL: http://llvm.org/viewvc/llvm-project?rev=292755&view=rev
Log:
[PM] Improve the debug logging to always include the IR unit's name when
logging pass and analyses information.

This is particularly useful when filtering the debug log for
a particular function or loop where something got inappropriately
cached.

Modified:
    llvm/trunk/include/llvm/IR/PassManager.h

Modified: llvm/trunk/include/llvm/IR/PassManager.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/IR/PassManager.h?rev=292755&r1=292754&r2=292755&view=diff
==============================================================================
--- llvm/trunk/include/llvm/IR/PassManager.h (original)
+++ llvm/trunk/include/llvm/IR/PassManager.h Sun Jan 22 04:33:54 2017
@@ -791,7 +791,7 @@ public:
 
         if (DebugLogging)
           dbgs() << "Invalidating analysis: " << this->lookUpPass(ID).name()
-                 << "\n";
+                 << " on " << IR.getName() << "\n";
 
         I = ResultsList.erase(I);
         AnalysisResults.erase({ID, &IR});
@@ -832,7 +832,8 @@ private:
     if (Inserted) {
       auto &P = this->lookUpPass(ID);
       if (DebugLogging)
-        dbgs() << "Running analysis: " << P.name() << "\n";
+        dbgs() << "Running analysis: " << P.name() << " on " << IR.getName()
+               << "\n";
       AnalysisResultListT &ResultList = AnalysisResultLists[&IR];
       ResultList.emplace_back(ID, P.run(IR, *this, ExtraArgs...));
 
@@ -863,7 +864,7 @@ private:
 
     if (DebugLogging)
       dbgs() << "Invalidating analysis: " << this->lookUpPass(ID).name()
-             << "\n";
+             << " on " << IR.getName() << "\n";
     AnalysisResultLists[&IR].erase(RI->second);
     AnalysisResults.erase(RI);
   }




More information about the llvm-commits mailing list