diff options
author | Matthias Braun <matze@braunis.de> | 2015-08-24 22:59:52 +0000 |
---|---|---|
committer | Matthias Braun <matze@braunis.de> | 2015-08-24 22:59:52 +0000 |
commit | b2b7ef1de8118095963e1c085467fc411bd7e56f (patch) | |
tree | 10da40c76c37d53e59e8197182bd65cfffde9301 /llvm/lib/CodeGen/TailDuplication.cpp | |
parent | 008ff14acf9ce39d855dbeeb622e0598bbad0d93 (diff) | |
download | llvm-b2b7ef1de8118095963e1c085467fc411bd7e56f.zip llvm-b2b7ef1de8118095963e1c085467fc411bd7e56f.tar.gz llvm-b2b7ef1de8118095963e1c085467fc411bd7e56f.tar.bz2 |
MachineBasicBlock: Add liveins() method returning an iterator_range
llvm-svn: 245895
Diffstat (limited to 'llvm/lib/CodeGen/TailDuplication.cpp')
-rw-r--r-- | llvm/lib/CodeGen/TailDuplication.cpp | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/llvm/lib/CodeGen/TailDuplication.cpp b/llvm/lib/CodeGen/TailDuplication.cpp index fc29eafb5..ca929d9 100644 --- a/llvm/lib/CodeGen/TailDuplication.cpp +++ b/llvm/lib/CodeGen/TailDuplication.cpp @@ -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); } } |