[Mlir-commits] [mlir] [mlir][spirv] Propagate alignment requirements from vector to spirv (PR #155278)

Jakub Kuderski llvmlistbot at llvm.org
Thu Aug 28 08:25:06 PDT 2025


================
@@ -743,6 +743,22 @@ struct VectorLoadOpConverter final
 
     auto vectorPtrType = spirv::PointerType::get(spirvVectorType, storageClass);
 
+    std::optional<uint64_t> alignment = loadOp.getAlignment();
+    if (alignment > std::numeric_limits<uint32_t>::max()) {
+      return rewriter.notifyMatchFailure(loadOp,
+                                         "invalid alignment requirement");
+    }
+
+    auto memoryAccess = spirv::MemoryAccess::None;
+    spirv::MemoryAccessAttr memoryAccessAttr;
+    IntegerAttr alignmentAttr = nullptr;
----------------
kuhar wrote:

nit: we don't really need this initialization for IR types
```suggestion
    IntegerAttr alignmentAttr;
```

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


More information about the Mlir-commits mailing list