[llvm-dev] [RFC] Upstreaming a proper SPIR-V backend

Renato Golin via llvm-dev llvm-dev at lists.llvm.org
Tue Mar 2 04:57:46 PST 2021


On Tue, 2 Mar 2021 at 11:07, Trifunovic, Konrad <konrad.trifunovic at intel.com>
wrote:

> I agree that developing two backends in parallel is a bit redundant. If
> SPIR-V LLVM backend becomes a production quality it means actually it could
> consume any LLVM IR (provided it does conform to some SPIR-V restrictions).
> By any LLVM IR input I mean: it should be irrelevant whether it is
> produced by a clang, MLIR to LLVM IR lowering or just some other front-end
> that produces LLVM IR.
>

Excellent.

The biggest 'impedance mismatch' that I currently see is that SPV MLIR
> dialect is now targeted mostly at Vulkan, while LLVM SPIR-V backend targets
> compute. Besides instruction set, the fundamental difference is a memory
> model.
> So if we want to unify those, we should actually make SPIR-V LLVM backend
> able to produce Vulkan dialect of SPIR-V as well.
>

I see. It is unfortunate that we have a shader focused backend in one side
and a compute focused in another. As you say, it means we can only move the
SPV MLIR lowering to LLVM once the LLVM side also supports it.

I'm guessing the support is not a trivial addition to compute and that it
will probably take place after the current proposal is mostly done.

It is unfortunate, but not altogether bad. I think it would be fine for
them to co-exist until the time we unify.


> So the idea of 'SPIR-V dialect' still exists, it is just now expressed at
> the LLVM IR level.
>

Indeed, that's what I meant.

Thanks!
--renato
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20210302/6b11ded4/attachment.html>


More information about the llvm-dev mailing list