================
@@ -5318,6 +5338,21 @@ Driver::BuildOffloadingActions(Compilation &C, 
llvm::opt::DerivedArgList &Args,
     DDep.add(*PackagerAction,
              *C.getOffloadToolChains<Action::OFK_HIP>().first->second,
              /*BA=*/{}, Action::OFK_HIP);
+  } else if (SYCLNoRDC) {
----------------
YuriPlyakhin wrote:

 A SYCL fatbin is an OffloadBinary holding one or more device images that have 
already been through the device link — all from the same TU. There is more than 
one image when the TU targets several archs, or when device-image splitting is 
in effect, or both.

I can fold the branch into the `HIPNoRDC` one above. The condition becomes 
`(!UsesLLVMOffloading && HIPNoRDC) || SYCLNoRDC`, the offload kind and fatbin 
type are picked inside, and HIP's `HIPAsmBundleDeviceOut` early return needs a 
`HIPNoRDC` guard. There is no language-specific handling in the wrapper — I 
changed LinkerWrapper::ConstructJob's test from == TY_HIP_FATBIN to != 
TY_Image, so it covers both.

I'd keep `TY_SYCL_FATBIN` as a distinct type, though. We could reuse 
`TY_HIP_FATBIN`, but then SYCL temp files come out as .hipfb and 
-ccc-print-phases reports hip-fatbin for a SYCL action, which reads oddly for 
anyone debugging a SYCL build.

What do you think?

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

Reply via email to