diff options
author | Pedro Tammela <pctammela@gmail.com> | 2020-10-30 16:34:01 +0000 |
---|---|---|
committer | David Green <david.green@arm.com> | 2020-10-30 16:50:07 +0000 |
commit | 70a495c7f0f28790e976cdecc93846f2827b2c8f (patch) | |
tree | c3a6e76b11032b5d31773af099aa86ac27a1fc72 /llvm/lib/Transforms/Utils/LoopSimplify.cpp | |
parent | c479e0c99459e4c5596c2a22829d0937224df0bf (diff) | |
download | llvm-70a495c7f0f28790e976cdecc93846f2827b2c8f.zip llvm-70a495c7f0f28790e976cdecc93846f2827b2c8f.tar.gz llvm-70a495c7f0f28790e976cdecc93846f2827b2c8f.tar.bz2 |
[NFC][LoopSimplify] modernize for loops over LoopInfo
This patch modifies two for loops to use the range based syntax.
Since they are equivalent, this patch is tagged NFC.
Differential Revision: https://reviews.llvm.org/D90069
Diffstat (limited to 'llvm/lib/Transforms/Utils/LoopSimplify.cpp')
-rw-r--r-- | llvm/lib/Transforms/Utils/LoopSimplify.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/llvm/lib/Transforms/Utils/LoopSimplify.cpp b/llvm/lib/Transforms/Utils/LoopSimplify.cpp index a2e9198..6c09baf 100644 --- a/llvm/lib/Transforms/Utils/LoopSimplify.cpp +++ b/llvm/lib/Transforms/Utils/LoopSimplify.cpp @@ -834,8 +834,8 @@ bool LoopSimplify::runOnFunction(Function &F) { bool PreserveLCSSA = mustPreserveAnalysisID(LCSSAID); // Simplify each loop nest in the function. - for (LoopInfo::iterator I = LI->begin(), E = LI->end(); I != E; ++I) - Changed |= simplifyLoop(*I, DT, LI, SE, AC, MSSAU.get(), PreserveLCSSA); + for (auto *L : *LI) + Changed |= simplifyLoop(L, DT, LI, SE, AC, MSSAU.get(), PreserveLCSSA); #ifndef NDEBUG if (PreserveLCSSA) { @@ -864,9 +864,9 @@ PreservedAnalyses LoopSimplifyPass::run(Function &F, // Note that we don't preserve LCSSA in the new PM, if you need it run LCSSA // after simplifying the loops. MemorySSA is preserved if it exists. - for (LoopInfo::iterator I = LI->begin(), E = LI->end(); I != E; ++I) + for (auto *L : *LI) Changed |= - simplifyLoop(*I, DT, LI, SE, AC, MSSAU.get(), /*PreserveLCSSA*/ false); + simplifyLoop(L, DT, LI, SE, AC, MSSAU.get(), /*PreserveLCSSA*/ false); if (!Changed) return PreservedAnalyses::all(); |