From 281eb93196b8d9a6c90a8f92e8088c400978d398 Mon Sep 17 00:00:00 2001 From: Max Kazantsev Date: Sun, 17 Feb 2019 15:22:48 +0000 Subject: [PATCH] [NFC] Fix name and clarifying comment for factored-out function git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@354220 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Transforms/Scalar/LoopSimplifyCFG.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/lib/Transforms/Scalar/LoopSimplifyCFG.cpp b/lib/Transforms/Scalar/LoopSimplifyCFG.cpp index 124c55e8ea1..4f1213d92a3 100644 --- a/lib/Transforms/Scalar/LoopSimplifyCFG.cpp +++ b/lib/Transforms/Scalar/LoopSimplifyCFG.cpp @@ -90,9 +90,10 @@ static void removeBlockFromLoops(BasicBlock *BB, Loop *FirstLoop, Current->removeBlockFromLoop(BB); } -/// Find innermost loop that is reachable from \p BBs and contains loop \p L. -static Loop *getInnermostSuccessorLoop(SmallPtrSetImpl &BBs, - Loop &L, LoopInfo &LI) { +/// Find innermost loop that contains at least one block from \p BBs and +/// contains the header of loop \p L. +static Loop *getInnermostLoopFor(SmallPtrSetImpl &BBs, + Loop &L, LoopInfo &LI) { Loop *StillReachable = nullptr; for (BasicBlock *BB : BBs) { Loop *BBL = LI.getLoopFor(BB); @@ -383,7 +384,7 @@ private: // the current loop. We need to fix loop info accordingly. For this, we // find the most nested loop that still contains L and remove L from all // loops that are inside of it. - Loop *StillReachable = getInnermostSuccessorLoop(LiveExitBlocks, L, LI); + Loop *StillReachable = getInnermostLoopFor(LiveExitBlocks, L, LI); // Okay, our loop is no longer in the outer loop (and maybe not in some of // its parents as well). Make the fixup. -- 2.40.0