[llvm] r223208 - R600/SI: Fix SIFixSGPRCopies for copies to physical registers

Matt Arsenault Matthew.Arsenault at amd.com
Tue Dec 2 21:22:39 PST 2014


Author: arsenm
Date: Tue Dec  2 23:22:39 2014
New Revision: 223208

URL: http://llvm.org/viewvc/llvm-project?rev=223208&view=rev
Log:
R600/SI: Fix SIFixSGPRCopies for copies to physical registers

This shows up when operands required to be passed in VCC are copied
to.

Modified:
    llvm/trunk/lib/Target/R600/SIFixSGPRCopies.cpp

Modified: llvm/trunk/lib/Target/R600/SIFixSGPRCopies.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/R600/SIFixSGPRCopies.cpp?rev=223208&r1=223207&r2=223208&view=diff
==============================================================================
--- llvm/trunk/lib/Target/R600/SIFixSGPRCopies.cpp (original)
+++ llvm/trunk/lib/Target/R600/SIFixSGPRCopies.cpp Tue Dec  2 23:22:39 2014
@@ -182,7 +182,12 @@ bool SIFixSGPRCopies::isVGPRToSGPRCopy(c
   unsigned DstReg = Copy.getOperand(0).getReg();
   unsigned SrcReg = Copy.getOperand(1).getReg();
   unsigned SrcSubReg = Copy.getOperand(1).getSubReg();
-  const TargetRegisterClass *DstRC = MRI.getRegClass(DstReg);
+
+  const TargetRegisterClass *DstRC
+    = TargetRegisterInfo::isVirtualRegister(DstReg) ?
+    MRI.getRegClass(DstReg) :
+    TRI->getRegClass(DstReg);
+
   const TargetRegisterClass *SrcRC;
 
   if (!TargetRegisterInfo::isVirtualRegister(SrcReg) ||





More information about the llvm-commits mailing list