[PATCH] D128014: [AMDGPU] Improve assembler + disassembler handling of kernel descriptors

Scott Linder via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jun 16 15:02:17 PDT 2022


scott.linder created this revision.
Herald added subscribers: kosarev, jsilvanus, hsmhsm, foad, kerbowa, rupprecht, hiraditya, t-tye, tpr, dstuttard, yaxunl, nhaehnle, jvesely, kzhuravl, emaste, arsenm.
Herald added a reviewer: jhenderson.
Herald added a reviewer: MaskRay.
Herald added a project: All.
scott.linder requested review of this revision.
Herald added subscribers: llvm-commits, StephenFan, wdng.
Herald added a project: LLVM.

Changes to the assembly format with regard to kernel descriptors are
difficult to keep "complete", as there are several places which need
to be updated.

Some bugs have crept into the assembler and disassembler related to new
GFX processors, and some fields have been introduced to the kernel
descriptor which have no corresponding assembler syntax which makes the
disassembly "incomplete".

This patch addresses the above by:

- Add a comment to AMDHSAKernelDescriptor.h, as at least one small set towards keeping the code in sync.
- Relax the AsmParser to accept `.amdhsa_wavefront_size32 0` when the `.amdhsa_shared_vgpr_count` directive is present.
- Teach the KD disassembler to respect the setting of KERNEL_CODE_PROPERTY_ENABLE_WAVEFRONT_SIZE32 when calculating the value of `.amdhsa_next_free_vgpr`.
- Teach the KD disassembler to disassemble COMPUTE_PGM_RSRC3 for gfx90a and gfx10+.
- Include "pseudo directive" comments for gfx10 fields which are not controlled by any assembler directive.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D128014

Files:
  llvm/include/llvm/Support/AMDHSAKernelDescriptor.h
  llvm/lib/Target/AMDGPU/AsmParser/AMDGPUAsmParser.cpp
  llvm/lib/Target/AMDGPU/Disassembler/AMDGPUDisassembler.cpp
  llvm/lib/Target/AMDGPU/Disassembler/AMDGPUDisassembler.h
  llvm/test/tools/llvm-objdump/ELF/AMDGPU/kd-gfx10.s
  llvm/test/tools/llvm-objdump/ELF/AMDGPU/kd-gfx90a.s
  llvm/test/tools/llvm-objdump/ELF/AMDGPU/kd-zeroed-gfx10.s
  llvm/tools/llvm-objdump/llvm-objdump.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D128014.437723.patch
Type: text/x-patch
Size: 28859 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220616/a999330f/attachment.bin>


More information about the llvm-commits mailing list