[Mlir-commits] [mlir] [mlir][SPIRV] Support Alignment and FuncParamAttr on parameters (PR #231069)

Dmitry Sidorov llvmlistbot at llvm.org
Tue Oct 20 03:03:57 PDT 2026


MrSidims wrote:

> Why is alignment a stand-alone construct but Restrict goes via generic decoration? It feels like a hack not a solution.

These are 2 different things. `Restrict` (and `Alignment`) are indeed decorations and present in https://registry.khronos.org/SPIR-V/specs/unified1/SPIRV.html#Decoration table. `ByVal`, `NoAlias` etc do not present there, instead there are [function parameter attributes](https://registry.khronos.org/SPIR-V/specs/unified1/SPIRV.html#Function_Parameter_Attribute) . You may argue, that function parameter attribute is actually `FuncParamAttr` decoration that just has an extra Literal operand to encode the attribute, so we could do something like this:
`#spirv.decoration<FuncParamAttr, /*Sret*/ 3>`
which is fair, but is it really different from what the patch does?

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


More information about the Mlir-commits mailing list