================
@@ -5111,6 +5111,10 @@ bool CompilerInvocation::CreateFromArgsImpl(
   if (LangOpts.OpenMPIsTargetDevice)
     Res.getTargetOpts().HostTriple = Res.getFrontendOpts().AuxTriple;
 
+  // Set the default triple for SYCL device compilation.
+  if (LangOpts.SYCLIsDevice && !Args.hasArg(options::OPT_triple))
+    Res.getTargetOpts().Triple = "spirv64-unknown-unknown";
----------------
elizabethandrews wrote:

The unintended behavior exposed by this PR is not due to `HostTriple` being set 
incorrectly.  It is due to offloading toolchain being constructed unexpectedly. 
I pasted the code where this is done in a different thread. 

It looks like `HostTriple` is used only to set type properties. I made the 
suggested modifications and added a test to verify it works as expected now. 

https://github.com/llvm/llvm-project/pull/172366
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to