[Mlir-commits] [mlir] [mlir][dataflow] Improve DataFlowFramework debug output (PR #176632)

llvmlistbot at llvm.org llvmlistbot at llvm.org
Sat Jan 17 23:55:44 PST 2026


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-mlir

Author: lonely eagle (linuxlonelyeagle)

<details>
<summary>Changes</summary>



---
Full diff: https://github.com/llvm/llvm-project/pull/176632.diff


2 Files Affected:

- (modified) mlir/include/mlir/Analysis/DataFlowFramework.h (+2) 
- (modified) mlir/lib/Analysis/DataFlowFramework.cpp (+4-1) 


``````````diff
diff --git a/mlir/include/mlir/Analysis/DataFlowFramework.h b/mlir/include/mlir/Analysis/DataFlowFramework.h
index 87ec01a918d90..99801c67280dc 100644
--- a/mlir/include/mlir/Analysis/DataFlowFramework.h
+++ b/mlir/include/mlir/Analysis/DataFlowFramework.h
@@ -707,6 +707,8 @@ class DataFlowAnalysis {
 
   /// Allow the data-flow solver to access the internals of this class.
   friend class DataFlowSolver;
+  // Allow the AnalysisState to access the internals of this class.
+  friend class AnalysisState;
 };
 
 template <typename AnalysisT, typename... Args>
diff --git a/mlir/lib/Analysis/DataFlowFramework.cpp b/mlir/lib/Analysis/DataFlowFramework.cpp
index 56780e8b7b127..2d4ef9f659d5a 100644
--- a/mlir/lib/Analysis/DataFlowFramework.cpp
+++ b/mlir/lib/Analysis/DataFlowFramework.cpp
@@ -46,7 +46,8 @@ void AnalysisState::addDependency(ProgramPoint *dependent,
   DATAFLOW_DEBUG({
     if (inserted) {
       LDBG() << "Creating dependency between " << debugName << " of " << anchor
-             << "\nand " << debugName << " on " << *dependent;
+             << "\nand " << debugName << " on " << *dependent << "\nwith "
+             << analysis->debugName;
     }
   });
 }
@@ -135,6 +136,8 @@ LogicalResult DataFlowSolver::initializeAndRun(Operation *top) {
   // Run the analysis until fixpoint.
   // Iterate until all states are in some initialized state and the worklist
   // is exhausted.
+  DATAFLOW_DEBUG(LDBG() << "Initialize child analyses successfully, start run "
+                           "the analysis until fixpoint");
   while (!worklist.empty()) {
     auto [point, analysis] = worklist.front();
     worklist.pop();

``````````

</details>


https://github.com/llvm/llvm-project/pull/176632


More information about the Mlir-commits mailing list