forked from OSchip/llvm-project
[SCEV] Use APInt::operator*=(uint64_t) to avoid a temporary APInt for a constant.
llvm-svn: 302404
This commit is contained in:
parent
f15bec5541
commit
389d8cebd1
|
@ -7376,7 +7376,6 @@ SolveQuadraticEquation(const SCEVAddRecExpr *AddRec, ScalarEvolution &SE) {
|
|||
const APInt &M = MC->getAPInt();
|
||||
const APInt &N = NC->getAPInt();
|
||||
APInt Two(BitWidth, 2);
|
||||
APInt Four(BitWidth, 4);
|
||||
|
||||
{
|
||||
using namespace APIntOps;
|
||||
|
@ -7392,7 +7391,7 @@ SolveQuadraticEquation(const SCEVAddRecExpr *AddRec, ScalarEvolution &SE) {
|
|||
// Compute the B^2-4ac term.
|
||||
APInt SqrtTerm(B);
|
||||
SqrtTerm *= B;
|
||||
SqrtTerm -= Four * (A * C);
|
||||
SqrtTerm -= 4 * (A * C);
|
||||
|
||||
if (SqrtTerm.isNegative()) {
|
||||
// The loop is provably infinite.
|
||||
|
|
Loading…
Reference in New Issue