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

Anastasia Stulova via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Oct 13 04:04:19 PDT 2021


Anastasia added a comment.

In D109144#3050945 <https://reviews.llvm.org/D109144#3050945>, @linjamaki wrote:

>> 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.

Can you explain what does this mean

> without the need for clients to issue explicit commands for producing SPIR-V binaries

? In the tests I can see the following `--offload=spirv64` which does feel like it is specified explicitly that the target is SPIR-V...


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D109144



More information about the llvm-commits mailing list