Add some comments, and tidy up some whitespace.
authorDan Gohman <gohman@apple.com>
Thu, 30 Apr 2009 20:48:53 +0000 (20:48 +0000)
committerDan Gohman <gohman@apple.com>
Thu, 30 Apr 2009 20:48:53 +0000 (20:48 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@70510 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/Analysis/ScalarEvolution.h
lib/Analysis/ScalarEvolution.cpp

index 7404f9c00d96b61f339e40c35196ddf89a7d0b2f..6ef0b35e35da5741aa22325c31059b89a9bc23c0 100644 (file)
@@ -449,7 +449,8 @@ namespace llvm {
     SCEVHandle getSCEVAtScope(Value *V, const Loop *L);
 
     /// isLoopGuardedByCond - Test whether entry to the loop is protected by
-    /// a conditional between LHS and RHS.
+    /// a conditional between LHS and RHS.  This is used to help avoid max
+    /// expressions in loop trip counts.
     bool isLoopGuardedByCond(const Loop *L, ICmpInst::Predicate Pred,
                              SCEV *LHS, SCEV *RHS);
 
index 252eabe2f26720fc6727b08b46735f9ae809adde..fbfb0308e34131e2aaec9698280d03b5851e6fb4 100644 (file)
@@ -2986,8 +2986,9 @@ SCEVHandle ScalarEvolution::HowFarToNonZero(SCEV *V, const Loop *L) {
 ///
 BasicBlock *
 ScalarEvolution::getPredecessorWithUniqueSuccessorForBB(BasicBlock *BB) {
-  // If the block has a unique predecessor, the predecessor must have
-  // no other successors from which BB is reachable.
+  // If the block has a unique predecessor, then there is no path from the
+  // predecessor to the block that does not go through the direct edge
+  // from the predecessor to the block.
   if (BasicBlock *Pred = BB->getSinglePredecessor())
     return Pred;
 
@@ -3002,10 +3003,11 @@ ScalarEvolution::getPredecessorWithUniqueSuccessorForBB(BasicBlock *BB) {
 }
 
 /// isLoopGuardedByCond - Test whether entry to the loop is protected by
-/// a conditional between LHS and RHS.
+/// a conditional between LHS and RHS.  This is used to help avoid max
+/// expressions in loop trip counts.
 bool ScalarEvolution::isLoopGuardedByCond(const Loop *L,
-                                               ICmpInst::Predicate Pred,
-                                               SCEV *LHS, SCEV *RHS) {
+                                          ICmpInst::Predicate Pred,
+                                          SCEV *LHS, SCEV *RHS) {
   BasicBlock *Preheader = L->getLoopPreheader();
   BasicBlock *PreheaderDest = L->getHeader();