diff options
author | Craig Topper <craig.topper@gmail.com> | 2017-05-08 04:55:13 +0000 |
---|---|---|
committer | Craig Topper <craig.topper@gmail.com> | 2017-05-08 04:55:13 +0000 |
commit | 389d8cebd1432255b9f01cd7f694bd7ef43b1c6c (patch) | |
tree | 4fac2956ed96ed742b6caac5247b979028d886b1 | |
parent | f15bec554147ad9e2fc2b255305d68694550ba3e (diff) | |
download | bcm5719-llvm-389d8cebd1432255b9f01cd7f694bd7ef43b1c6c.tar.gz bcm5719-llvm-389d8cebd1432255b9f01cd7f694bd7ef43b1c6c.zip |
[SCEV] Use APInt::operator*=(uint64_t) to avoid a temporary APInt for a constant.
llvm-svn: 302404
-rw-r--r-- | llvm/lib/Analysis/ScalarEvolution.cpp | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/llvm/lib/Analysis/ScalarEvolution.cpp b/llvm/lib/Analysis/ScalarEvolution.cpp index b1ab6565371..01dca079314 100644 --- a/llvm/lib/Analysis/ScalarEvolution.cpp +++ b/llvm/lib/Analysis/ScalarEvolution.cpp @@ -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. |