diff options
author | Nick Lewycky <nicholas@mxc.ca> | 2007-09-27 14:12:54 +0000 |
---|---|---|
committer | Nick Lewycky <nicholas@mxc.ca> | 2007-09-27 14:12:54 +0000 |
commit | 3934961878e2a4de32892c56d5de7d2123bcbfc1 (patch) | |
tree | 910f525b346b72a4e42262328930460031f38f59 /llvm/lib/Analysis/ScalarEvolution.cpp | |
parent | c9a8c74d28f269ce1143544f9094c5ef9446808b (diff) | |
download | bcm5719-llvm-3934961878e2a4de32892c56d5de7d2123bcbfc1.tar.gz bcm5719-llvm-3934961878e2a4de32892c56d5de7d2123bcbfc1.zip |
Build the correct range for loops with unusual bounds. Fix from Jay Foad.
llvm-svn: 42394
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 aaba49eacd9..069f6ec714c 100644 --- a/llvm/lib/Analysis/ScalarEvolution.cpp +++ b/llvm/lib/Analysis/ScalarEvolution.cpp @@ -2470,7 +2470,7 @@ SCEVHandle SCEVAddRecExpr::getNumIterationsInRange(ConstantRange Range) const { APInt End = A.sge(One) ? (Range.getUpper() - One) : Range.getLower(); // The exit value should be (End+A)/A. - APInt ExitVal = (End + A).sdiv(A); + APInt ExitVal = (End + A).udiv(A); ConstantInt *ExitValue = ConstantInt::get(ExitVal); // Evaluate at the exit value. If we really did fall out of the valid |