MachineBasicBlock: Add liveins() method returning an iterator_range

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@245895 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Matthias Braun
2015-08-24 22:59:52 +00:00
parent b7e01a085a
commit 56dd2d0886
20 changed files with 65 additions and 91 deletions
+3 -4
View File
@@ -791,13 +791,12 @@ TailDuplicatePass::TailDuplicate(MachineBasicBlock *TailBB,
RS->enterBasicBlock(PredBB);
if (!PredBB->empty())
RS->forward(std::prev(PredBB->end()));
for (MachineBasicBlock::livein_iterator I = TailBB->livein_begin(),
E = TailBB->livein_end(); I != E; ++I) {
if (!RS->isRegUsed(*I, false))
for (unsigned LI : TailBB->liveins()) {
if (!RS->isRegUsed(LI, false))
// If a register is previously livein to the tail but it's not live
// at the end of predecessor BB, then it should be added to its
// livein list.
PredBB->addLiveIn(*I);
PredBB->addLiveIn(LI);
}
}