[Mlir-commits] [mlir] [mlir][SPIR-V] Fix CopyMemory handling of a lone memory operands mask (PR #226969)

Igor Wodiany llvmlistbot at llvm.org
Wed Sep 30 09:50:22 PDT 2026


================
@@ -208,10 +208,16 @@ static LogicalResult verifyMemoryAccessAttribute(MemoryOpTy memoryOp) {
 
   // MakePointerVisible applies to reads through the pointer, so it is invalid
   // for Store and for the Target operand of CopyMemory, both of which only
-  // write through it.
+  // write through it. A CopyMemory mask is Target-only when a Source mask
+  // follows it, otherwise it applies to both operands.
   if constexpr (std::is_same_v<MemoryOpTy, StoreOp> ||
                 std::is_same_v<MemoryOpTy, CopyMemoryOp>) {
-    if (spirv::bitEnumContainsAll(memAccess.getValue(),
+    bool writeOnly = true;
----------------
IgWod wrote:

```suggestion
    bool sourceOnly = true;
```
nit: We call it source everywhere so maybe that's more consistent?

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


More information about the Mlir-commits mailing list