================
@@ -922,6 +947,8 @@ void Driver::CreateOffloadingDeviceToolChains(Compilation 
&C,
                    IsAMDOffloadArch(StringToOffloadArch(
                        getProcessorFromTargetID(*AMDTriple, Arch)))) {
           DerivedArchs[AMDTriple->getTriple()].insert(Arch);
+        } else if (SPIRVTriple && Arch == (*SPIRVTriple).str()) {
----------------
sarnex wrote:

Yeah so here this is a case where SPIR-V is an outlier so stuff gets weird. 
This code gets hit when `-fopenmp` is passed, `-fopenmp-targets` is not passed, 
and `--offload-arch` is passed and we need to deduce the toolchain based on the 
offload arch. I implemented it such that you can pass `spirv64-intel` to 
`--offload-arch` and it will use the SPIR-V OpenMP toolchain. Arch will be 
`spirv64-intel` so we go inside the `if` and everything works.

Another option is that we could not allow the `spirv64-intel` option to 
`--offload-arch` to deduce to the SPIR-V OpenMP toolchain in this case, so 
basically you can't use `--offload-arch` with this toolchain. Maybe that's 
philosophically better. 

Let me know what you think.

https://github.com/llvm/llvm-project/pull/120145
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to