]> granicus.if.org Git - llvm/commitdiff
[APInt] Simplify a for loop initialization based on the fact that 'n' is known to...
authorCraig Topper <craig.topper@gmail.com>
Mon, 15 May 2017 22:01:03 +0000 (22:01 +0000)
committerCraig Topper <craig.topper@gmail.com>
Mon, 15 May 2017 22:01:03 +0000 (22:01 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@303120 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Support/APInt.cpp

index ed6756f6ef3ea8380dceeea92c6552dc433a7132..17144522db82efdb107fd81124c2427fec7fd5ac 100644 (file)
@@ -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;