[PATCH] D147334: [AMDGPU] Don't select _SGPR forms of SMEM instructions on GFX9+

Jay Foad via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Mar 31 09:06:06 PDT 2023


foad created this revision.
foad added a reviewer: AMDGPU.
Herald added subscribers: kosarev, StephenFan, kerbowa, hiraditya, tpr, dstuttard, yaxunl, jvesely, kzhuravl, arsenm.
Herald added a project: All.
foad requested review of this revision.
Herald added subscribers: llvm-commits, wdng.
Herald added a project: LLVM.

On GFX9+, SMEM instructions have an _SGPR_IMM form which is strictly
more powerful than the _SGPR form. It simplifies codegen if we always
select the _SGPR_IMM form with an immediate offset of 0 instead of the
_SGPR form.

Note that this patch just makes minimal changes to the selection
patterns to prove the concept. Further simplifications are possible to
reduced the number of selection patterns.

On GFX9 the _SGPR form of the Real instruction is still required for
assembly/disassembly but on GFX10+ it can be removed completely.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D147334

Files:
  llvm/lib/Target/AMDGPU/AMDGPU.td
  llvm/lib/Target/AMDGPU/SMInstructions.td
  llvm/test/CodeGen/AMDGPU/GlobalISel/inst-select-load-constant.mir
  llvm/test/CodeGen/AMDGPU/GlobalISel/inst-select-load-smrd.mir
  llvm/test/CodeGen/AMDGPU/amdgcn-load-offset-from-reg.ll
  llvm/test/CodeGen/AMDGPU/smrd-gfx10.ll
  llvm/test/CodeGen/AMDGPU/splitkit-getsubrangeformask.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D147334.510053.patch
Type: text/x-patch
Size: 19639 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230331/f7b96cef/attachment.bin>


More information about the llvm-commits mailing list