When processing loops for scheduling latencies (used for live outs on loop
authorJim Grosbach <grosbach@apple.com>
Tue, 29 Jun 2010 04:48:13 +0000 (04:48 +0000)
committerJim Grosbach <grosbach@apple.com>
Tue, 29 Jun 2010 04:48:13 +0000 (04:48 +0000)
back-edges), make sure not to include dbg_value instructions in the count.
Closing in on the end of rdar://7797940

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@107119 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/ScheduleDAGInstrs.h

index ad82db28f88bcd1e89a7559416d1b135a558a9df..d90659bb163efd1e0f51449754e2e92c4b847b70 100644 (file)
@@ -69,8 +69,10 @@ namespace llvm {
                      const SmallSet<unsigned, 8> &LoopLiveIns) {
       unsigned Count = 0;
       for (MachineBasicBlock::const_iterator I = MBB->begin(), E = MBB->end();
-           I != E; ++I, ++Count) {
+           I != E; ++I) {
         const MachineInstr *MI = I;
+        if (MI->isDebugValue())
+          continue;
         for (unsigned i = 0, e = MI->getNumOperands(); i != e; ++i) {
           const MachineOperand &MO = MI->getOperand(i);
           if (!MO.isReg() || !MO.isUse())
@@ -79,6 +81,7 @@ namespace llvm {
           if (LoopLiveIns.count(MOReg))
             Deps.insert(std::make_pair(MOReg, std::make_pair(&MO, Count)));
         }
+        ++Count; // Not every iteration due to dbg_value above.
       }
 
       const std::vector<MachineDomTreeNode*> &Children = Node->getChildren();