[PATCH] D89187: [AMDGPU] Minimize number of s_mov generated by copyPhysReg

Jay Foad via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Oct 12 03:36:35 PDT 2020


foad added inline comments.


================
Comment at: llvm/lib/Target/AMDGPU/SIInstrInfo.cpp:665
+    const TargetRegisterClass *CopyRC = RI.getPhysRegClass(CopyReg);
+    if (CopyRC == &AMDGPU::SReg_32_XM0RegClass ||
+        CopyRC == &AMDGPU::SReg_32RegClass) {
----------------
critson wrote:
> foad wrote:
> > Is this "if" just an optimization?
> It is necessary because getRegSplitParts does not give a valid/useful results for a single SGPR.
Perhaps getRegSplitParts could be fixed to handle this degenerate case. It seems fragile to list all the SReg_32 classes here -- e.g. did you forget SReg_32_XEXEC_HI and SReg_32_XM0_XEXEC?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D89187



More information about the llvm-commits mailing list