Skip to content

Commit 75b0c91

Browse files
committed
[mlir][nfc] Update comments
1. Updates and clarifies a few comments related to hooks for vector.{insert|extract}_strided_slice. 2. For consistency with vector.insert_strided_slice, removes a TODO from vector.extract_strided_slice Op def. It's self-explenatory that adding support for non-unit strides is a "TODO".
1 parent 52a8bed commit 75b0c91

File tree

2 files changed

+9
-8
lines changed

2 files changed

+9
-8
lines changed

mlir/include/mlir/Dialect/Vector/IR/VectorOps.td

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1121,7 +1121,6 @@ def Vector_ExtractStridedSliceOp :
11211121
attribute and extracts the n-D subvector at the proper offset.
11221122

11231123
At the moment strides must contain only 1s.
1124-
// TODO: support non-1 strides.
11251124

11261125
Returns an n-D vector where the first k-D dimensions match the `sizes`
11271126
attribute. The returned subvector contains the elements starting at offset

mlir/lib/Dialect/Vector/IR/VectorOps.cpp

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2789,9 +2789,11 @@ isIntegerArrayAttrConfinedToShape(OpType op, ArrayAttr arrayAttr,
27892789
return success();
27902790
}
27912791

2792-
// Returns true if all integers in `arrayAttr` are in the interval [min, max}.
2793-
// interval. If `halfOpen` is true then the admissible interval is [min, max).
2794-
// Otherwise, the admissible interval is [min, max].
2792+
// Returns true if, for all indices i = 0..shape.size()-1, val is in the
2793+
// [min, max} interval:
2794+
// val = `arrayAttr1[i]` + `arrayAttr2[i]`,
2795+
// If `halfOpen` is true then the admissible interval is [min, max). Otherwise,
2796+
// the admissible interval is [min, max].
27952797
template <typename OpType>
27962798
static LogicalResult isSumOfIntegerArrayAttrConfinedToShape(
27972799
OpType op, ArrayAttr arrayAttr1, ArrayAttr arrayAttr2,
@@ -2845,8 +2847,8 @@ LogicalResult InsertStridedSliceOp::verify() {
28452847
auto stridesName = InsertStridedSliceOp::getStridesAttrName();
28462848
if (failed(isIntegerArrayAttrConfinedToShape(*this, offsets, destShape,
28472849
offName)) ||
2848-
failed(isIntegerArrayAttrConfinedToRange(*this, strides, 1, 1,
2849-
stridesName,
2850+
failed(isIntegerArrayAttrConfinedToRange(*this, strides, /*min=*/1,
2851+
/*max=*/1, stridesName,
28502852
/*halfOpen=*/false)) ||
28512853
failed(isSumOfIntegerArrayAttrConfinedToShape(
28522854
*this, offsets,
@@ -3250,8 +3252,8 @@ LogicalResult ExtractStridedSliceOp::verify() {
32503252
failed(isIntegerArrayAttrConfinedToShape(*this, sizes, shape, sizesName,
32513253
/*halfOpen=*/false,
32523254
/*min=*/1)) ||
3253-
failed(isIntegerArrayAttrConfinedToRange(*this, strides, 1, 1,
3254-
stridesName,
3255+
failed(isIntegerArrayAttrConfinedToRange(*this, strides, /*min=*/1,
3256+
/*max=*/1, stridesName,
32553257
/*halfOpen=*/false)) ||
32563258
failed(isSumOfIntegerArrayAttrConfinedToShape(*this, offsets, sizes,
32573259
shape, offName, sizesName,

0 commit comments

Comments
 (0)