forked from OSchip/llvm-project
[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
This commit is contained in:
parent
c479e0c994
commit
70a495c7f0
|
@ -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();
|
||||
|
|
Loading…
Reference in New Issue