[Mlir-commits] [mlir] [mlir][SPIR-V] Update the `ConvertToSPIRV` pass to use dialect interfaces (PR #102046)

Fabian Mora llvmlistbot at llvm.org
Tue Aug 6 06:38:51 PDT 2024


fabianmcg wrote:

> This is interesting! What's your motivation for this beyond what's explained in the PR description? Is this to better align with the llvm conversion or do you have some out of tree dialects that you would like to support?

It's both, I think it should align with `convert-to-llvm` and I have downstream project that needs to go to SPIR-V.

> The reason I'm asking is that converting to SPIR-V has a set of issues that are unique to it and make it harder (I think?) than conversion to llvm:
> 
> * It does not support arbitrary (1d) vector types
> * It does not support arbitrary integer types
> * I think arrays are also more limited
> * Not all ops are converted directly and some require expansion / emulation before conversion (e.g., masked vector load / store).
> 
> Because of these complications, our plan immediate was to stick with handcrafted conversion that happens in a few phases.

I noticed the vector issue with `cf-to-spirv`. If `convert-to-spirv` is run with unrolling activated, then it produces incorrect results.

I think some of the issues you mention can be solved within the dialect conversion infrastructure., or with missing intermediate ops.


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


More information about the Mlir-commits mailing list