[clang] [llvm] [Driver][AMDGPU] Enable sanitizers AMDGCN flavoured SPIR-V (PR #241411)

Alex Voicu via cfe-commits cfe-commits at lists.llvm.org
Wed Nov 11 10:48:26 PST 2026


================
@@ -1390,18 +1390,23 @@ SanitizerMask AMDGPUToolChain::getSupportedSanitizers(
       ToolChain::getSupportedSanitizers(BA, DeviceOffloadKind);
 
   // Address sanitizer is potentially supported, but depends on the exact target
-  // arch xnack support.
-  if (!BA || isXnackAvailable(getTriple(), BA.ArchName))
+  // arch XNACK support; for SPIR-V, the availability of XNACK is known at
+  // finalisation time.
+  if (!BA ||
+      (isXnackAvailable(getTriple(), BA.ArchName) || getTriple().isSPIRV()))
     SupportedMask |= SanitizerKind::Address;
   // Watchpoint probes do not require xnack, but the runtime requires HSA.
-  if (getTriple().isAMDGCN() && getTriple().getOS() == llvm::Triple::AMDHSA)
+  if ((getTriple().isAMDGCN() || getTriple().isSPIRV()) &&
----------------
AlexVlx wrote:

Done.

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


More information about the cfe-commits mailing list