[PATCH] D109144: [SPIR-V] Add SPIR-V triple architecture and clang target info

Henry Linjamäki via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Oct 8 06:16:41 PDT 2021


linjamaki added a comment.

> What I have in mind is to continue using SPIR target for now (until SPIR-V back-end is added).

> For instance, SYCL compiler emits code for SPIR target and code format is configured via flag.
>
> `-emit-llvm` changes output file format for regular C++ compilation flow:
>
>   clang++ a.cpp -c -o a.o                      # object format by default 
>   clang++ a.cpp -c -emit-llvm -o a.bc          # LLVM IR format with `-emit-llvm`
>
> Similar approach for HIP device compilation flow:
>
>   clang++ -target spir -x hip a.cpp -cuda-device-only -o a.spv                 # SPIR-V format by default
>   clang++ -target spir -x hip a.cpp -cuda-device-only -emit-llvm -o a.bc       # LLVM IR (aka SPIR) format with `-emit-llvm` if needed
>
> I think this was proposed in RFC. @linjamaki, am I right?

In the RFC we proposed a HIP compilation flow for producing and **embedding** SPIR-V binary into the host executable. What was not stated in the RFC clearly is that the process is supposed to be carried out without the need for clients to issue explicit commands for producing SPIR-V binaries and then to link them into the final executable separately. D110622 <https://reviews.llvm.org/D110622> has test cases as examples for this.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D109144/new/

https://reviews.llvm.org/D109144



More information about the cfe-commits mailing list