[llvm-dev] [RfC] A proposal of adding SPIR-V Toolchain in Clang

Derek Schuff via llvm-dev llvm-dev at lists.llvm.org
Wed Sep 12 15:25:52 PDT 2018


On Wed, Sep 12, 2018 at 2:55 PM Richard Smith via llvm-dev <
llvm-dev at lists.llvm.org> wrote:

>
> I don't see how SPIR-V is any different from WebAssembly or PTXAS in this
> regard. I also don't see why a "whole backend" is a different amount of
> work from a separate program that implements a whole backend.
>
>

Our experience with WebAssembly (or really with its predecessors PNaCl and
asm.js) was that it certainly is possible to do a reasonable implementation
of TargetMachine and the related interfaces without using all of the common
bits in lib/CodeGen that aren't suitable. However it does mean duplicating
some of the functionality; for example when you skip SelectionDAG you end
up having to re-implement a lot of the type legalization that happens
during that stage. This was one of the top concerns we heard when we
proposed upstreaming: people didn't want that duplication (and confusion
about there being 2 different ways to do the same thing) even if the
duplicated functionality was itself shared between projects. My observation
was that one of the key things that got WebAssembly greater acceptance was
our decision to use the lib/CodeGen pipeline. (I can't really say about
NVPTX).

I think if you were principled about the design you could probably support
a use case like SPIR-V in a reasonable way, but you'd need to convince
stakeholders that things have changed (a lot changes over the period of
years) and that the benefits justify the costs, etc.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20180912/2428935b/attachment-0001.html>


More information about the llvm-dev mailing list