[llvm] r244668 - fix 80-cols; NFC

Sanjay Patel via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 11 14:11:56 PDT 2015


Author: spatel
Date: Tue Aug 11 16:11:56 2015
New Revision: 244668

URL: http://llvm.org/viewvc/llvm-project?rev=244668&view=rev
Log:
fix 80-cols; NFC

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

Modified: llvm/trunk/lib/Transforms/Scalar/LoopUnswitch.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/LoopUnswitch.cpp?rev=244668&r1=244667&r2=244668&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Scalar/LoopUnswitch.cpp (original)
+++ llvm/trunk/lib/Transforms/Scalar/LoopUnswitch.cpp Tue Aug 11 16:11:56 2015
@@ -210,7 +210,8 @@ namespace {
 
     /// Split all of the edges from inside the loop to their exit blocks.
     /// Update the appropriate Phi nodes as we do so.
-    void SplitExitEdges(Loop *L, const SmallVectorImpl<BasicBlock *> &ExitBlocks);
+    void SplitExitEdges(Loop *L,
+                        const SmallVectorImpl<BasicBlock *> &ExitBlocks);
 
     bool TryTrivialLoopUnswitch(bool &Changed);
 
@@ -743,12 +744,12 @@ void LoopUnswitch::UnswitchTrivialCondit
   ++NumTrivial;
 }
 
-/// TryTrivialLoopUnswitch - Check if the first non-constant condition starting from the
-/// loop header is a trivial unswitch condition: that is, a condition controls whether
-/// or not the loop does anything at all. If it is a trivial condition, unswitching
-/// produces no code duplications (equivalently, it produces a simpler loop and a new
-/// empty loop, which gets deleted). Therefore always unswitch trivial condition.
-///
+/// Check if the first non-constant condition starting from the loop header is
+/// a trivial unswitch condition: that is, a condition controls whether or not
+/// the loop does anything at all. If it is a trivial condition, unswitching
+/// produces no code duplications (equivalently, it produces a simpler loop and
+/// a new empty loop, which gets deleted). Therefore always unswitch trivial
+/// condition.
 bool LoopUnswitch::TryTrivialLoopUnswitch(bool &Changed) {
   BasicBlock *CurrentBB = currentLoop->getHeader();
   TerminatorInst *CurrentTerm = CurrentBB->getTerminator();
@@ -763,11 +764,11 @@ bool LoopUnswitch::TryTrivialLoopUnswitc
   // terminator). The reason for not doing this in LoopUnswitch pass is that
   // it could potentially break LoopPassManager's invariants. Folding dead
   // branches could either eliminate the current loop or make other loops
-  // unreachable. LCSSA form might also not be preserved after deleting branches.
-  // The following code keeps traversing loop header's successors until it finds
-  // the trivial condition candidate (condition that is not a constant).
-  // Since unswitching generates branches with constant conditions, this
-  // scenario could be very common in practice.
+  // unreachable. LCSSA form might also not be preserved after deleting
+  // branches. The following code keeps traversing loop header's successors
+  // until it finds the trivial condition candidate (condition that is not a
+  // constant). Since unswitching generates branches with constant conditions,
+  // this scenario could be very common in practice.
   SmallSet<BasicBlock*, 8> Visited;
 
   while (true) {
@@ -794,7 +795,7 @@ bool LoopUnswitch::TryTrivialLoopUnswitc
       } else if (BI->getCondition() == ConstantInt::getFalse(Context)) {
         CurrentBB = BI->getSuccessor(1);
       } else {
-        // Found a trivial condition candidate (non-foldable conditional branch).
+        // Found a trivial condition candidate: non-foldable conditional branch.
         break;
       }
     } else {
@@ -834,12 +835,13 @@ bool LoopUnswitch::TryTrivialLoopUnswitc
       CondVal = ConstantInt::getFalse(Context);
     }
 
-    // If we didn't find a single unique LoopExit block, or if the loop exit block
-    // contains phi nodes, this isn't trivial.
+    // If we didn't find a single unique LoopExit block, or if the loop exit
+    // block contains phi nodes, this isn't trivial.
     if (!LoopExitBB || isa<PHINode>(LoopExitBB->begin()))
       return false;   // Can't handle this.
 
-    UnswitchTrivialCondition(currentLoop, LoopCond, CondVal, LoopExitBB, CurrentTerm);
+    UnswitchTrivialCondition(currentLoop, LoopCond, CondVal, LoopExitBB,
+                             CurrentTerm);
     ++NumBranches;
     return true;
   } else if (SwitchInst *SI = dyn_cast<SwitchInst>(CurrentTerm)) {
@@ -876,12 +878,13 @@ bool LoopUnswitch::TryTrivialLoopUnswitc
       }
     }
 
-    // If we didn't find a single unique LoopExit block, or if the loop exit block
-    // contains phi nodes, this isn't trivial.
+    // If we didn't find a single unique LoopExit block, or if the loop exit
+    // block contains phi nodes, this isn't trivial.
     if (!LoopExitBB || isa<PHINode>(LoopExitBB->begin()))
       return false;   // Can't handle this.
 
-    UnswitchTrivialCondition(currentLoop, LoopCond, CondVal, LoopExitBB, nullptr);
+    UnswitchTrivialCondition(currentLoop, LoopCond, CondVal, LoopExitBB,
+                             nullptr);
     ++NumSwitches;
     return true;
   }




More information about the llvm-commits mailing list