[PATCH] D88887: [AMDGPU][MC] Improved diagnostics for instructions with missing features

Dmitry Preobrazhensky via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Oct 6 04:19:48 PDT 2020


dp created this revision.
dp added a reviewer: rampitec.
Herald added subscribers: llvm-commits, kerbowa, hiraditya, t-tye, tpr, dstuttard, yaxunl, nhaehnle, jvesely, kzhuravl, arsenm.
Herald added a project: LLVM.
dp requested review of this revision.
Herald added a subscriber: wdng.

Now that assembler can reliably identify unsupported instructions, we should handle the case of missing features. In this case the specified instruction is supported but operands do not match.

There are two typical cases:

1. Instruction uses operands not valid for the specified GPU (but valid for some other GPU):

  v_add_u32 v1, v2, v3
  // GFX9: v_add_u32_e32 v1, v2, v3       ; encoding: [0x02,0x07,0x02,0x68]
  // ERR-SICI: error: instruction not supported on this GPU
  // ERR-VI: error: operands are not valid for this GPU or mode

2. Instruction requires a different wavesize mode:

  v_add_co_ci_u32_e32 v5, vcc, v1, v2, vcc
  // W64: encoding: [0x01,0x05,0x0a,0x50]
  // W32-ERR: error: operands are not valid for this GPU or mode

Any advice for a better error message is appreciated.


https://reviews.llvm.org/D88887

Files:
  llvm/lib/Target/AMDGPU/AsmParser/AMDGPUAsmParser.cpp
  llvm/test/MC/AMDGPU/add-sub-no-carry.s
  llvm/test/MC/AMDGPU/buf-fmt-d16-packed.s
  llvm/test/MC/AMDGPU/buf-fmt-d16-unpacked.s
  llvm/test/MC/AMDGPU/gfx1030_err.s
  llvm/test/MC/AMDGPU/gfx10_asm_all.s
  llvm/test/MC/AMDGPU/gfx10_asm_dpp16.s
  llvm/test/MC/AMDGPU/gfx10_asm_dpp8.s
  llvm/test/MC/AMDGPU/gfx10_asm_mimg_err.s
  llvm/test/MC/AMDGPU/lds_direct-err.s
  llvm/test/MC/AMDGPU/literals.s
  llvm/test/MC/AMDGPU/mtbuf.s
  llvm/test/MC/AMDGPU/mubuf.s
  llvm/test/MC/AMDGPU/smem.s
  llvm/test/MC/AMDGPU/smrd.s
  llvm/test/MC/AMDGPU/vop2.s
  llvm/test/MC/AMDGPU/vop3-gfx9.s
  llvm/test/MC/AMDGPU/vop3-literal.s
  llvm/test/MC/AMDGPU/vop_sdwa.s
  llvm/test/MC/AMDGPU/wave32.s



More information about the llvm-commits mailing list