diff options
author | Dan Gohman <gohman@apple.com> | 2009-06-22 23:28:56 +0000 |
---|---|---|
committer | Dan Gohman <gohman@apple.com> | 2009-06-22 23:28:56 +0000 |
commit | 2cc450e63559fb346f5aab0e26cf49a366dc19b4 (patch) | |
tree | e6c6f1c22a71280e8ee1360db8b2f9b01085ef66 /lib/Analysis | |
parent | e60fee02ce7c1ee34faeefde46229b4168c2fd7f (diff) | |
download | external_llvm-2cc450e63559fb346f5aab0e26cf49a366dc19b4.zip external_llvm-2cc450e63559fb346f5aab0e26cf49a366dc19b4.tar.gz external_llvm-2cc450e63559fb346f5aab0e26cf49a366dc19b4.tar.bz2 |
Fix a bug in the trip-count computation with And/Or. If either of the
sides is CouldNotCompute, the resulting exact count must be CouldNotCompute.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73920 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis')
-rw-r--r-- | lib/Analysis/ScalarEvolution.cpp | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/lib/Analysis/ScalarEvolution.cpp b/lib/Analysis/ScalarEvolution.cpp index afc1e5c..5cbb5fa 100644 --- a/lib/Analysis/ScalarEvolution.cpp +++ b/lib/Analysis/ScalarEvolution.cpp @@ -2902,10 +2902,8 @@ ScalarEvolution::ComputeBackedgeTakenCountFromExitCond(const Loop *L, if (L->contains(TBB)) { // Both conditions must be true for the loop to continue executing. // Choose the less conservative count. - if (BTI0.Exact == CouldNotCompute) - BECount = BTI1.Exact; - else if (BTI1.Exact == CouldNotCompute) - BECount = BTI0.Exact; + if (BTI0.Exact == CouldNotCompute || BTI1.Exact == CouldNotCompute) + BECount = CouldNotCompute; else BECount = getUMinFromMismatchedTypes(BTI0.Exact, BTI1.Exact); if (BTI0.Max == CouldNotCompute) @@ -2936,10 +2934,8 @@ ScalarEvolution::ComputeBackedgeTakenCountFromExitCond(const Loop *L, if (L->contains(FBB)) { // Both conditions must be false for the loop to continue executing. // Choose the less conservative count. - if (BTI0.Exact == CouldNotCompute) - BECount = BTI1.Exact; - else if (BTI1.Exact == CouldNotCompute) - BECount = BTI0.Exact; + if (BTI0.Exact == CouldNotCompute || BTI1.Exact == CouldNotCompute) + BECount = CouldNotCompute; else BECount = getUMinFromMismatchedTypes(BTI0.Exact, BTI1.Exact); if (BTI0.Max == CouldNotCompute) |