[llvm] r303120 - [APInt] Simplify a for loop initialization based on the fact that 'n' is known to be 1 by an earlier 'if'.
Craig Topper via llvm-commits
llvm-commits at lists.llvm.org
Mon May 15 15:01:04 PDT 2017
Author: ctopper
Date: Mon May 15 17:01:03 2017
New Revision: 303120
URL: http://llvm.org/viewvc/llvm-project?rev=303120&view=rev
Log:
[APInt] Simplify a for loop initialization based on the fact that 'n' is known to be 1 by an earlier 'if'.
Modified:
llvm/trunk/lib/Support/APInt.cpp
Modified: llvm/trunk/lib/Support/APInt.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Support/APInt.cpp?rev=303120&r1=303119&r2=303120&view=diff
==============================================================================
--- llvm/trunk/lib/Support/APInt.cpp (original)
+++ llvm/trunk/lib/Support/APInt.cpp Mon May 15 17:01:03 2017
@@ -1476,7 +1476,7 @@ void APInt::divide(const APInt &LHS, uns
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;
More information about the llvm-commits
mailing list