[PATCH] D98549: [AMDGPU] Fix copyPhysReg to not produce unalined vgpr access

Stanislav Mekhanoshin via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Mar 12 14:19:10 PST 2021


rampitec added inline comments.


================
Comment at: llvm/lib/Target/AMDGPU/SIInstrInfo.cpp:879
+  const TargetRegisterClass *SrcRC = RI.getPhysRegClass(SrcReg);
+  if (RC->hasSuperClassEq(RI.getVGPR64Class()) &&
+      !RI.hasAGPRs(SrcRC) &&
----------------
arsenm wrote:
> It would be easier to follow if you directly referred to the aligned class. getVGPR64Class will always return that anyway on the targets with the alignment requirement
That's exactly the point, to get either aligned or unaligned class depending on ST.


================
Comment at: llvm/lib/Target/AMDGPU/SIInstrInfo.cpp:915-918
+  } else if ((Size % 64 == 0) && RI.hasVGPRs(RC) && !RI.hasAGPRs(SrcRC) &&
+             (RC == RI.getVGPRClassForBitWidth(Size) &&
+              (RI.isSGPRClass(SrcRC) ||
+               SrcRC == RI.getVGPRClassForBitWidth(Size)))) {
----------------
arsenm wrote:
> This seems more complicated than it needs to be
Suggestions?


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

https://reviews.llvm.org/D98549



More information about the llvm-commits mailing list