Issue 76106
Summary [mlir][spirv] Support function argument decorations
Labels help wanted, good first issue, mlir:spirv
Assignees
Reporter kuhar
    We need to support function argument decorations in `spirv.func` to allow for some pointer types. For example, the spec requires the following:

> If an OpFunctionParameter is a pointer (or array of pointers) in PhysicalStorageBuffer [storage class](https://htmlpreview.github.io/?https://github.com/KhronosGroup/SPIRV-Registry/blob/main/extensions/KHR/SPV_KHR_physical_storage_buffer.html#Storage_Class), then the function parameter must be decorated with exactly one of Aliased or Restrict.

> If an OpFunctionParameter is a pointer (or array of pointers) and its pointee type is a pointer in PhysicalStorageBuffer [storage class](https://htmlpreview.github.io/?https://github.com/KhronosGroup/SPIRV-Registry/blob/main/extensions/KHR/SPV_KHR_physical_storage_buffer.html#Storage_Class), then the function parameter must be decorated with exactly one of AliasedPointer or RestrictPointer.

Note that this is already supported with the `spirv.Variable` op using the following syntax:
```mlir
    %3 = spirv.Variable {aliased_pointer} :
      !spirv.ptr<!spirv.ptr<f32, PhysicalStorageBuffer>, Function>
```
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to