forked from OSchip/llvm-project
[mlir][scf] Fix bug in peelForLoop
Insertion point should be set before creating new operations. Differential Revision: https://reviews.llvm.org/D107326
This commit is contained in:
parent
f1affe8dc8
commit
767974f344
|
@ -116,6 +116,7 @@ LogicalResult mlir::scf::peelForLoop(RewriterBase &b, ForOp forOp,
|
|||
bindDims(b.getContext(), dim0, dim1, dim2);
|
||||
// New upper bound: %ub - (%ub - %lb) mod %step
|
||||
auto modMap = AffineMap::get(3, 0, {dim1 - ((dim1 - dim0) % dim2)});
|
||||
b.setInsertionPoint(forOp);
|
||||
Value splitBound = b.createOrFold<AffineApplyOp>(
|
||||
loc, modMap,
|
||||
ValueRange{forOp.lowerBound(), forOp.upperBound(), forOp.step()});
|
||||
|
|
Loading…
Reference in New Issue