Skip to content

Commit 861a18f

Browse files
committed
fixup! fixup! fixup! [mlir][vector] Make the in_bounds attribute mandatory
Update docs
1 parent e6a70d5 commit 861a18f

File tree

1 file changed

+24
-17
lines changed

1 file changed

+24
-17
lines changed

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

Lines changed: 24 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1401,16 +1401,19 @@ def Vector_TransferReadOp :
14011401
permutation or broadcasting. Elements whose corresponding mask element is
14021402
`0` are masked out and replaced with `padding`.
14031403

1404-
An optional boolean array attribute `in_bounds` specifies for every vector
1405-
dimension if the transfer is guaranteed to be within the source bounds. If
1406-
specified, the `in_bounds` array length has to be equal to the vector rank.
1407-
If set to "false", accesses (including the starting point) may run
1404+
For every vector dimension, the boolean array attribute `in_bounds`
1405+
specifies if the transfer is guaranteed to be within the source bounds. If
1406+
set to "false", accesses (including the starting point) may run
14081407
out-of-bounds along the respective vector dimension as the index increases.
1409-
Broadcast dimensions must always be in-bounds. In absence of the attribute,
1410-
accesses along all vector dimensions (except for broadcasts) may run
1411-
out-of-bounds. A `vector.transfer_read` can be lowered to a simple load if
1412-
all dimensions are specified to be within bounds and no `mask` was
1413-
specified. Note that non-vector dimensions *must* always be in-bounds.
1408+
Non-vector and broadcast dimensions *must* always be in-bounds. The
1409+
`in_bounds` array length has to be equal to the vector rank. This attribute
1410+
has a default value: `false` (i.e. "out-of-bounds"). When skipped in the
1411+
textual IR, the default value is assumed. Similarly, the OP printer will
1412+
omit this attribute when all dimensions are out-of-bounds (i.e. the default
1413+
value is used).
1414+
1415+
A `vector.transfer_read` can be lowered to a simple load if all dimensions
1416+
are specified to be within bounds and no `mask` was specified.
14141417

14151418
This operation is called 'read' by opposition to 'load' because the
14161419
super-vector granularity is generally not representable with a single
@@ -1643,15 +1646,19 @@ def Vector_TransferWriteOp :
16431646
any permutation. Elements whose corresponding mask element is `0` are
16441647
masked out.
16451648

1646-
An optional boolean array attribute `in_bounds` specifies for every vector
1647-
dimension if the transfer is guaranteed to be within the source bounds. If
1648-
specified, the `in_bounds` array length has to be equal to the vector rank.
1649-
If set to "false", accesses (including the starting point) may run
1649+
For every vector dimension, the boolean array attribute `in_bounds`
1650+
specifies if the transfer is guaranteed to be within the source bounds. If
1651+
set to "false", accesses (including the starting point) may run
16501652
out-of-bounds along the respective vector dimension as the index increases.
1651-
In absence of the attribute, accesses along all vector dimensions may run
1652-
out-of-bounds. A `vector.transfer_write` can be lowered to a simple store if
1653-
all dimensions are specified to be within bounds and no `mask` was
1654-
specified. Note that non-vector dimensions *must* always be in-bounds.
1653+
Non-vector and broadcast dimensions *must* always be in-bounds. The
1654+
`in_bounds` array length has to be equal to the vector rank. This attribute
1655+
has a default value: `false` (i.e. "out-of-bounds"). When skipped in the
1656+
textual IR, the default value is assumed. Similarly, the OP printer will
1657+
omit this attribute when all dimensions are out-of-bounds (i.e. the default
1658+
value is used).
1659+
1660+
A `vector.transfer_write` can be lowered to a simple store if all
1661+
dimensions are specified to be within bounds and no `mask` was specified.
16551662

16561663
This operation is called 'write' by opposition to 'store' because the
16571664
super-vector granularity is generally not representable with a single

0 commit comments

Comments
 (0)