Skip to content

Commit f619c6f

Browse files
committed
upliftWhileToForLoop func
1 parent e439c36 commit f619c6f

File tree

2 files changed

+192
-182
lines changed

2 files changed

+192
-182
lines changed

mlir/include/mlir/Dialect/SCF/Transforms/Transforms.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -222,6 +222,12 @@ FailureOr<WhileOp> wrapWhileLoopInZeroTripCheck(WhileOp whileOp,
222222
RewriterBase &rewriter,
223223
bool forceCreateCheck = false);
224224

225+
/// Try to uplift `scf.while` op to `scf.for`.
226+
/// Uplifitng expects a specific ops pattern:
227+
/// * `before` block consisting of single arith.cmp op
228+
/// * `after` block containing arith.addi
229+
FailureOr<ForOp> upliftWhileToForLoop(RewriterBase &rewriter, WhileOp loop);
230+
225231
} // namespace scf
226232
} // namespace mlir
227233

0 commit comments

Comments
 (0)