LiveVariables should clear kill / dead markers first. This allows us to remove a...
authorEvan Cheng <evan.cheng@apple.com>
Fri, 26 Mar 2010 02:12:24 +0000 (02:12 +0000)
committerEvan Cheng <evan.cheng@apple.com>
Fri, 26 Mar 2010 02:12:24 +0000 (02:12 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99597 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/LiveVariables.cpp
lib/CodeGen/SelectionDAG/InstrEmitter.cpp

index 519990e04a2c540f4377528cc71461406658a465..ca8ecff8e61d65b7ec376bc0b2fe2eed0d255ddd 100644 (file)
@@ -556,17 +556,21 @@ bool LiveVariables::runOnMachineFunction(MachineFunction &mf) {
       if (MI->isPHI())
         NumOperandsToProcess = 1;
 
+      // Clear kill and dead markers. LV will recompute them.
       SmallVector<unsigned, 4> UseRegs;
       SmallVector<unsigned, 4> DefRegs;
       for (unsigned i = 0; i != NumOperandsToProcess; ++i) {
-        const MachineOperand &MO = MI->getOperand(i);
+        MachineOperand &MO = MI->getOperand(i);
         if (!MO.isReg() || MO.getReg() == 0)
           continue;
         unsigned MOReg = MO.getReg();
-        if (MO.isUse())
+        if (MO.isUse()) {
+          MO.setIsKill(false);
           UseRegs.push_back(MOReg);
-        if (MO.isDef())
+        } else /*MO.isDef()*/ {
+          MO.setIsDead(false);
           DefRegs.push_back(MOReg);
+        }
       }
 
       // Process all uses.
index 7b660f530f73f881b0dae9b12c83766dce3c89ea..28ba343e7fe67cf94060d442e501eacba1589d87 100644 (file)
@@ -640,9 +640,7 @@ EmitMachineNode(SDNode *Node, bool IsClone, bool IsCloned,
   // If the instruction has implicit defs and the node doesn't, mark the
   // implicit def as dead.  If the node has any flag outputs, we don't do this
   // because we don't know what implicit defs are being used by flagged nodes.
-  if (Node->getValueType(Node->getNumValues()-1) != MVT::Flag &&
-      // FIXME: This is a terrible hackaround for a liveintervals bug.
-      II.getNumImplicitDefs() < 8)
+  if (Node->getValueType(Node->getNumValues()-1) != MVT::Flag)
     if (const unsigned *IDList = II.getImplicitDefs()) {
       for (unsigned i = NumResults, e = II.getNumDefs()+II.getNumImplicitDefs();
            i != e; ++i)