[llvm-branch-commits] [llvm-branch] r84155 - in /llvm/branches/Apple/Leela: lib/CodeGen/LiveVariables.cpp test/CodeGen/X86/2009-10-14-LiveVariablesBug.ll

Bob Wilson bob.wilson at apple.com
Wed Oct 14 16:42:03 PDT 2009


Author: bwilson
Date: Wed Oct 14 18:42:03 2009
New Revision: 84155

URL: http://llvm.org/viewvc/llvm-project?rev=84155&view=rev
Log:
$ svn merge -c 84153 https://bwilson@llvm.org/svn/llvm-project/llvm/trunk
--- Merging r84153 into '.':
A    test/CodeGen/X86/2009-10-14-LiveVariablesBug.ll
U    lib/CodeGen/LiveVariables.cpp

Added:
    llvm/branches/Apple/Leela/test/CodeGen/X86/2009-10-14-LiveVariablesBug.ll
      - copied unchanged from r84153, llvm/trunk/test/CodeGen/X86/2009-10-14-LiveVariablesBug.ll
Modified:
    llvm/branches/Apple/Leela/lib/CodeGen/LiveVariables.cpp

Modified: llvm/branches/Apple/Leela/lib/CodeGen/LiveVariables.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Leela/lib/CodeGen/LiveVariables.cpp?rev=84155&r1=84154&r2=84155&view=diff

==============================================================================
--- llvm/branches/Apple/Leela/lib/CodeGen/LiveVariables.cpp (original)
+++ llvm/branches/Apple/Leela/lib/CodeGen/LiveVariables.cpp Wed Oct 14 18:42:03 2009
@@ -323,10 +323,21 @@
       // The last partial def kills the register.
       LastPartDef->addOperand(MachineOperand::CreateReg(Reg, false/*IsDef*/,
                                                 true/*IsImp*/, true/*IsKill*/));
-    else
+    else {
+      MachineOperand *MO =
+        LastRefOrPartRef->findRegisterDefOperand(Reg, false, TRI);
+      bool NeedEC = MO->isEarlyClobber() && MO->getReg() != Reg;
       // If the last reference is the last def, then it's not used at all.
       // That is, unless we are currently processing the last reference itself.
       LastRefOrPartRef->addRegisterDead(Reg, TRI, true);
+      if (NeedEC) {
+        // If we are adding a subreg def and the superreg def is marked early
+        // clobber, add an early clobber marker to the subreg def.
+        MO = LastRefOrPartRef->findRegisterDefOperand(Reg);
+        if (MO)
+          MO->setIsEarlyClobber();
+      }
+    }
   } else if (!PhysRegUse[Reg]) {
     // Partial uses. Mark register def dead and add implicit def of
     // sub-registers which are used.





More information about the llvm-branch-commits mailing list