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)
commit30bd9346a0b5b2f4b2a2032a447239d9aa3c85ef
tree1d6bb52aade22dc4cccf5fc7985ba0234736b57f
parent79a97119184dfafe8c6190754d66bc8bcb118a86
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.

llvm-svn: 166612
llvm/lib/Analysis/ScalarEvolution.cpp
llvm/test/Transforms/LoopUnroll/pr14167.ll [new file with mode: 0644]