Skip to content

Commit 70a495c

Browse files
tammeladavemgreen
authored andcommitted
[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
1 parent c479e0c commit 70a495c

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

llvm/lib/Transforms/Utils/LoopSimplify.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -834,8 +834,8 @@ bool LoopSimplify::runOnFunction(Function &F) {
834834
bool PreserveLCSSA = mustPreserveAnalysisID(LCSSAID);
835835

836836
// Simplify each loop nest in the function.
837-
for (LoopInfo::iterator I = LI->begin(), E = LI->end(); I != E; ++I)
838-
Changed |= simplifyLoop(*I, DT, LI, SE, AC, MSSAU.get(), PreserveLCSSA);
837+
for (auto *L : *LI)
838+
Changed |= simplifyLoop(L, DT, LI, SE, AC, MSSAU.get(), PreserveLCSSA);
839839

840840
#ifndef NDEBUG
841841
if (PreserveLCSSA) {
@@ -864,9 +864,9 @@ PreservedAnalyses LoopSimplifyPass::run(Function &F,
864864

865865
// Note that we don't preserve LCSSA in the new PM, if you need it run LCSSA
866866
// after simplifying the loops. MemorySSA is preserved if it exists.
867-
for (LoopInfo::iterator I = LI->begin(), E = LI->end(); I != E; ++I)
867+
for (auto *L : *LI)
868868
Changed |=
869-
simplifyLoop(*I, DT, LI, SE, AC, MSSAU.get(), /*PreserveLCSSA*/ false);
869+
simplifyLoop(L, DT, LI, SE, AC, MSSAU.get(), /*PreserveLCSSA*/ false);
870870

871871
if (!Changed)
872872
return PreservedAnalyses::all();

0 commit comments

Comments
 (0)