[Mlir-commits] [mlir] [mlir][vector] Simplify createReadOrMaskedRead (PR #163736)

Han-Chung Wang llvmlistbot at llvm.org
Thu Nov 6 13:49:33 PST 2025


================
@@ -219,18 +219,16 @@ bool isLinearizableVector(VectorType type);
 
 /// Creates a TransferReadOp from `source`.
 ///
-/// The shape of the vector to read is specified via `inputVectorSizes`. If the
-/// shape of the output vector differs from the shape of the value being read,
-/// masking is used to avoid out-of-bounds accesses. Set
+/// If the shape of vector to read differs from the shape of the value being
+/// read, masking is used to avoid out-of-bounds accesses. Set
 /// `useInBoundsInsteadOfMasking` to `true` to use the "in_bounds" attribute
 /// instead of explicit masks.
 ///
 /// Note: all read offsets are set to 0.
 Value createReadOrMaskedRead(OpBuilder &builder, Location loc, Value source,
-                             ArrayRef<int64_t> inputVectorSizes,
+                             const VectorType &vecToReadTy,
----------------
hanhanW wrote:

Does it start enforcing users to create VectorType when they don't have to? E.g., I searched the use in IREE, and we have one use. The type is `ShapedType`; this API change forces the use to create VectorType when they dont have to.

https://github.com/iree-org/iree/blob/fa46601cec6be66f0a2c95b7c95bd18682cc58be/compiler/src/iree/compiler/Codegen/Dialect/GPU/Transforms/Transforms.cpp#L1856-L1858

(I don't have a strong opinion, and I can fix IREE side. I mainly want to provide a data point that users will have to create VectorType when they don't care about scalable flags.)

https://github.com/llvm/llvm-project/pull/163736


More information about the Mlir-commits mailing list