diff options
| author | Craig Topper <craig.topper@gmail.com> | 2017-05-15 18:14:16 +0000 |
|---|---|---|
| committer | Craig Topper <craig.topper@gmail.com> | 2017-05-15 18:14:16 +0000 |
| commit | 716cad8bb769f8df205539e2709de03df270af18 (patch) | |
| tree | bcbd56d6b9b95c362ff6abc63e83efa26bb2772c /llvm/lib | |
| parent | e9d2ddc9dd42b1fe96aaeacead83cbce5f2a7dac (diff) | |
| download | bcm5719-llvm-716cad8bb769f8df205539e2709de03df270af18.tar.gz bcm5719-llvm-716cad8bb769f8df205539e2709de03df270af18.zip | |
[SCEV] Use copy initialization of APInts instead of direct initialization.
This is based on post commit feed back from r302769.
llvm-svn: 303092
Diffstat (limited to 'llvm/lib')
| -rw-r--r-- | llvm/lib/Analysis/ScalarEvolution.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/llvm/lib/Analysis/ScalarEvolution.cpp b/llvm/lib/Analysis/ScalarEvolution.cpp index 8613d3ca5f7..7676bfc3d1f 100644 --- a/llvm/lib/Analysis/ScalarEvolution.cpp +++ b/llvm/lib/Analysis/ScalarEvolution.cpp @@ -7403,17 +7403,17 @@ SolveQuadraticEquation(const SCEVAddRecExpr *AddRec, ScalarEvolution &SE) { // Convert from chrec coefficients to polynomial coefficients AX^2+BX+C // The A coefficient is N/2 - APInt A(N.sdiv(Two)); + APInt A = N.sdiv(Two); // The B coefficient is M-N/2 - APInt B(M); + APInt B = M; B -= A; // A is the same as N/2. // The C coefficient is L. const APInt& C = L; // Compute the B^2-4ac term. - APInt SqrtTerm(B); + APInt SqrtTerm = B; SqrtTerm *= B; SqrtTerm -= 4 * (A * C); @@ -7424,12 +7424,12 @@ SolveQuadraticEquation(const SCEVAddRecExpr *AddRec, ScalarEvolution &SE) { // Compute sqrt(B^2-4ac). This is guaranteed to be the nearest // integer value or else APInt::sqrt() will assert. - APInt SqrtVal(SqrtTerm.sqrt()); + APInt SqrtVal = SqrtTerm.sqrt(); // Compute the two solutions for the quadratic formula. // The divisions must be performed as signed divisions. - APInt NegB(-std::move(B)); - APInt TwoA(std::move(A)); + APInt NegB = -std::move(B); + APInt TwoA = std::move(A); TwoA <<= 1; if (TwoA.isNullValue()) return None; |

