[llvm-commits] [llvm] r151855 - /llvm/trunk/lib/Target/ARM/Thumb1RegisterInfo.cpp

Jakob Stoklund Olesen stoklund at 2pi.dk
Thu Mar 1 14:57:33 PST 2012


Author: stoklund
Date: Thu Mar  1 16:57:32 2012
New Revision: 151855

URL: http://llvm.org/viewvc/llvm-project?rev=151855&view=rev
Log:
Handle regmasks in Thumb1RegisterInfo::saveScavengerRegister().

This function could have r12 live across a function call when compiling
thumb1 code.

The test case for this is not included because it is very long. It must
provoke emergency spilling near a function call. The behavior is
provoked by MultiSource/Applications/JM/lencod, and it triggers an
assertion in the scavenger.

<rdar://problem/10963642>

Modified:
    llvm/trunk/lib/Target/ARM/Thumb1RegisterInfo.cpp

Modified: llvm/trunk/lib/Target/ARM/Thumb1RegisterInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/Thumb1RegisterInfo.cpp?rev=151855&r1=151854&r2=151855&view=diff
==============================================================================
--- llvm/trunk/lib/Target/ARM/Thumb1RegisterInfo.cpp (original)
+++ llvm/trunk/lib/Target/ARM/Thumb1RegisterInfo.cpp Thu Mar  1 16:57:32 2012
@@ -571,6 +571,11 @@
     // If this instruction affects R12, adjust our restore point.
     for (unsigned i = 0, e = II->getNumOperands(); i != e; ++i) {
       const MachineOperand &MO = II->getOperand(i);
+      if (MO.isRegMask() && MO.clobbersPhysReg(ARM::R12)) {
+        UseMI = II;
+        done = true;
+        break;
+      }
       if (!MO.isReg() || MO.isUndef() || !MO.getReg() ||
           TargetRegisterInfo::isVirtualRegister(MO.getReg()))
         continue;





More information about the llvm-commits mailing list