This patch provides an implementation for spv.func conversion. The pattern is populated in a separate method added to the pass. At the moment, the type signature conversion only includes the supported types. The conversion pattern also matches SPIR-V function control attributes to LLVM function attributes. Those are modelled as passthrough attributes in LLVM dialect. I propose the following mapping.
- None: no attributes passed
- Inline: alwaysinline seems to be the right equivalent (inlinehint is semantically weaker in my opinion)
- DontInline: noinline
- Pure and Const: I think those can be modelled as readonly and readnone attributes respectively.
Also, 2 patterns added for return ops conversion (spv.Return for void return and spv.ReturnValue for a single value return).
No need to have this comment. Comments should provide more information and explain when things are non-trivial. If the code is obvioius enough, then there is no need to have comments because comments themselves are a maintenance burden. :)