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

Amit Kumar Pandey via cfe-commits cfe-commits at lists.llvm.org
Tue Feb 11 08:18:00 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))
----------------
ampandey-1995 wrote:

> Sorry I'm still confused. If the user cannot enable `-fsanitize=address` if the GPU target doesn't support `xnack` then that should be separate driver check / error. Unless we're just silently ignoring that?

Yes we are silently ignoring that and that ```-fsanitize=address``` is there for the host only, but for device it is skipped.



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


More information about the cfe-commits mailing list