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

krishna chaitanya sankisa via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Nov 3 03:12:58 PDT 2022


skc7 added inline comments.


================
Comment at: llvm/lib/Target/AMDGPU/SIFixSGPRCopies.cpp:939
+  if (Info->HasMBUFScalarReg) {
+    Info->Score = 0;
+    return false;
----------------
alex-t wrote:
> 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.
Since needToBeConvertedToVALU returns without any score calculation in this case, I assumed I need to make the score zero and return. Thanks for helping with this.


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

https://reviews.llvm.org/D134423



More information about the llvm-commits mailing list