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

Anastasia Stulova via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Oct 26 12:43:49 PDT 2021


Anastasia added a comment.

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

>> Thanks for the clarifications. So it seems that you are not expecting that the device target triple is being explicitly passed anywhere then and that means you pass the device triple implicitly?
>
> We are meaning to use the `--offload` as a way to pass device target triple explicitly.
>
>> Although your `--offload` option does seem conceptually like a device target triple, so I wonder if better naming for it would be `--offload-target`? Would it work for you if we introduce SPIR-V triple explicitly and you use it as a device offload triple?
>
> To introduce a way to pass a device target triple in HIP compilation, we decided it to be aligned with the envisioned “Unified Offload Option” feature [1] to avoid overlap with similar concept. The design of the feature is pending. AFAIK, @yaxunl, who is working on it, hasn't got time yet to continue the work. In D110622 <https://reviews.llvm.org/D110622> we propose adding the `--offload` option as partial implementation and there is a bit of discussion about the design too.
>
>> It would probably makes sense to use the same triple to targeting SPIR-V generation by everyone?
>
> Yes, it makes sense.
>
>> However I appreciate that OpenCL flow would be somewhat different since it doesn't have a split into host and device but only contains device compilation phase...
>
> The split is specific to offloading languages (such as CUDA, HIP and OpenMP) whose compilation flow is different from the traditional compilation flow. The traditional compilation flow used for non-offloading languages naturally does not have the host/device compilation split.

Ok, thanks for the details. It seems we all at least need a separate triple for SPIR-V even though it might not be called exactly a conventional triple... However, making a distinct target that corresponds to the triple is conventional...


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