diff options
| author | Benjamin Kramer <benny.kra@googlemail.com> | 2018-09-10 12:32:06 +0000 |
|---|---|---|
| committer | Benjamin Kramer <benny.kra@googlemail.com> | 2018-09-10 12:32:06 +0000 |
| commit | 28559a2605c40def49aee8c2c2f8515a25541bdf (patch) | |
| tree | 974bd5bafaf52fa747d90647cc04ae430fe42301 /llvm/lib/CodeGen | |
| parent | 8967e18c4a7c2bc9dd88c40a68368da68b452062 (diff) | |
| download | bcm5719-llvm-28559a2605c40def49aee8c2c2f8515a25541bdf.tar.gz bcm5719-llvm-28559a2605c40def49aee8c2c2f8515a25541bdf.zip | |
Don't create a temporary vector of loop blocks just to iterate over them.
Loop's getBlocks returns an ArrayRef.
llvm-svn: 341821
Diffstat (limited to 'llvm/lib/CodeGen')
| -rw-r--r-- | llvm/lib/CodeGen/MachineLICM.cpp | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/llvm/lib/CodeGen/MachineLICM.cpp b/llvm/lib/CodeGen/MachineLICM.cpp index 7332b716203..2c9b5963537 100644 --- a/llvm/lib/CodeGen/MachineLICM.cpp +++ b/llvm/lib/CodeGen/MachineLICM.cpp @@ -497,8 +497,7 @@ void MachineLICMBase::HoistRegionPostRA() { // Walk the entire region, count number of defs for each register, and // collect potential LICM candidates. - const std::vector<MachineBasicBlock *> &Blocks = CurLoop->getBlocks(); - for (MachineBasicBlock *BB : Blocks) { + for (MachineBasicBlock *BB : CurLoop->getBlocks()) { // If the header of the loop containing this basic block is a landing pad, // then don't try to hoist instructions out of this loop. const MachineLoop *ML = MLI->getLoopFor(BB); @@ -570,8 +569,7 @@ void MachineLICMBase::HoistRegionPostRA() { /// Add register 'Reg' to the livein sets of BBs in the current loop, and make /// sure it is not killed by any instructions in the loop. void MachineLICMBase::AddToLiveIns(unsigned Reg) { - const std::vector<MachineBasicBlock *> &Blocks = CurLoop->getBlocks(); - for (MachineBasicBlock *BB : Blocks) { + for (MachineBasicBlock *BB : CurLoop->getBlocks()) { if (!BB->isLiveIn(Reg)) BB->addLiveIn(Reg); for (MachineInstr &MI : *BB) { |

