Generalize the cast-of-addrec folding to handle folding of SCEVs like
authorDan Gohman <gohman@apple.com>
Wed, 29 Apr 2009 22:28:28 +0000 (22:28 +0000)
committerDan Gohman <gohman@apple.com>
Wed, 29 Apr 2009 22:28:28 +0000 (22:28 +0000)
commitac70ceafbcb6761f32634f981de4cca1a5faa417
tree2b213d84c5fd702ff8d6c3026b80cc1183b38f42
parentf159ccd1cd6940fb3735e5992127a02b9ce59371
Generalize the cast-of-addrec folding to handle folding of SCEVs like
(sext i8 {-128,+,1} to i64) to i64 {-128,+,1}, where the iteration
crosses from negative to positive, but is still safe if the trip
count is within range.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@70421 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Analysis/ScalarEvolution.cpp
test/Analysis/ScalarEvolution/sext-iv-0.ll [new file with mode: 0644]
test/Analysis/ScalarEvolution/sext-iv-1.ll [new file with mode: 0644]