diff options
| author | Nick Lewycky <nicholas@mxc.ca> | 2008-12-09 07:25:04 +0000 |
|---|---|---|
| committer | Nick Lewycky <nicholas@mxc.ca> | 2008-12-09 07:25:04 +0000 |
| commit | f545749f2bdf95212635f4e28652e3d38a800388 (patch) | |
| tree | b37e0fe58cd5fbe8c6dae83e3552252b7a0cde8d /llvm/lib/Analysis/ScalarEvolution.cpp | |
| parent | aeaec0838b54ec48866fb95b34f27b382136efbc (diff) | |
| download | bcm5719-llvm-f545749f2bdf95212635f4e28652e3d38a800388.tar.gz bcm5719-llvm-f545749f2bdf95212635f4e28652e3d38a800388.zip | |
It's easy to handle SLE/SGE when the loop has a unit stride.
llvm-svn: 60748
Diffstat (limited to 'llvm/lib/Analysis/ScalarEvolution.cpp')
| -rw-r--r-- | llvm/lib/Analysis/ScalarEvolution.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/llvm/lib/Analysis/ScalarEvolution.cpp b/llvm/lib/Analysis/ScalarEvolution.cpp index 2b714de3b3f..c9af6de79d9 100644 --- a/llvm/lib/Analysis/ScalarEvolution.cpp +++ b/llvm/lib/Analysis/ScalarEvolution.cpp @@ -2924,8 +2924,12 @@ bool ScalarEvolutionsImpl::potentialInfiniteLoop(SCEV *Stride, SCEV *RHS, if (!R) return true; - if (isSigned) + if (isSigned) { + if (SC->getValue()->isOne()) + return R->getValue()->isMaxValue(true); + return true; // XXX: because we don't have an sdiv scev. + } // If negative, it wraps around every iteration, but we don't care about that. APInt S = SC->getValue()->getValue().abs(); |

