llvm.org GIT mirror llvm / 4507f08
Fix liveintervals handling of dbg_value instructions. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98686 91177308-0d34-0410-b5e6-96231b3b80d8 Evan Cheng 10 years ago
2 changed file(s) with 28 addition(s) and 9 deletion(s). Raw diff Collapse all Expand all
140140 for (MachineBasicBlock::iterator mii = mbbi->begin(),
141141 mie = mbbi->end(); mii != mie; ++mii) {
142142 if (mii->isDebugValue())
143 OS << SlotIndex::getEmptyKey() << '\t' << *mii;
143 OS << " \t" << *mii;
144144 else
145145 OS << getInstructionIndex(mii) << '\t' << *mii;
146146 }
582582 // Look for kills, if it reaches a def before it's killed, then it shouldn't
583583 // be considered a livein.
584584 MachineBasicBlock::iterator mi = MBB->begin();
585 MachineBasicBlock::iterator E = MBB->end();
586 // Skip over DBG_VALUE at the start of the MBB.
587 if (mi != E && mi->isDebugValue()) {
588 while (++mi != E && mi->isDebugValue())
589 ;
590 if (mi == E)
591 // MBB is empty except for DBG_VALUE's.
592 return;
593 }
594
585595 SlotIndex baseIndex = MIIdx;
586596 SlotIndex start = baseIndex;
587597 if (getInstructionFromIndex(baseIndex) == 0)
590600 SlotIndex end = baseIndex;
591601 bool SeenDefUse = false;
592602
593 MachineBasicBlock::iterator E = MBB->end();
594603 while (mi != E) {
595 while (mi != E && mi->isDebugValue())
596 ++mi;
597 if (mi == E)
598 break;
599604 if (mi->killsRegister(interval.reg, tri_)) {
600605 DEBUG(dbgs() << " killed");
601606 end = baseIndex.getDefIndex();
612617 break;
613618 }
614619
615 ++mi;
616 if (mi != E && !mi->isDebugValue()) {
620 while (++mi != E && mi->isDebugValue())
621 // Skip over DBG_VALUE.
622 ;
623 if (mi != E)
617624 baseIndex = indexes_->getNextNonNullIndex(baseIndex);
618 }
619625 }
620626
621627 // Live-in register might not be used at all.
0 ; RUN: llc < %s
1 ; rdar://7759395
2
3 %0 = type { i32, i32 }
4
5 define void @t(%0*, i32, i32, i32, i32) nounwind {
6 tail call void @llvm.dbg.value(metadata !{%0* %0}, i64 0, metadata !0)
7 unreachable
8 }
9
10 declare void @llvm.dbg.value(metadata, i64, metadata) nounwind readnone
11
12 !0 = metadata !{i32 0} ;