KhronosGroup / SPIRV-LLVM-Translator

A tool and a library for bi-directional translation between SPIR-V and LLVM IR
Other
479 stars 213 forks source link

[SPIR-V Backend][SPIR Triples] Align SPIR target triples between SPIR-V Backend and SYCL/Clang frontend #2177

Open asudarsa opened 11 months ago

asudarsa commented 11 months ago

Upstream have started to add SPIRV target that register spirv64.

extern "C" LLVM_EXTERNAL_VISIBILITY void LLVMInitializeSPIRVTargetInfo() {
  RegisterTarget<Triple::spirv32> X(getTheSPIRV32Target(), "spirv32",
                                    "SPIR-V 32-bit", "SPIRV");
  RegisterTarget<Triple::spirv64> Y(getTheSPIRV64Target(), "spirv64",
                                    "SPIR-V 64-bit", "SPIRV");
  RegisterTarget<Triple::spirv> Z(getTheSPIRVLogicalTarget(), "spirv",
                                  "SPIR-V Logical", "SPIRV");
}

There are some warnings emitted when the user/driver specifies 'spir/spir64/spir32' as the triples. It will be useful to align on how to interpret these triples.

Thanks

asudarsa commented 11 months ago

Couple of related PRs:

  1. https://github.com/KhronosGroup/SPIRV-LLVM-Translator/pull/1516
  2. https://reviews.llvm.org/D109144/new/