[SCEV] Re-land: Fix isKnownPredicate
authorSerguei Katkov <serguei.katkov@azul.com>
Mon, 19 Mar 2018 06:35:30 +0000 (06:35 +0000)
committerSerguei Katkov <serguei.katkov@azul.com>
Mon, 19 Mar 2018 06:35:30 +0000 (06:35 +0000)
commit529f42331e425aa812a48ab385dd00a67be9ea37
treef5ab4652eab74223f7ff7d3e863a7e5fe68be94b
parente18fbab988e3f64424fddafdfbe9672cba710a69
[SCEV] Re-land: Fix isKnownPredicate

This is re-land of https://reviews.llvm.org/rL327362 with a fix
and regression test.

The crash was due to it is possible that for found MDL loop,
LHS or RHS may contain an invariant unknown SCEV which
does not dominate the MDL. Please see regression
test for an example.

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

llvm-svn: 327822
llvm/include/llvm/Analysis/ScalarEvolution.h
llvm/lib/Analysis/ScalarEvolution.cpp
llvm/test/Analysis/ScalarEvolution/inner-loop-by-latch-cond-unknown.ll [new file with mode: 0644]
llvm/test/Transforms/IndVarSimplify/inner-loop-by-latch-cond.ll [new file with mode: 0644]