llvm.org GIT mirror
[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).
 7402 7402 // Convert from chrec coefficients to polynomial coefficients AX^2+BX+C 7403 7403 7404 7404 // The A coefficient is N/2 7405 APInt A(N.sdiv(Two));⏎ 7405 APInt A = N.sdiv(Two);⏎ 7406 7406 7407 7407 // The B coefficient is M-N/2 7408 APInt B(M);⏎ 7408 APInt B = M;⏎ 7409 7409 B -= A; // A is the same as N/2. 7410 7410 7411 7411 // The C coefficient is L. 7412 7412 const APInt& C = L; 7413 7413 7414 7414 // Compute the B^2-4ac term. 7415 APInt SqrtTerm(B);⏎ 7415 APInt SqrtTerm = B;⏎ 7416 7416 SqrtTerm *= B; 7417 7417 SqrtTerm -= 4 * (A * C); 7418 7418 7423 7423 7424 7424 // Compute sqrt(B^2-4ac). This is guaranteed to be the nearest 7425 7425 // integer value or else APInt::sqrt() will assert. 7426 APInt SqrtVal(SqrtTerm.sqrt());⏎ 7426 APInt SqrtVal = SqrtTerm.sqrt();⏎ 7427 7427 7428 7428 // Compute the two solutions for the quadratic formula. 7429 7429 // 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); 7432 7432 TwoA <<= 1; 7433 7433 if (TwoA.isNullValue()) 7434 7434 return None;