================
@@ -672,20 +673,34 @@ void amdgpu::getAMDGPUTargetFeatures(const Driver &D,
 
 /// AMDGPU Toolchain
 AMDGPUToolChain::AMDGPUToolChain(const Driver &D, const llvm::Triple &Triple,
-                                 const ArgList &Args)
+                                 const ArgList &Args, const ToolChain *HostTC_,
+                                 Action::OffloadKind Kind,
+                                 bool ShouldLinkDeviceLibs_)
     : Generic_ELF(D, Triple, Args),
       OptionsDefault(
-          {{options::OPT_O, "3"}, {options::OPT_cl_std_EQ, "CL1.2"}}) {
+          {{options::OPT_O, "3"}, {options::OPT_cl_std_EQ, "CL1.2"}}),
+      HostTC(HostTC_), UseHIPLinker(Kind == Action::OFK_HIP),
+      ShouldLinkDeviceLibs(ShouldLinkDeviceLibs_) {
   loadMultilibsFromYAML(Args, D);
 
   // Check code object version options. Emit warnings for legacy options
   // and errors for the last invalid code object version options.
   // It is done here to avoid repeated warning or error messages for
   // each tool invocation.
   checkAMDGPUCodeObjectVersion(D, Args);
+
+  if (Triple.getOS() == llvm::Triple::AMDHSA &&
----------------
jhuber6 wrote:

Targeting C isn't a degenerate case, it's just treating it like every other 
target. C++ is a little more iffy if you're a standards purist, as GPUs have a 
conflicting memory model and no forward progress guarantees. The degenerate 
case is keying off of the language, which I agree, but that's entirely because 
`OpenCL` wants to link the ROCm DLs by default and this was the easiest way to 
make it not do that. I agree that adding `-llvm` is cleaner, but the libraries 
built with it needed to be compatible with the LLVM/OpenMP toolchains we 
shipped, which can be cleaned up in the future.

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

Reply via email to