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

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


Author: laichunfeng
Date: 2025-02-21T13:04:44+08:00
New Revision: 35d7bf21b6d665e8107288a6372fe9dfe0f0c329

URL: https://github.com/llvm/llvm-project/commit/35d7bf21b6d665e8107288a6372fe9dfe0f0c329
DIFF: https://github.com/llvm/llvm-project/commit/35d7bf21b6d665e8107288a6372fe9dfe0f0c329.diff

LOG: [mlir] Remove unused outer loop (NFC) (#127998)

The program will exit the outer loop directly if inner loop ends, so the
outer do {} while() is redundant.

Added: 
    

Modified: 
    mlir/lib/Analysis/DataFlowFramework.cpp

Removed: 
    


################################################################################
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