[llvm-commits] [llvm] r110730 - /llvm/trunk/lib/CodeGen/CalcSpillWeights.cpp

Jakob Stoklund Olesen stoklund at 2pi.dk
Tue Aug 10 14:16:16 PDT 2010


Author: stoklund
Date: Tue Aug 10 16:16:16 2010
New Revision: 110730

URL: http://llvm.org/viewvc/llvm-project?rev=110730&view=rev
Log:
Give up on register class recalculation when the register is used with subreg
operands. We don't currently have a hook to provide "the largest super class of
A where all registers' getSubReg(subidx) is valid and in B".

Modified:
    llvm/trunk/lib/CodeGen/CalcSpillWeights.cpp

Modified: llvm/trunk/lib/CodeGen/CalcSpillWeights.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/CalcSpillWeights.cpp?rev=110730&r1=110729&r2=110730&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/CalcSpillWeights.cpp (original)
+++ llvm/trunk/lib/CodeGen/CalcSpillWeights.cpp Tue Aug 10 16:16:16 2010
@@ -181,10 +181,19 @@
   SmallPtrSet<const TargetRegisterClass*,8> rcs;
 
   for (MachineRegisterInfo::reg_nodbg_iterator I = mri.reg_nodbg_begin(reg),
-       E = mri.reg_nodbg_end(); I != E; ++I)
+       E = mri.reg_nodbg_end(); I != E; ++I) {
+    // The targets don't have accurate enough regclass descriptions that we can
+    // handle subregs. We need something similar to
+    // TRI::getMatchingSuperRegClass, but returning a super class instead of a
+    // sub class.
+    if (I.getOperand().getSubReg()) {
+      DEBUG(dbgs() << "Cannot handle subregs: " << I.getOperand() << '\n');
+      return;
+    }
     if (const TargetRegisterClass *rc =
                                 I->getDesc().getRegClass(I.getOperandNo(), tri))
       rcs.insert(rc);
+  }
 
   // If we found no regclass constraints, just leave reg as is.
   // In theory, we could inflate to the largest superclass of reg's existing





More information about the llvm-commits mailing list