The starting indices of all vector dimensions are allowed to be out-of-bounds.
E.g.:
// %j is allowed to be out-of-bounds (but not %i). %0 = vector.transfer_read %m[%i, %j] ... {in_bounds = [false]} : memref<?x?xf32>, vector<5xf32>
This revision just updates the op documentation and adds extra test cases. Out-of-bounds starting points are already supported by the respective lowerings:
- 2D and higher-dimensional transfers are lowered to 1D transfers by VectorToScf. These patterns generate an scf.if check for every (potentially unrolled) loop iteration if the dimension is in_bounds = false, including the first loop iteration.
- 1D out-of-bounds transfers are lowered to in-bounds transfers by MaterializeTransferMask, which adds a mask to the op. The mask is defined by vector.create_mask (dim-size) - (index). In case of an out-of-bounds starting point, the operand of the vector.create_mask op is 0 or negative. Negative operands are treated like 0 according to the documentation of vector.create_mask.