[Mlir-commits] [mlir] [mlir][vector] Check the indices when inferring in_bounds from a permutation map (PR #221268)
Hung-Kuan Tseng
llvmlistbot at llvm.org
Sun Nov 1 05:32:08 PST 2026
================
@@ -225,9 +225,10 @@ bool isLinearizableVector(VectorType type);
/// instead of explicit masks.
///
/// When `permutationMap` is provided the in_bounds attribute is inferred from
-/// it: dimension i is in-bounds when the map result is an AffineDimExpr
-/// pointing to a static memref dimension divisible by the vector size, or an
-/// AffineConstantExpr (broadcast). Custom`indices` must also be supplied in
+/// it and from `indices`: dimension i is in-bounds when the map result is an
+/// AffineDimExpr pointing to a static memref dimension divisible by the vector
+/// size whose index is a known multiple of the vector size, or an
+/// AffineConstantExpr (broadcast). Custom `indices` must also be supplied in
/// that case; if `indices` is empty, all offsets default to 0.
Value createReadOrMaskedRead(OpBuilder &builder, Location loc, Value source,
const VectorType &vecToReadTy,
----------------
Tim096 wrote:
Yes. If the index is a multiple of the vector size and below a dim size divisible by it, it is at most `dim - vectorSize`, so the whole vector fits. An index outside the dim is already an invalid access. The comment says this now.
https://github.com/llvm/llvm-project/pull/221268
More information about the Mlir-commits
mailing list