[llvm] r354220 - [NFC] Fix name and clarifying comment for factored-out function

Max Kazantsev via llvm-commits llvm-commits at lists.llvm.org
Sun Feb 17 07:22:48 PST 2019


Author: mkazantsev
Date: Sun Feb 17 07:22:48 2019
New Revision: 354220

URL: http://llvm.org/viewvc/llvm-project?rev=354220&view=rev
Log:
[NFC] Fix name and clarifying comment for factored-out function

Modified:
    llvm/trunk/lib/Transforms/Scalar/LoopSimplifyCFG.cpp

Modified: llvm/trunk/lib/Transforms/Scalar/LoopSimplifyCFG.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/LoopSimplifyCFG.cpp?rev=354220&r1=354219&r2=354220&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Scalar/LoopSimplifyCFG.cpp (original)
+++ llvm/trunk/lib/Transforms/Scalar/LoopSimplifyCFG.cpp Sun Feb 17 07:22:48 2019
@@ -90,9 +90,10 @@ static void removeBlockFromLoops(BasicBl
     Current->removeBlockFromLoop(BB);
 }
 
-/// Find innermost loop that is reachable from \p BBs and contains loop \p L.
-static Loop *getInnermostSuccessorLoop(SmallPtrSetImpl<BasicBlock *> &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<BasicBlock *> &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.




More information about the llvm-commits mailing list