llvm.org GIT mirror
[SCEV] Reduce possible APInt allocations a bit. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@302769 91177308-0d34-0410-b5e6-96231b3b80d8 Craig Topper 3 years ago
1 changed file(s) with 12 addition(s) and 8 deletion(s).
 7376 7376 const APInt &N = NC->getAPInt(); 7377 7377 APInt Two(BitWidth, 2); 7378 7378 7379 const APInt& C = L; 7380 7379 // Convert from chrec coefficients to polynomial coefficients AX^2+BX+C 7380 7381 // The A coefficient is N/2 7382 APInt A(N.sdiv(Two)); 7383 7381 7384 // The B coefficient is M-N/2 7382 7385 APInt B(M); 7383 B -= N.sdiv(Two); 7384 7385 // The A coefficient is N/2 7386 APInt A(N.sdiv(Two));⏎ 7386 B -= A; // A is the same as N/2.⏎ 7387 7388 // The C coefficient is L. 7389 const APInt& C = L; 7387 7390 7388 7391 // Compute the B^2-4ac term. 7389 7392 APInt SqrtTerm(B); 7401 7404 7402 7405 // Compute the two solutions for the quadratic formula. 7403 7406 // The divisions must be performed as signed divisions. 7404 APInt NegB(-B); 7405 APInt TwoA(A << 1); 7406 if (TwoA.isMinValue())⏎ 7407 APInt NegB(-std::move(B));⏎ 7408 APInt TwoA(std::move(A)); 7409 TwoA <<= 1; 7410 if (TwoA.isNullValue()) 7407 7411 return None; 7408 7412 7409 7413 LLVMContext &Context = SE.getContext();