[llvm-dev] [cfe-dev] [RfC] A proposal of adding SPIR-V Toolchain in Clang (original) (raw)

Anastasia Stulova via llvm-dev llvm-dev at lists.llvm.org
Mon Sep 17 01:40:26 PDT 2018


This would work for us!


From: James Courtier-Dutton <james.dutton at gmail.com> Sent: 16 September 2018 12:11 To: Anastasia Stulova Cc: clang developer list; llvm-dev at lists.llvm.org; nd; Brian.Sumner at amd.com Subject: Re: [cfe-dev] [RfC] A proposal of adding SPIR-V Toolchain in Clang

On 10 September 2018 at 16:10, Anastasia Stulova via cfe-dev <cfe-dev at lists.llvm.org<mailto:cfe-dev at lists.llvm.org>> wrote:

An example of how Clang can be used to target SPIR-V:

clang -c test.cl<http://test.cl> -target spirv[32|64]-unknown-unknown -o test.spv

This will result in the following Clang actions:

(1) clang -cc1 -triple spirv[32|64]-unknown-unknown test.cl<http://test.cl> -emit-llvm-bc -o test.bc

(2) llvm-spirv test.bc -o test.spv

Hi,

At a high level, one can view the output of backends as being "lower" than LLVM IR. If we wish to output representations that are at a similar level to LLVM IR, then it might be sensible not to use the backends method. How about a new output method. e.g. Instead of: (1) clang -cc1 -triple spirv[32|64]-unknown-unknown test.cl<http://test.cl> -emit-llvm-bc -o test.bc (2) llvm-spirv test.bc -o test.spv Use: clang -cc1 -triple spirv[32|64]-unknown-unknown test.cl<http://test.cl> -emit-spirv -o test.spv With -emit-xxxx being plugins that do not fit well with the existing backend api. This could also be used for output representations that are higher than LLVM IR, e.g. C We could treat them as a final LLVM IR Module pass, that results in some file output

Kind Regards

James

-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20180917/dd9591e1/attachment.html>



More information about the llvm-dev mailing list