summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Analysis/ScalarEvolution.cpp
diff options
context:
space:
mode:
authorNick Lewycky <nicholas@mxc.ca>2008-07-15 03:40:27 +0000
committerNick Lewycky <nicholas@mxc.ca>2008-07-15 03:40:27 +0000
commit3752e513110fac207bd820ad1fd3f596b4d1aae2 (patch)
treec10dcd36e69b9886baccce608660ce0246bee879 /llvm/lib/Analysis/ScalarEvolution.cpp
parent7d5d402b1608abf8e24d08015631bc3981dae545 (diff)
downloadbcm5719-llvm-3752e513110fac207bd820ad1fd3f596b4d1aae2.tar.gz
bcm5719-llvm-3752e513110fac207bd820ad1fd3f596b4d1aae2.zip
Fix up comments.
llvm-svn: 53586
Diffstat (limited to 'llvm/lib/Analysis/ScalarEvolution.cpp')
-rw-r--r--llvm/lib/Analysis/ScalarEvolution.cpp12
1 files changed, 7 insertions, 5 deletions
diff --git a/llvm/lib/Analysis/ScalarEvolution.cpp b/llvm/lib/Analysis/ScalarEvolution.cpp
index d3ff2a5afbb..2f0493aa882 100644
--- a/llvm/lib/Analysis/ScalarEvolution.cpp
+++ b/llvm/lib/Analysis/ScalarEvolution.cpp
@@ -2675,7 +2675,7 @@ bool ScalarEvolutionsImpl::executesAtLeastOnce(const Loop *L, bool isSigned,
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 @@ HowManyLessThans(SCEV *LHS, SCEV *RHS, const Loop *L, bool isSigned) {
// 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);
OpenPOWER on IntegriCloud