[clang] [HIP][AMDGPU] Use non-LTO pipeline for non-RDC in the linker wrapper (PR #201135)

Joseph Huber via cfe-commits cfe-commits at lists.llvm.org
Tue Jun 2 08:57:41 PDT 2026


================
@@ -548,6 +551,12 @@ Expected<StringRef> clang(ArrayRef<StringRef> InputFiles, const ArgList &Args,
   if (!Triple.isNVPTX() && !Triple.isSPIRV())
     CmdArgs.push_back("-Wl,--no-undefined");
 
+  // The device inputs are bitcode stored in files with an object extension.
+  // Force the IR input language so Clang runs the compile and backend phases
+  // instead of treating them as linker inputs, which would defer codegen to
+  // the LTO link and defeat the non-LTO pipeline.
+  if (NonLTOAMDGPU)
+    CmdArgs.append({"-x", "ir"});
----------------
jhuber6 wrote:

I was referring to PGO, the other libraries are indeed linked via `-mlink`.

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


More information about the cfe-commits mailing list