Skip to content

Commit 35d7bf2

Browse files
authored
[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.
1 parent 22f5268 commit 35d7bf2

File tree

1 file changed

+11
-15
lines changed

1 file changed

+11
-15
lines changed

mlir/lib/Analysis/DataFlowFramework.cpp

Lines changed: 11 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -118,21 +118,17 @@ LogicalResult DataFlowSolver::initializeAndRun(Operation *top) {
118118
}
119119

120120
// Run the analysis until fixpoint.
121-
do {
122-
// Exhaust the worklist.
123-
while (!worklist.empty()) {
124-
auto [point, analysis] = worklist.front();
125-
worklist.pop();
126-
127-
DATAFLOW_DEBUG(llvm::dbgs() << "Invoking '" << analysis->debugName
128-
<< "' on: " << point << "\n");
129-
if (failed(analysis->visit(point)))
130-
return failure();
131-
}
132-
133-
// Iterate until all states are in some initialized state and the worklist
134-
// is exhausted.
135-
} while (!worklist.empty());
121+
// Iterate until all states are in some initialized state and the worklist
122+
// is exhausted.
123+
while (!worklist.empty()) {
124+
auto [point, analysis] = worklist.front();
125+
worklist.pop();
126+
127+
DATAFLOW_DEBUG(llvm::dbgs() << "Invoking '" << analysis->debugName
128+
<< "' on: " << point << "\n");
129+
if (failed(analysis->visit(point)))
130+
return failure();
131+
}
136132

137133
return success();
138134
}

0 commit comments

Comments
 (0)