We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 99d6e05 commit 38c407bCopy full SHA for 38c407b
mlir/lib/Transforms/Utils/LoopUtils.cpp
@@ -220,7 +220,12 @@ LogicalResult mlir::promoteIfSingleIteration(scf::ForOp forOp) {
220
/// their body into the containing Block.
221
void mlir::promoteSingleIterationLoops(FuncOp f) {
222
// Gathers all innermost loops through a post order pruned walk.
223
- f.walk([](AffineForOp forOp) { promoteIfSingleIteration(forOp); });
+ f.walk([](Operation *op) {
224
+ if (auto forOp = dyn_cast<AffineForOp>(op))
225
+ promoteIfSingleIteration(forOp);
226
+ else if (auto forOp = dyn_cast<scf::ForOp>(op))
227
228
+ });
229
}
230
231
/// Generates an affine.for op with the specified lower and upper bounds
0 commit comments