Fix the the ceiling-division used in computing the MaxBECount so that it doesn't
authorDan Gohman <gohman@apple.com>
Tue, 26 Jan 2010 04:40:18 +0000 (04:40 +0000)
committerDan Gohman <gohman@apple.com>
Tue, 26 Jan 2010 04:40:18 +0000 (04:40 +0000)
commit52fddd3e36a9a78767decb0a0f7aa4071dcdbbdf
treefb16edbf7b6c4b248a3b4178cdccabdfe91b3e51
parent1e459c446786f46ed865183f1c6adb17e2e8fcea
Fix the the ceiling-division used in computing the MaxBECount so that it doesn't
have trouble with an intermediate add overflowing. Also, be more conservative
about the case where the induction variable in an SLT loop exit can step past
the RHS of the SLT and overflow in a single step.

Make getSignedRange more aggressive, to recover for some common cases which
the above fixes pessimized.

This addresses rdar://7561161.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94512 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Analysis/ScalarEvolution.cpp
test/Analysis/ScalarEvolution/nsw-offset.ll
test/Analysis/ScalarEvolution/trip-count9.ll [new file with mode: 0644]