[Mlir-commits] [mlir] [mlir][vector] Add alignment attribute to `maskedload` and `maskedstore` (PR #151690)

Jakub Kuderski llvmlistbot at llvm.org
Tue Aug 5 09:17:10 PDT 2025


================
@@ -121,6 +121,25 @@ LogicalResult getVectorToLLVMAlignment(const LLVMTypeConverter &typeConverter,
   return success();
 }
 
+// Helper to resolve the alignment for vector load/store, gather and scatter
+// ops. First, this method will try to obtain the preferred alignment from the
+// load or store operation itself. If the store or load operation does not
+// contain any preferred alignment, then it will get alignment attribute through
+// the type or the backend.
+template <class LoadOrStoreOp>
+LogicalResult getVectorToLLVMAlignment(LoadOrStoreOp loadOrStoreOp,
+                                       const LLVMTypeConverter &typeConverter,
+                                       VectorType vectorType,
+                                       MemRefType memrefType, unsigned &align,
+                                       bool useVectorAlignment) {
----------------
kuhar wrote:

This is a bit of an awkward function signature with the out parameter being second to last... I think it'd be better to keep it inline in this instance.

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


More information about the Mlir-commits mailing list