Skip to content

Commit a3df9cb

Browse files
committed
[AutoBump] Merge with fixes of 67b9d3f (Jan 21)
2 parents b798fdb + 67b9d3f commit a3df9cb

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

mlir/lib/Dialect/Linalg/Utils/Utils.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -621,15 +621,15 @@ computeSliceParameters(OpBuilder &builder, Location loc, Value valueToTile,
621621
// (i.e. the op does not subsample, stepping occurs in the loop).
622622
LLVM_DEBUG(llvm::dbgs() << "computeSliceParameters: submap: " << m << "\n");
623623
IRRewriter rewriter(builder);
624-
// The offset of the slice is map(lbs) - map(0).
624+
// The offset of the slice is m(lbs) - m(0).
625625
SmallVector<Attribute> zeros(lbs.size(), rewriter.getIndexAttr(0));
626626
SmallVector<Attribute> mAtZero;
627-
auto res = m.constantFold(zeros, mAtZero);
628-
assert(succeeded(res));
629-
auto atZeroInt = getConstantIntValue(mAtZero[0]);
630-
assert(atZeroInt);
627+
[[maybe_unused]] auto res = m.constantFold(zeros, mAtZero);
628+
assert(succeeded(res) && "affine_map must be evaluatable (not symbols)");
629+
int64_t mAtZeroInt =
630+
cast<IntegerAttr>(mAtZero[0]).getValue().getSExtValue();
631631
OpFoldResult offset = makeComposedFoldedAffineApply(
632-
rewriter, loc, m.getResult(0) - *atZeroInt, lbs);
632+
rewriter, loc, m.getResult(0) - mAtZeroInt, lbs);
633633
sliceParams.offsets.push_back(offset);
634634

635635
OpFoldResult closedIntSize =

0 commit comments

Comments
 (0)