summaryrefslogtreecommitdiff
path: root/lib/Analysis/ScalarEvolution.cpp
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2016-01-27 21:08:51 +0000
committerDimitry Andric <dim@FreeBSD.org>2016-01-27 21:08:51 +0000
commitaff3ef6f6ccad9bd4e082546f8161727c2019117 (patch)
tree830a00991f5796e53057448d5fa417ccc9c29b11 /lib/Analysis/ScalarEvolution.cpp
parentdadbdfff07596fc3b48cc1e735181b9b8c893f67 (diff)
Notes
Diffstat (limited to 'lib/Analysis/ScalarEvolution.cpp')
-rw-r--r--lib/Analysis/ScalarEvolution.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/Analysis/ScalarEvolution.cpp b/lib/Analysis/ScalarEvolution.cpp
index 34074efd1ceb..ef1bb3a36c8d 100644
--- a/lib/Analysis/ScalarEvolution.cpp
+++ b/lib/Analysis/ScalarEvolution.cpp
@@ -5368,6 +5368,14 @@ ScalarEvolution::computeExitLimitFromCond(const Loop *L,
BECount = EL0.Exact;
}
+ // There are cases (e.g. PR26207) where computeExitLimitFromCond is able
+ // to be more aggressive when computing BECount than when computing
+ // MaxBECount. In these cases it is possible for EL0.Exact and EL1.Exact
+ // to match, but for EL0.Max and EL1.Max to not.
+ if (isa<SCEVCouldNotCompute>(MaxBECount) &&
+ !isa<SCEVCouldNotCompute>(BECount))
+ MaxBECount = BECount;
+
return ExitLimit(BECount, MaxBECount);
}
if (BO->getOpcode() == Instruction::Or) {