[PATCH] D130947: TableGen: Introduce generated getSubRegisterClass function

Jay Foad via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 3 01:41:38 PDT 2022


foad added inline comments.


================
Comment at: llvm/lib/Target/AMDGPU/SIFixSGPRCopies.cpp:280
 
-    SrcRC = TRI->getSubRegClass(SrcRC, SrcSubReg);
+    if (SrcSubReg)
+      SrcRC = TRI->getSubRegisterClass(SrcRC, SrcSubReg);
----------------
arsenm wrote:
> 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
I have a slight preference for being able to call getSubRegisterClass unconditionally.


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

https://reviews.llvm.org/D130947



More information about the llvm-commits mailing list