[APInt] Remove 'else' after 'return' in tcMultiply methods. NFC

llvm-svn: 302406
This commit is contained in:
Craig Topper 2017-05-08 06:34:36 +00:00
parent 9bcaed867a
commit a6c142ab4d
1 changed files with 23 additions and 24 deletions

View File

@ -2311,22 +2311,22 @@ int APInt::tcMultiplyPart(WordType *dst, const WordType *src,
assert(i + 1 == dstParts);
dst[i] = carry;
return 0;
} else {
/* We overflowed if there is carry. */
if (carry)
return 1;
/* We would overflow if any significant unwritten parts would be
non-zero. This is true if any remaining src parts are non-zero
and the multiplier is non-zero. */
if (multiplier)
for (; i < srcParts; i++)
if (src[i])
return 1;
/* We fitted in the narrow destination. */
return 0;
}
/* We overflowed if there is carry. */
if (carry)
return 1;
/* We would overflow if any significant unwritten parts would be
non-zero. This is true if any remaining src parts are non-zero
and the multiplier is non-zero. */
if (multiplier)
for (; i < srcParts; i++)
if (src[i])
return 1;
/* We fitted in the narrow destination. */
return 0;
}
/* DST = LHS * RHS, where DST has the same width as the operands and
@ -2355,20 +2355,19 @@ unsigned APInt::tcFullMultiply(WordType *dst, const WordType *lhs,
const WordType *rhs, unsigned lhsParts,
unsigned rhsParts) {
/* Put the narrower number on the LHS for less loops below. */
if (lhsParts > rhsParts) {
if (lhsParts > rhsParts)
return tcFullMultiply (dst, rhs, lhs, rhsParts, lhsParts);
} else {
assert(dst != lhs && dst != rhs);
tcSet(dst, 0, rhsParts);
assert(dst != lhs && dst != rhs);
for (unsigned i = 0; i < lhsParts; i++)
tcMultiplyPart(&dst[i], rhs, lhs[i], 0, rhsParts, rhsParts + 1, true);
tcSet(dst, 0, rhsParts);
unsigned n = lhsParts + rhsParts;
for (unsigned i = 0; i < lhsParts; i++)
tcMultiplyPart(&dst[i], rhs, lhs[i], 0, rhsParts, rhsParts + 1, true);
return n - (dst[n - 1] == 0);
}
unsigned n = lhsParts + rhsParts;
return n - (dst[n - 1] == 0);
}
/* If RHS is zero LHS and REMAINDER are left unchanged, return one.