diff options
author | Andrzej Warzynski <andrzej.warzynski@arm.com> | 2024-01-22 14:21:21 +0000 |
---|---|---|
committer | Andrzej Warzynski <andrzej.warzynski@arm.com> | 2024-01-22 14:25:27 +0000 |
commit | 75b0c913a5fa3895818a7c7a066c0a8e1a214329 (patch) | |
tree | 103521dda97e1a75083f6eca73b908e90193c86e | |
parent | 52a8bed426e59d10b41a12208d3ba55cd2c76a1f (diff) | |
download | llvm-75b0c913a5fa3895818a7c7a066c0a8e1a214329.zip llvm-75b0c913a5fa3895818a7c7a066c0a8e1a214329.tar.gz llvm-75b0c913a5fa3895818a7c7a066c0a8e1a214329.tar.bz2 |
[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".
-rw-r--r-- | mlir/include/mlir/Dialect/Vector/IR/VectorOps.td | 1 | ||||
-rw-r--r-- | mlir/lib/Dialect/Vector/IR/VectorOps.cpp | 16 |
2 files changed, 9 insertions, 8 deletions
diff --git a/mlir/include/mlir/Dialect/Vector/IR/VectorOps.td b/mlir/include/mlir/Dialect/Vector/IR/VectorOps.td index 8e333de..fdf51f0 100644 --- a/mlir/include/mlir/Dialect/Vector/IR/VectorOps.td +++ b/mlir/include/mlir/Dialect/Vector/IR/VectorOps.td @@ -1121,7 +1121,6 @@ def Vector_ExtractStridedSliceOp : attribute and extracts the n-D subvector at the proper offset. At the moment strides must contain only 1s. - // TODO: support non-1 strides. Returns an n-D vector where the first k-D dimensions match the `sizes` attribute. The returned subvector contains the elements starting at offset diff --git a/mlir/lib/Dialect/Vector/IR/VectorOps.cpp b/mlir/lib/Dialect/Vector/IR/VectorOps.cpp index 749eb56..791924f 100644 --- a/mlir/lib/Dialect/Vector/IR/VectorOps.cpp +++ b/mlir/lib/Dialect/Vector/IR/VectorOps.cpp @@ -2789,9 +2789,11 @@ isIntegerArrayAttrConfinedToShape(OpType op, ArrayAttr arrayAttr, return success(); } -// Returns true if all integers in `arrayAttr` are in the interval [min, max}. -// interval. If `halfOpen` is true then the admissible interval is [min, max). -// Otherwise, the admissible interval is [min, max]. +// Returns true if, for all indices i = 0..shape.size()-1, val is in the +// [min, max} interval: +// val = `arrayAttr1[i]` + `arrayAttr2[i]`, +// If `halfOpen` is true then the admissible interval is [min, max). Otherwise, +// the admissible interval is [min, max]. template <typename OpType> static LogicalResult isSumOfIntegerArrayAttrConfinedToShape( OpType op, ArrayAttr arrayAttr1, ArrayAttr arrayAttr2, @@ -2845,8 +2847,8 @@ LogicalResult InsertStridedSliceOp::verify() { auto stridesName = InsertStridedSliceOp::getStridesAttrName(); if (failed(isIntegerArrayAttrConfinedToShape(*this, offsets, destShape, offName)) || - failed(isIntegerArrayAttrConfinedToRange(*this, strides, 1, 1, - stridesName, + failed(isIntegerArrayAttrConfinedToRange(*this, strides, /*min=*/1, + /*max=*/1, stridesName, /*halfOpen=*/false)) || failed(isSumOfIntegerArrayAttrConfinedToShape( *this, offsets, @@ -3250,8 +3252,8 @@ LogicalResult ExtractStridedSliceOp::verify() { failed(isIntegerArrayAttrConfinedToShape(*this, sizes, shape, sizesName, /*halfOpen=*/false, /*min=*/1)) || - failed(isIntegerArrayAttrConfinedToRange(*this, strides, 1, 1, - stridesName, + failed(isIntegerArrayAttrConfinedToRange(*this, strides, /*min=*/1, + /*max=*/1, stridesName, /*halfOpen=*/false)) || failed(isSumOfIntegerArrayAttrConfinedToShape(*this, offsets, sizes, shape, offName, sizesName, |