[SCEVValidator] Fix loop exit values considered affine.
authorMichael Kruse <llvm@meinersbur.de>
Thu, 3 Mar 2016 22:10:52 +0000 (22:10 +0000)
committerMichael Kruse <llvm@meinersbur.de>
Thu, 3 Mar 2016 22:10:52 +0000 (22:10 +0000)
commitafd2db535118b132b65205360f6c3c3a8bd44291
tree0dfcddf1b7bc1a20423af4a29efe0c9cd5f8bf9e
parent09eb4451d2a94995fe985d21ec802b7bb262479c
[SCEVValidator] Fix loop exit values considered affine.

Index calculations can use the last value that come out of a loop.
Ideally, ScalarEvolution can compute that exit value directly without
depending on the loop induction variable, but not in all cases.

This changes isAffine to not consider such loop exit values as affine to
avoid that SCEVExpander adds uses of the original loop induction
variable.

This fix is analogous to r262404 that applies to general uses of loop
exit values instead of index expressions and loop bouds as in this
patch.

This reduces the number of LNT test-suite fails with
-polly-position=before-vectorizer -polly-unprofitable
from 10 to 8.

llvm-svn: 262665
polly/lib/Support/SCEVValidator.cpp
polly/test/ScopDetect/index_from_unpredictable_loop.ll [new file with mode: 0644]