[PATCH] D130947: TableGen: Introduce generated getSubRegisterClass function

Matt Arsenault via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 2 12:59:44 PDT 2022


arsenm added inline comments.


================
Comment at: llvm/lib/Target/AMDGPU/SIFixSGPRCopies.cpp:280
 
-    SrcRC = TRI->getSubRegClass(SrcRC, SrcSubReg);
+    if (SrcSubReg)
+      SrcRC = TRI->getSubRegisterClass(SrcRC, SrcSubReg);
----------------
foad wrote:
> Why add this "if", given that the generated method handles the NoSubregister case?
I was thinking it isn't very useful to call if there's a subregister. I blindly copied the 0 case from getSubRegClass


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

https://reviews.llvm.org/D130947



More information about the llvm-commits mailing list