[llvm] [AMDGPU] Ensure positive InstOffset for buffer operations (PR #145504)

Jay Foad via llvm-commits llvm-commits at lists.llvm.org
Tue Jun 24 06:35:33 PDT 2025


================
@@ -4547,6 +4548,16 @@ bool AMDGPUAsmParser::validateSMEMOffset(const MCInst &Inst,
 
   uint64_t Offset = Op.getImm();
   bool IsBuffer = AMDGPU::getSMEMIsBuffer(Opcode);
+  // GFX12+ S_BUFFER_*: InstOffset is signed 24, but must be positive
+  if (isGFX12Plus() && IsBuffer) {
----------------
jayfoad wrote:

Would it be neater to put this logic inside isLegalSMRDEncodedSignedOffset?

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


More information about the llvm-commits mailing list