[llvm-branch-commits] [llvm-branch] r106002 - in /llvm/branches/Apple/Troughton: ./ lib/CodeGen/RegAllocFast.cpp test/CodeGen/X86/2010-06-15-FastAllocEarlyCLobber.ll

Jakob Stoklund Olesen stoklund at 2pi.dk
Tue Jun 15 09:37:06 PDT 2010


Author: stoklund
Date: Tue Jun 15 11:37:06 2010
New Revision: 106002

URL: http://llvm.org/viewvc/llvm-project?rev=106002&view=rev
Log:
$ svn merge -c 105998 https://llvm.org/svn/llvm-project/llvm/trunk
--- Merging r105998 into '.':
A    test/CodeGen/X86/2010-06-15-FastAllocEarlyCLobber.ll
U    lib/CodeGen/RegAllocFast.cpp


Added:
    llvm/branches/Apple/Troughton/test/CodeGen/X86/2010-06-15-FastAllocEarlyCLobber.ll
      - copied unchanged from r105998, llvm/trunk/test/CodeGen/X86/2010-06-15-FastAllocEarlyCLobber.ll
Modified:
    llvm/branches/Apple/Troughton/   (props changed)
    llvm/branches/Apple/Troughton/lib/CodeGen/RegAllocFast.cpp

Propchange: llvm/branches/Apple/Troughton/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Tue Jun 15 11:37:06 2010
@@ -1 +1 @@
-/llvm/trunk:105358,105361,105369,105372,105399,105427,105437,105439,105441,105470,105473,105481,105498,105541,105554,105557,105585-105586,105634,105653,105665,105669,105677,105745,105749,105774-105775,105836,105845,105862,105938,105959,105965,105982
+/llvm/trunk:105358,105361,105369,105372,105399,105427,105437,105439,105441,105470,105473,105481,105498,105541,105554,105557,105585-105586,105634,105653,105665,105669,105677,105745,105749,105774-105775,105836,105845,105862,105938,105959,105965,105982,105998

Modified: llvm/branches/Apple/Troughton/lib/CodeGen/RegAllocFast.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Troughton/lib/CodeGen/RegAllocFast.cpp?rev=106002&r1=106001&r2=106002&view=diff
==============================================================================
--- llvm/branches/Apple/Troughton/lib/CodeGen/RegAllocFast.cpp (original)
+++ llvm/branches/Apple/Troughton/lib/CodeGen/RegAllocFast.cpp Tue Jun 15 11:37:06 2010
@@ -708,7 +708,8 @@
       if (MO.isUse()) {
         usePhysReg(MO);
       } else if (MO.isEarlyClobber()) {
-        definePhysReg(MI, Reg, MO.isDead() ? regFree : regReserved);
+        definePhysReg(MI, Reg, (MO.isImplicit() || MO.isDead()) ?
+                               regFree : regReserved);
         PhysECs.push_back(Reg);
       }
     }
@@ -731,8 +732,11 @@
         // Note: defineVirtReg may invalidate MO.
         LiveRegMap::iterator LRI = defineVirtReg(MI, i, Reg, 0);
         unsigned PhysReg = LRI->second.PhysReg;
-        setPhysReg(MI, i, PhysReg);
+        if (setPhysReg(MI, i, PhysReg))
+          VirtDead.push_back(Reg);
         PhysECs.push_back(PhysReg);
+        // Don't attempt coalescing when earlyclobbers are present.
+        CopyDst = 0;
       }
     }
 
@@ -767,7 +771,8 @@
     // Allocate defs and collect dead defs.
     for (unsigned i = 0; i != DefOpEnd; ++i) {
       MachineOperand &MO = MI->getOperand(i);
-      if (!MO.isReg() || !MO.isDef() || !MO.getReg()) continue;
+      if (!MO.isReg() || !MO.isDef() || !MO.getReg() || MO.isEarlyClobber())
+        continue;
       unsigned Reg = MO.getReg();
 
       if (TargetRegisterInfo::isPhysicalRegister(Reg)) {





More information about the llvm-branch-commits mailing list