diff options
author | NAKAMURA Takumi <geek4civic@gmail.com> | 2014-10-28 11:54:05 +0000 |
---|---|---|
committer | NAKAMURA Takumi <geek4civic@gmail.com> | 2014-10-28 11:54:05 +0000 |
commit | 5af50a5470c26f21fbab4026830e9a0b9e7c95b3 (patch) | |
tree | 445489621e8617111729293374e3da60c54f5b54 /llvm/lib | |
parent | 335a7bcf1ea3834458847129be4b2454228d3fee (diff) | |
download | bcm5719-llvm-5af50a5470c26f21fbab4026830e9a0b9e7c95b3.tar.gz bcm5719-llvm-5af50a5470c26f21fbab4026830e9a0b9e7c95b3.zip |
LoopRerollPass.cpp: Use range-based loop. NFC.
llvm-svn: 220772
Diffstat (limited to 'llvm/lib')
-rw-r--r-- | llvm/lib/Transforms/Scalar/LoopRerollPass.cpp | 20 |
1 files changed, 9 insertions, 11 deletions
diff --git a/llvm/lib/Transforms/Scalar/LoopRerollPass.cpp b/llvm/lib/Transforms/Scalar/LoopRerollPass.cpp index 98ed624e1bb..e69689d73e8 100644 --- a/llvm/lib/Transforms/Scalar/LoopRerollPass.cpp +++ b/llvm/lib/Transforms/Scalar/LoopRerollPass.cpp @@ -241,10 +241,9 @@ protected: PossibleRedSet.insert(PossibleReds[i].getPHI()); PossibleRedIdx[PossibleReds[i].getPHI()] = i; - for (SimpleLoopReduction::iterator J = PossibleReds[i].begin(), - JE = PossibleReds[i].end(); J != JE; ++J) { - PossibleRedSet.insert(*J); - PossibleRedIdx[*J] = i; + for (Instruction *J : PossibleReds[i]) { + PossibleRedSet.insert(J); + PossibleRedIdx[J] = i; } } } @@ -659,16 +658,15 @@ bool LoopReroll::ReductionTracker::validateSelected() { RI != RIE; ++RI) { int i = *RI; int PrevIter = 0, BaseCount = 0, Count = 0; - for (SimpleLoopReduction::iterator J = PossibleReds[i].begin(), - JE = PossibleReds[i].end(); J != JE; ++J) { - // Note that all instructions in the chain must have been found because - // all instructions in the function must have been assigned to some - // iteration. - int Iter = PossibleRedIter[*J]; + for (Instruction *J : PossibleReds[i]) { + // Note that all instructions in the chain must have been found because + // all instructions in the function must have been assigned to some + // iteration. + int Iter = PossibleRedIter[J]; if (Iter != PrevIter && Iter != PrevIter + 1 && !PossibleReds[i].getReducedValue()->isAssociative()) { DEBUG(dbgs() << "LRR: Out-of-order non-associative reduction: " << - *J << "\n"); + J << "\n"); return false; } |