[PATCH] D128435: [AMDGPU] Fix assertion failure on mad with negative immediate addend

Jay Foad via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jun 24 04:23:11 PDT 2022


foad added inline comments.


================
Comment at: llvm/lib/Target/AMDGPU/MCTargetDesc/AMDGPUInstPrinter.cpp:545
+  else
+    O << formatHex(Imm);
 }
----------------
arsenm wrote:
> foad wrote:
> > Perhaps I should truncate Imm to 32 bits here. I'm not sure.
> I think the truncation should be done at selection time. Ideally the verifier would enforce this (plus we should try to handle the s_mov_b64 case the comment references)
I don't understand the comment about s_mov_b64. How is it different from any other b64 operand, which zero-extends a 32-bit literal?

If we're going to verify stuff properly then we need to use different types for signed and unsigned 64-bit operands. I would prefer to do a short term fix first to avoid the assertion failures caused by D127253 (or revert it).


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D128435/new/

https://reviews.llvm.org/D128435



More information about the llvm-commits mailing list