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

Carl Ritson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Oct 12 03:26:35 PDT 2020


critson 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) {
----------------
foad wrote:
> Is this "if" just an optimization?
It is necessary because getRegSplitParts does not give a valid/useful results for a single SGPR.


================
Comment at: llvm/lib/Target/AMDGPU/SIInstrInfo.cpp:676-678
+  // If all registers have been overwritten then we must still
+  // generate something to define the super register and kill
+  // the source.  So remove one overwrite.
----------------
foad wrote:
> In this case would it be better to generate an IMPLICIT_DEF of the superregister, instead of a real copy?
Good point.


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