[flang-commits] [lld] [mlir] [llvm] [clang-tools-extra] [flang] [compiler-rt] [libc] [libcxx] [lldb] [clang] [MLIR] Enable GPU Dialect to SYCL runtime integration (PR #71430)

Fabian Mora via flang-commits flang-commits at lists.llvm.org
Fri Nov 17 04:13:15 PST 2023


================
@@ -61,6 +63,7 @@ registerAllGPUToLLVMIRTranslations(DialectRegistry &registry) {
   registerLLVMDialectTranslation(registry);
   registerNVVMDialectTranslation(registry);
   registerROCDLDialectTranslation(registry);
+  registerSPIRVDialectTranslation(registry);
----------------
fabianmcg wrote:

The call to `registry.insert<spirv::SPIRVDialect>();` is needed so that `mlir-translate` can parse the code containing the SPIR-V target attribute, nothing more; there's no translation happening from SPIR-V to LLVM. If the call is not added, then `mlir-translate` throws an error because `SPIR-V` never gets registered.

The question is, should an empty translation to LLVM should be added to mirror all other * to LLVM translation code structure, or is inlining the call ok? I definitely prefer the second option -one less target.

https://github.com/llvm/llvm-project/pull/71430


More information about the flang-commits mailing list