[PATCH] D134423: [AMDGPU] Fix vgpr2sgpr copy analysis to check scalar operands of buffer instructions use scalar registers.

Alexander via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Nov 2 15:10:31 PDT 2022


alex-t added inline comments.


================
Comment at: llvm/lib/Target/AMDGPU/SIFixSGPRCopies.cpp:939
+  if (Info->HasMBUFScalarReg) {
+    Info->Score = 0;
+    return false;
----------------
Setting Info->Score to 0 means that it **NEEDS** to be VALU!
Setting it to zero if SChain is empty means that V2S copy has no SALU descendants and definitely needs to be VALU. So early returns to avoid the rest of the computations.

In your case, you return **false** specifically to indicate that this particular V2S copy has in its SALU chain MUBUF that requires SGPR and it should be **NEVER** converted to VALU even if its chain is short or empty.


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

https://reviews.llvm.org/D134423



More information about the llvm-commits mailing list