From b4a39f7ccd0431121f0b608251ce708555d27cd7 Mon Sep 17 00:00:00 2001 From: Craig Topper Date: Mon, 15 May 2017 22:01:03 +0000 Subject: [PATCH] [APInt] Simplify a for loop initialization based on the fact that 'n' is known to be 1 by an earlier 'if'. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@303120 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Support/APInt.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Support/APInt.cpp b/lib/Support/APInt.cpp index ed6756f6ef3..17144522db8 100644 --- a/lib/Support/APInt.cpp +++ b/lib/Support/APInt.cpp @@ -1476,7 +1476,7 @@ void APInt::divide(const APInt &LHS, unsigned lhsWords, const APInt &RHS, if (n == 1) { uint32_t divisor = V[0]; uint32_t remainder = 0; - for (int i = m+n-1; i >= 0; i--) { + for (int i = m; i >= 0; i--) { uint64_t partial_dividend = Make_64(remainder, U[i]); if (partial_dividend == 0) { Q[i] = 0;