Skip to content

Commit 0c36082

Browse files
[mlir][SCF] Use symbols in loop peeling rewrite
Use symbols in the affine map instead of dims. Dims should not be divided. Differential Revision: https://reviews.llvm.org/D108431
1 parent befb9dc commit 0c36082

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

mlir/lib/Dialect/SCF/Transforms/LoopSpecialization.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -121,10 +121,10 @@ static LogicalResult peelForLoop(RewriterBase &b, ForOp forOp, scf::IfOp &ifOp,
121121
return failure();
122122

123123
auto loc = forOp.getLoc();
124-
AffineExpr dim0, dim1, dim2;
125-
bindDims(b.getContext(), dim0, dim1, dim2);
124+
AffineExpr sym0, sym1, sym2;
125+
bindSymbols(b.getContext(), sym0, sym1, sym2);
126126
// New upper bound: %ub - (%ub - %lb) mod %step
127-
auto modMap = AffineMap::get(3, 0, {dim1 - ((dim1 - dim0) % dim2)});
127+
auto modMap = AffineMap::get(0, 3, {sym1 - ((sym1 - sym0) % sym2)});
128128
b.setInsertionPoint(forOp);
129129
splitBound = b.createOrFold<AffineApplyOp>(
130130
loc, modMap,

0 commit comments

Comments
 (0)