[llvm] r223207 - R600/SI: Remove incorrect assertion

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


Author: arsenm
Date: Tue Dec  2 23:22:38 2014
New Revision: 223207

URL: http://llvm.org/viewvc/llvm-project?rev=223207&view=rev
Log:
R600/SI: Remove incorrect assertion

This can be a COPY to a physical register, such as VCC

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=223207&r1=223206&r2=223207&view=diff
==============================================================================
--- llvm/trunk/lib/Target/R600/SIFixSGPRCopies.cpp (original)
+++ llvm/trunk/lib/Target/R600/SIFixSGPRCopies.cpp Tue Dec  2 23:22:38 2014
@@ -136,12 +136,12 @@ const TargetRegisterClass *SIFixSGPRCopi
                                                  const MachineRegisterInfo &MRI,
                                                  unsigned Reg,
                                                  unsigned SubReg) const {
-  // The Reg parameter to the function must always be defined by either a PHI
-  // or a COPY, therefore it cannot be a physical register.
-  assert(TargetRegisterInfo::isVirtualRegister(Reg) &&
-         "Reg cannot be a physical register");
 
-  const TargetRegisterClass *RC = MRI.getRegClass(Reg);
+  const TargetRegisterClass *RC
+    = TargetRegisterInfo::isVirtualRegister(Reg) ?
+    MRI.getRegClass(Reg) :
+    TRI->getRegClass(Reg);
+
   RC = TRI->getSubRegClass(RC, SubReg);
   for (MachineRegisterInfo::use_instr_iterator
        I = MRI.use_instr_begin(Reg), E = MRI.use_instr_end(); I != E; ++I) {





More information about the llvm-commits mailing list