getSmallConstantTripMultiple should never return zero.
authorHal Finkel <hfinkel@anl.gov>
Wed, 24 Oct 2012 19:46:44 +0000 (19:46 +0000)
committerHal Finkel <hfinkel@anl.gov>
Wed, 24 Oct 2012 19:46:44 +0000 (19:46 +0000)
commit8c65549318950ff3fc1cb3d7a73fb50c688c78a5
treefd174875c34cec9db5e130538cb2e7ee02e40283
parent99abc17832b36007c66369321c0c2f5a2a7713f1
getSmallConstantTripMultiple should never return zero.

When the trip count is -1, getSmallConstantTripMultiple could return zero,
and this would cause runtime loop unrolling to assert. Instead of returning
zero, one is now returned (consistent with the existing overflow cases).
Fixes PR14167.

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