aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Transforms/Utils/SplitModule.cpp
diff options
context:
space:
mode:
authorSanjoy Das <sanjoy@playingwithpointers.com>2017-10-25 21:41:00 +0000
committerSanjoy Das <sanjoy@playingwithpointers.com>2017-10-25 21:41:00 +0000
commit8499ebf2e980ec96aa244838df5bc7602477d560 (patch)
treee735d88d79d0837226d16af87d44ff55b61a1639 /llvm/lib/Transforms/Utils/SplitModule.cpp
parentf15a8616011bfb1e34ade994350065127a7aea85 (diff)
downloadllvm-8499ebf2e980ec96aa244838df5bc7602477d560.zip
llvm-8499ebf2e980ec96aa244838df5bc7602477d560.tar.gz
llvm-8499ebf2e980ec96aa244838df5bc7602477d560.tar.bz2
[SCEV] Fix an assertion failure in the max backedge taken count
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
Diffstat (limited to 'llvm/lib/Transforms/Utils/SplitModule.cpp')
0 files changed, 0 insertions, 0 deletions