diff options
author | Chris Lattner <sabre@nondot.org> | 2007-04-15 19:52:49 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2007-04-15 19:52:49 +0000 |
commit | cad61e81c17f0f9a49ef7154c8101fd65daa6610 (patch) | |
tree | 416d78533c09941da038641e934d61f957515ec7 /llvm/lib/Analysis | |
parent | 0318670cf3d636419586b3ce957a3b1709ec8d2a (diff) | |
download | bcm5719-llvm-cad61e81c17f0f9a49ef7154c8101fd65daa6610.tar.gz bcm5719-llvm-cad61e81c17f0f9a49ef7154c8101fd65daa6610.zip |
Fix a nasty bug introduced when apint'ified. This fixes
Transforms/IndVarsSimplify/exit_value_tests.llx
llvm-svn: 36081
Diffstat (limited to 'llvm/lib/Analysis')
-rw-r--r-- | llvm/lib/Analysis/ScalarEvolution.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/llvm/lib/Analysis/ScalarEvolution.cpp b/llvm/lib/Analysis/ScalarEvolution.cpp index bbb59d52c16..54848e96a21 100644 --- a/llvm/lib/Analysis/ScalarEvolution.cpp +++ b/llvm/lib/Analysis/ScalarEvolution.cpp @@ -2096,9 +2096,9 @@ SolveQuadraticEquation(const SCEVAddRecExpr *AddRec) { } uint32_t BitWidth = LC->getValue()->getValue().getBitWidth(); - const APInt& L = LC->getValue()->getValue(); - const APInt& M = MC->getValue()->getValue(); - const APInt& N = MC->getValue()->getValue(); + const APInt &L = LC->getValue()->getValue(); + const APInt &M = MC->getValue()->getValue(); + const APInt &N = NC->getValue()->getValue(); APInt Two(BitWidth, 2); APInt Four(BitWidth, 4); @@ -2125,7 +2125,7 @@ SolveQuadraticEquation(const SCEVAddRecExpr *AddRec) { // Compute the two solutions for the quadratic formula. // The divisions must be performed as signed divisions. APInt NegB(-B); - APInt TwoA( A * Two ); + APInt TwoA(A << 1); ConstantInt *Solution1 = ConstantInt::get((NegB + SqrtVal).sdiv(TwoA)); ConstantInt *Solution2 = ConstantInt::get((NegB - SqrtVal).sdiv(TwoA)); |