[clang] Reapply "[Driver][ROCm][OpenMP] Fix default ockl linking for OpenMP."… (PR #126671)

via cfe-commits cfe-commits at lists.llvm.org
Tue Feb 11 08:26:26 PST 2025


================
@@ -68,7 +68,9 @@ llvm::opt::DerivedArgList *AMDGPUOpenMPToolChain::TranslateArgs(
     Action::OffloadKind DeviceOffloadKind) const {
   DerivedArgList *DAL =
       HostTC.TranslateArgs(Args, BoundArch, DeviceOffloadKind);
-  if (!DAL || Args.hasArg(options::OPT_fsanitize_EQ))
+  // Skip sanitize options passed from the HostTC. The decision to instrument
+  // device code is computed only by 'shouldSkipSanitizeOption'.
+  if (!DAL && DAL->hasArg(options::OPT_fsanitize_EQ))
----------------
b-sumner wrote:

> Silently ignoring this sounds pretty awful to me, but if that's what ROCm wants I guess that's the behavior.

We're not (supposed to be) silently ignoring it.  We should be producing a warning that the device code has not been instrumented.

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


More information about the cfe-commits mailing list