llvm.org GIT mirror llvm / 6a2b505
[SCEV] Use copy initialization of APInts instead of direct initialization. This is based on post commit feed back from r302769. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@303092 91177308-0d34-0410-b5e6-96231b3b80d8 Craig Topper 3 years ago
1 changed file(s) with 6 addition(s) and 6 deletion(s). Raw diff Collapse all Expand all
74027402 // Convert from chrec coefficients to polynomial coefficients AX^2+BX+C
74037403
74047404 // The A coefficient is N/2
7405 APInt A(N.sdiv(Two));
7405 APInt A = N.sdiv(Two);
74067406
74077407 // The B coefficient is M-N/2
7408 APInt B(M);
7408 APInt B = M;
74097409 B -= A; // A is the same as N/2.
74107410
74117411 // The C coefficient is L.
74127412 const APInt& C = L;
74137413
74147414 // Compute the B^2-4ac term.
7415 APInt SqrtTerm(B);
7415 APInt SqrtTerm = B;
74167416 SqrtTerm *= B;
74177417 SqrtTerm -= 4 * (A * C);
74187418
74237423
74247424 // Compute sqrt(B^2-4ac). This is guaranteed to be the nearest
74257425 // integer value or else APInt::sqrt() will assert.
7426 APInt SqrtVal(SqrtTerm.sqrt());
7426 APInt SqrtVal = SqrtTerm.sqrt();
74277427
74287428 // Compute the two solutions for the quadratic formula.
74297429 // The divisions must be performed as signed divisions.
7430 APInt NegB(-std::move(B));
7431 APInt TwoA(std::move(A));
7430 APInt NegB = -std::move(B);
7431 APInt TwoA = std::move(A);
74327432 TwoA <<= 1;
74337433 if (TwoA.isNullValue())
74347434 return None;