[llvm] AMDGPU: Only disassemble .amdhsa_reserve_xnack_mask on xnack targets (PR #212789)

Matt Arsenault via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 20 09:01:19 PDT 2026


================
@@ -2480,10 +2481,15 @@ Expected<bool> AMDGPUDisassembler::decodeCOMPUTE_PGM_RSRC1(
   KdStream << Indent << ".amdhsa_reserve_vcc " << 0 << '\n';
   if (!hasArchitectedFlatScratch())
     KdStream << Indent << ".amdhsa_reserve_flat_scratch " << 0 << '\n';
-  bool ReservedXnackMask = STI.hasFeature(AMDGPU::FeatureXNACK);
-  assert(!ReservedXnackMask || STI.hasFeature(AMDGPU::FeatureSupportsXNACK));
-  KdStream << Indent << ".amdhsa_reserve_xnack_mask " << ReservedXnackMask
-           << '\n';
+  // Only print the directive on xnack-supporting targets (matching the
+  // asmprinter), unless the binary erronously set xnack on an unsupported
+  // target
----------------
arsenm wrote:

I don't think so, I'd rather have weird binaries be obvious 

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


More information about the llvm-commits mailing list