Re-apply [SCEV] Fix isLoopEntryGuardedByCond usage
authorSerguei Katkov <serguei.katkov@azul.com>
Mon, 5 Feb 2018 05:49:47 +0000 (05:49 +0000)
committerSerguei Katkov <serguei.katkov@azul.com>
Mon, 5 Feb 2018 05:49:47 +0000 (05:49 +0000)
commitec7029c286c6a8e49db52c752d87c9ff0a465996
tree5d110a63275ed8cbba83a56249ee9facec9f2f1d
parent0923542c61cdbaa255c4336575c4b21d0c6779e8
Re-apply [SCEV] Fix isLoopEntryGuardedByCond usage

ScalarEvolution::isKnownPredicate invokes isLoopEntryGuardedByCond without check
that SCEV is available at entry point of the loop. It is incorrect and fixed by patch.

To bugs additionally fixed:
assert is moved after the check whether loop is not a nullptr.
Usage of isLoopEntryGuardedByCond in ScalarEvolution::isImpliedCondOperandsViaNoOverflow
is guarded by isAvailableAtLoopEntry.

Reviewers: sanjoy, mkazantsev, anna, dorit, reames
Reviewed By: mkazantsev
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D42417

llvm-svn: 324204
llvm/lib/Analysis/ScalarEvolution.cpp
llvm/lib/Transforms/Scalar/InductiveRangeCheckElimination.cpp
llvm/test/Transforms/IndVarSimplify/inner-loop.ll [new file with mode: 0644]