summaryrefslogtreecommitdiffstats
path: root/llvm/test/Analysis/ScalarEvolution/max-be-count-not-constant.ll
Commit message (Collapse)AuthorAgeFilesLines
* [SCEV] Fix an assertion failure in the max backedge taken countSanjoy Das2017-10-251-0/+26
Max backedge taken count is always expected to be a constant; and this is usually true by construction -- it is a SCEV expression with constant inputs. However, if the max backedge expression ends up being computed to be a udiv with a constant zero denominator[0], SCEV does not fold the result to a constant since there is no constant it can fold it to (SCEV has no representation for "infinity" or "undef"). However, in computeMaxBECountForLT we already know the denominator is positive, and thus at least 1; and we can use this fact to avoid dividing by zero. [0]: We can end up with a constant zero denominator if the signed range of the stride is more precise than the unsigned range. llvm-svn: 316615
OpenPOWER on IntegriCloud