[llvm-commits] [llvm] r70510 - in /llvm/trunk: include/llvm/Analysis/ScalarEvolution.h lib/Analysis/ScalarEvolution.cpp
Dan Gohman
gohman at apple.com
Thu Apr 30 13:48:53 PDT 2009
Author: djg
Date: Thu Apr 30 15:48:53 2009
New Revision: 70510
URL: http://llvm.org/viewvc/llvm-project?rev=70510&view=rev
Log:
Add some comments, and tidy up some whitespace.
Modified:
llvm/trunk/include/llvm/Analysis/ScalarEvolution.h
llvm/trunk/lib/Analysis/ScalarEvolution.cpp
Modified: llvm/trunk/include/llvm/Analysis/ScalarEvolution.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Analysis/ScalarEvolution.h?rev=70510&r1=70509&r2=70510&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Analysis/ScalarEvolution.h (original)
+++ llvm/trunk/include/llvm/Analysis/ScalarEvolution.h Thu Apr 30 15:48:53 2009
@@ -449,7 +449,8 @@
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);
Modified: llvm/trunk/lib/Analysis/ScalarEvolution.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/ScalarEvolution.cpp?rev=70510&r1=70509&r2=70510&view=diff
==============================================================================
--- llvm/trunk/lib/Analysis/ScalarEvolution.cpp (original)
+++ llvm/trunk/lib/Analysis/ScalarEvolution.cpp Thu Apr 30 15:48:53 2009
@@ -2986,8 +2986,9 @@
///
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 @@
}
/// 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();
More information about the llvm-commits
mailing list