[Mlir-commits] [mlir] [mlir] Remove unused outer loop (NFC) (PR #127998)

llvmlistbot at llvm.org llvmlistbot at llvm.org
Thu Feb 20 04:21:55 PST 2025


https://github.com/lcvon007 created https://github.com/llvm/llvm-project/pull/127998

None

>From 48c18258a9e5a63b9d380b9ff21f70cbdb3ca532 Mon Sep 17 00:00:00 2001
From: laichunfeng <laichunfeng at tencent.com>
Date: Thu, 20 Feb 2025 20:14:39 +0800
Subject: [PATCH] [mlir] Remove unused outer loop (NFC)

---
 mlir/lib/Analysis/DataFlowFramework.cpp | 26 +++++++++++--------------
 1 file changed, 11 insertions(+), 15 deletions(-)

diff --git a/mlir/lib/Analysis/DataFlowFramework.cpp b/mlir/lib/Analysis/DataFlowFramework.cpp
index 028decbae31c3..29f57c602f9cb 100644
--- a/mlir/lib/Analysis/DataFlowFramework.cpp
+++ b/mlir/lib/Analysis/DataFlowFramework.cpp
@@ -118,21 +118,17 @@ LogicalResult DataFlowSolver::initializeAndRun(Operation *top) {
   }
 
   // Run the analysis until fixpoint.
-  do {
-    // Exhaust the worklist.
-    while (!worklist.empty()) {
-      auto [point, analysis] = worklist.front();
-      worklist.pop();
-
-      DATAFLOW_DEBUG(llvm::dbgs() << "Invoking '" << analysis->debugName
-                                  << "' on: " << point << "\n");
-      if (failed(analysis->visit(point)))
-        return failure();
-    }
-
-    // Iterate until all states are in some initialized state and the worklist
-    // is exhausted.
-  } while (!worklist.empty());
+  // Iterate until all states are in some initialized state and the worklist
+  // is exhausted.
+  while (!worklist.empty()) {
+    auto [point, analysis] = worklist.front();
+    worklist.pop();
+
+    DATAFLOW_DEBUG(llvm::dbgs() << "Invoking '" << analysis->debugName
+                                << "' on: " << point << "\n");
+    if (failed(analysis->visit(point)))
+      return failure();
+  }
 
   return success();
 }



More information about the Mlir-commits mailing list