[PATCH] D23408: AMDGPU/SI: Avoid creating unnecessary copies in the SIFixSGPRCopies pass

Matt Arsenault via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 6 16:13:00 PDT 2016


arsenm accepted this revision.
arsenm added a comment.
This revision is now accepted and ready to land.

LGTM


================
Comment at: lib/Target/AMDGPU/SIRegisterInfo.cpp:1000
@@ -999,4 +999,3 @@
   if (TargetRegisterInfo::isVirtualRegister(Reg))
-    RC = MRI.getRegClass(Reg);
-  else
-    RC = getPhysRegClass(Reg);
+    return  MRI.getRegClass(Reg);
+
----------------
Extra space here

================
Comment at: lib/Target/AMDGPU/SIRegisterInfo.cpp:1005-1007
@@ -1003,3 +1004,5 @@
 
-  return hasVGPRs(RC);
+bool SIRegisterInfo::isVGPR(const MachineRegisterInfo &MRI,
+                            unsigned Reg) const {
+  return hasVGPRs(getRegClassForReg(MRI, Reg));
 }
----------------
This should be inline in the header and be isVGPRReg to match the existing isSGPRReg (or that should have the Reg part removed)


https://reviews.llvm.org/D23408





More information about the llvm-commits mailing list