diff --git a/mlir/include/mlir/Dialect/SPIRV/SPIRVOps.td b/mlir/include/mlir/Dialect/SPIRV/SPIRVOps.td --- a/mlir/include/mlir/Dialect/SPIRV/SPIRVOps.td +++ b/mlir/include/mlir/Dialect/SPIRV/SPIRVOps.td @@ -205,7 +205,9 @@ #### Example: ```mlir - [TODO] + %0 = spv.Variable : !spv.ptr + %1 = spv.Variable : !spv.ptr + spv.CopyMemory "Function" %0, "Function" %1 : f32 ``` }]; @@ -218,7 +220,7 @@ let results = (outs); - let verifier = [{ /* TODO */ return success(); }]; + let verifier = [{ return success(); }]; } // ----- diff --git a/mlir/test/Dialect/SPIRV/Serialization/memory-ops.mlir b/mlir/test/Dialect/SPIRV/Serialization/memory-ops.mlir --- a/mlir/test/Dialect/SPIRV/Serialization/memory-ops.mlir +++ b/mlir/test/Dialect/SPIRV/Serialization/memory-ops.mlir @@ -61,7 +61,7 @@ // ----- spv.module Logical GLSL450 requires #spv.vce { - spv.func @simple_copy_memory() "None" { + spv.func @copy_memory_simple() "None" { %0 = spv.Variable : !spv.ptr %1 = spv.Variable : !spv.ptr // CHECK: spv.CopyMemory "Function" %{{.*}}, "Function" %{{.*}} : f32 @@ -79,3 +79,22 @@ spv.Return } } + + +// ----- + +spv.module Logical GLSL450 requires #spv.vce { + spv.func @copy_memory_with_access_operands() "None" { + %0 = spv.Variable : !spv.ptr + %1 = spv.Variable : !spv.ptr + // CHECK: spv.CopyMemory "Function" %{{.*}}, "Function" %{{.*}} ["Aligned", 4] : f32 + spv.CopyMemory "Function" %0, "Function" %1 ["Aligned", 4] : f32 + + %2 = spv.Variable : !spv.ptr + %3 = spv.Variable : !spv.ptr + // CHECK: spv.CopyMemory "Function" %{{.*}}, "Function" %{{.*}} ["Volatile"] : f32 + spv.CopyMemory "Function" %2, "Function" %3 ["Volatile"] : f32 + spv.Return + } +} +