summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Analysis/ScalarEvolution.cpp
diff options
context:
space:
mode:
authorSerguei Katkov <serguei.katkov@azul.com>2018-04-03 07:29:00 +0000
committerSerguei Katkov <serguei.katkov@azul.com>2018-04-03 07:29:00 +0000
commit2ace8dc1c334b8be5a02a27d2970ce0dae163a19 (patch)
tree2624318f40590f40289a55f6a80738b5455d3997 /llvm/lib/Analysis/ScalarEvolution.cpp
parentb0c403d7aef0cf232563b83d5773c589d859e057 (diff)
downloadbcm5719-llvm-2ace8dc1c334b8be5a02a27d2970ce0dae163a19.tar.gz
bcm5719-llvm-2ace8dc1c334b8be5a02a27d2970ce0dae163a19.zip
[SCEV] Fix PR36974.
The patch changes the usage of dominate to properlyDominate to satisfy the condition !(a < a) while using std::max. It is actually NFC due to set data structure is used to keep the Loops and no two identical loops can be in collection. So in reality there is no difference between usage of dominate and properlyDominate in this particular case. However it might be changed so it is better to fix it. llvm-svn: 329051
Diffstat (limited to 'llvm/lib/Analysis/ScalarEvolution.cpp')
-rw-r--r--llvm/lib/Analysis/ScalarEvolution.cpp11
1 files changed, 6 insertions, 5 deletions
diff --git a/llvm/lib/Analysis/ScalarEvolution.cpp b/llvm/lib/Analysis/ScalarEvolution.cpp
index d8a41944acb..fad31cb31e0 100644
--- a/llvm/lib/Analysis/ScalarEvolution.cpp
+++ b/llvm/lib/Analysis/ScalarEvolution.cpp
@@ -8668,11 +8668,12 @@ bool ScalarEvolution::isKnownViaInduction(ICmpInst::Predicate Pred,
DT.dominates(L2->getHeader(), L1->getHeader())) &&
"Domination relationship is not a linear order");
#endif
-
- const Loop *MDL = *std::max_element(LoopsUsed.begin(), LoopsUsed.end(),
- [&](const Loop *L1, const Loop *L2) {
- return DT.dominates(L1->getHeader(), L2->getHeader());
- });
+
+ const Loop *MDL =
+ *std::max_element(LoopsUsed.begin(), LoopsUsed.end(),
+ [&](const Loop *L1, const Loop *L2) {
+ return DT.properlyDominates(L1->getHeader(), L2->getHeader());
+ });
// Get init and post increment value for LHS.
auto SplitLHS = SplitIntoInitAndPostInc(MDL, LHS);
OpenPOWER on IntegriCloud