[Mlir-commits] [mlir] [mlir][spirv] Support function argument decorations for ptr in the PhysicalStorageBuffer (PR #76353)

Lei Zhang llvmlistbot at llvm.org
Thu Jan 4 10:16:14 PST 2024


================
@@ -414,7 +414,7 @@ spirv.module Physical64 OpenCL requires #spirv.vce<v1.0, [Kernel, Addresses], []
 // -----
 
 spirv.module PhysicalStorageBuffer64 OpenCL requires #spirv.vce<v1.0, [Kernel, Addresses, PhysicalStorageBufferAddresses], []> {
-  spirv.func @covert_ptr_to_u_PhysicalStorageBuffer(%arg0 : !spirv.ptr<i32, PhysicalStorageBuffer>) "None" {
+  spirv.func @covert_ptr_to_u_PhysicalStorageBuffer(%arg0 : !spirv.ptr<i32, PhysicalStorageBuffer> { spirv.decoration = #spirv.decoration<Aliased> }) "None" {
----------------
antiagainst wrote:

This is okay for now; but later we might want to have custom parser/printer to simpify it into something like `%arg0 : !spirv.ptr<...> Aliased` or something (cannot recall exactly the restrictions on attribute parsing/printing). Also given we are here for `spirv.func`, it would be nice to omit the function control when it's `"None"`. Not for this patch though. 

@kuhar as FYI

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


More information about the Mlir-commits mailing list