When processing loops for scheduling latencies (used for live outs on loop

back-edges), make sure not to include dbg_value instructions in the count.
Closing in on the end of rdar://7797940

llvm-svn: 107119
This commit is contained in:
Jim Grosbach 2010-06-29 04:48:13 +00:00
parent d0c8a0f031
commit 907673c48d
1 changed files with 4 additions and 1 deletions

View 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();