[clang] [HIP] Use linker wrapper for device-only code object links (PR #211675)

Yaxun Liu via cfe-commits cfe-commits at lists.llvm.org
Mon Jul 27 18:53:16 PDT 2026


================
@@ -5154,15 +5163,40 @@ Driver::BuildOffloadingActions(Compilation &C, llvm::opt::DerivedArgList &Args,
           (OffloadTriple->getOS() == llvm::Triple::OSType::AMDHSA ||
            OffloadTriple->getOS() == llvm::Triple::OSType::ChipStar);
 
-      if ((A->getType() != types::TY_Object && !IsHIPSPV &&
-           A->getType() != types::TY_LTO_BC) ||
-          HIPRelocatableObj || !HIPNoRDC || !offloadDeviceOnly())
+      if (HIPRelocatableObj || !HIPNoRDC || !offloadDeviceOnly()) {
----------------
yxsamliu wrote:

The N inputs are different GPU architectures of the same TU. A single wrapper invocation lets `--offload-jobs` link the architectures in parallel and then emit the TU’s fat binary. With N wrapper invocations, each wrapper would have only one link job, and we would need another step to bundle the N outputs. Different TUs are only linked together in RDC mode.

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


More information about the cfe-commits mailing list