[llvm-commits] [llvm] r53586 - /llvm/trunk/lib/Analysis/ScalarEvolution.cpp
Nick Lewycky
nicholas at mxc.ca
Mon Jul 14 20:40:27 PDT 2008
Author: nicholas
Date: Mon Jul 14 22:40:27 2008
New Revision: 53586
URL: http://llvm.org/viewvc/llvm-project?rev=53586&view=rev
Log:
Fix up comments.
Modified:
llvm/trunk/lib/Analysis/ScalarEvolution.cpp
Modified: llvm/trunk/lib/Analysis/ScalarEvolution.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/ScalarEvolution.cpp?rev=53586&r1=53585&r2=53586&view=diff
==============================================================================
--- llvm/trunk/lib/Analysis/ScalarEvolution.cpp (original)
+++ llvm/trunk/lib/Analysis/ScalarEvolution.cpp Mon Jul 14 22:40:27 2008
@@ -2675,7 +2675,7 @@
return false;
}
- if (!PreCondLHS->getType()->isInteger()) return false;
+ if (PreCondLHS->getType()->isInteger()) return false;
return LHS == getSCEV(PreCondLHS) && RHS == getSCEV(PreCondRHS);
}
@@ -2706,12 +2706,14 @@
// First, we get the value of the LHS in the first iteration: n
SCEVHandle Start = AddRec->getOperand(0);
- // Then, we get the value of the LHS in the first iteration in which the
- // above condition doesn't hold. This equals to max(m,n).
if (executesAtLeastOnce(L, isSigned,
- SE.getMinusSCEV(AddRec->getOperand(0), One), RHS))
+ SE.getMinusSCEV(AddRec->getOperand(0), One), RHS)) {
+ // Since we know that the condition is true in order to enter the loop,
+ // we know that it will run exactly m-n times.
return SE.getMinusSCEV(RHS, Start);
- else {
+ } else {
+ // Then, we get the value of the LHS in the first iteration in which the
+ // above condition doesn't hold. This equals to max(m,n).
SCEVHandle End = isSigned ? SE.getSMaxExpr(RHS, Start)
: SE.getUMaxExpr(RHS, Start);
More information about the llvm-commits
mailing list