diff options
author | Nick Lewycky <nicholas@mxc.ca> | 2012-06-28 23:44:57 +0000 |
---|---|---|
committer | Nick Lewycky <nicholas@mxc.ca> | 2012-06-28 23:44:57 +0000 |
commit | 474112d82c7b92ea8d5ecdeaf89c9e4db34e1a4a (patch) | |
tree | 28636f5b1699dd9260ab65437f88e8b9e69a9a90 /llvm/lib/Analysis/ScalarEvolution.cpp | |
parent | 2e6dea3928c56a20a95f84e9829d3e91a078ee3e (diff) | |
download | bcm5719-llvm-474112d82c7b92ea8d5ecdeaf89c9e4db34e1a4a.tar.gz bcm5719-llvm-474112d82c7b92ea8d5ecdeaf89c9e4db34e1a4a.zip |
If the step value is a constant zero, the loop isn't going to terminate. Fixes
the assert reported in PR13228!
llvm-svn: 159393
Diffstat (limited to 'llvm/lib/Analysis/ScalarEvolution.cpp')
-rw-r--r-- | llvm/lib/Analysis/ScalarEvolution.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/Analysis/ScalarEvolution.cpp b/llvm/lib/Analysis/ScalarEvolution.cpp index 886812be5fa..09410496d31 100644 --- a/llvm/lib/Analysis/ScalarEvolution.cpp +++ b/llvm/lib/Analysis/ScalarEvolution.cpp @@ -5484,7 +5484,7 @@ ScalarEvolution::HowFarToZero(const SCEV *V, const Loop *L) { // to 0, it must be counting down to equal 0. Consequently, N = Start / -Step. // We have not yet seen any such cases. const SCEVConstant *StepC = dyn_cast<SCEVConstant>(Step); - if (StepC == 0) + if (StepC == 0 || StepC->getValue()->equalsInt(0)) return getCouldNotCompute(); // For positive steps (counting up until unsigned overflow): |