[all-commits] [llvm/llvm-project] 66b481: [AMDGPU][AsmParser]: Use dummy operand for parsing...

Jeffrey Byrnes via All-commits all-commits at lists.llvm.org
Mon Oct 27 18:40:22 PDT 2025


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 66b481556e01e6e2508d7c9146849167b9e0323f
      https://github.com/llvm/llvm-project/commit/66b481556e01e6e2508d7c9146849167b9e0323f
  Author: Jeffrey Byrnes <jeffrey.byrnes at amd.com>
  Date:   2025-10-27 (Mon, 27 Oct 2025)

  Changed paths:
    M llvm/lib/Target/AMDGPU/AsmParser/AMDGPUAsmParser.cpp
    A llvm/test/MC/AMDGPU/buffer-op-swz-operand.s
    A llvm/test/tools/llvm-mca/AMDGPU/buffer-op-swz-operand.s

  Log Message:
  -----------
  [AMDGPU][AsmParser]: Use dummy operand for parsing buffer_ SWZ operand. (#165305)

`MCInstrDesc` counts the SWZ operand for `NumOperands` -- thus, since we
do not parse this into the `MCInst` operands, there will be a mismatch
between `MCInst.getNumOperands` and `MCInstrDesc.getNumOperands` .

`llvm-mca` assumes that each operand counted by
`MCInstrDesc.getNumOperands` will be present in `MCInst.operands`
https://github.com/llvm/llvm-project/blob/263377a17570e1cbe6eeae9ffa5ce02f240839ef/llvm/lib/MCA/InstrBuilder.cpp#L324

This parses a dummy operand for the buffer_loads as a placeholder for
the implicit SWZ operand. This is similar to the parsing of `tbuffer_`
variants which automatically parse the dummy operand
https://github.com/llvm/llvm-project/blob/263377a17570e1cbe6eeae9ffa5ce02f240839ef/llvm/utils/TableGen/AsmMatcherEmitter.cpp#L1853



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list