From 6a1d02024efff810bf35b6e73cfcab2821522281 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'. llvm-svn: 303120 --- llvm/lib/Support/APInt.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/llvm/lib/Support/APInt.cpp b/llvm/lib/Support/APInt.cpp index ed6756f..1714452 100644 --- a/llvm/lib/Support/APInt.cpp +++ b/llvm/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; -- 2.7.4