summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Support/APInt.cpp
diff options
context:
space:
mode:
authorCraig Topper <craig.topper@gmail.com>2017-05-08 06:34:36 +0000
committerCraig Topper <craig.topper@gmail.com>2017-05-08 06:34:36 +0000
commita6c142ab4d4eb8f69069c96ee6463d9f279b97ac (patch)
tree7c92bdf33d54053a999d3d96f7f2ed3981752bd4 /llvm/lib/Support/APInt.cpp
parent9bcaed867a547bc4a8b3fb66c1ee8b165c626de9 (diff)
downloadbcm5719-llvm-a6c142ab4d4eb8f69069c96ee6463d9f279b97ac.tar.gz
bcm5719-llvm-a6c142ab4d4eb8f69069c96ee6463d9f279b97ac.zip
[APInt] Remove 'else' after 'return' in tcMultiply methods. NFC
llvm-svn: 302406
Diffstat (limited to 'llvm/lib/Support/APInt.cpp')
-rw-r--r--llvm/lib/Support/APInt.cpp47
1 files changed, 23 insertions, 24 deletions
diff --git a/llvm/lib/Support/APInt.cpp b/llvm/lib/Support/APInt.cpp
index a337b5f8727..68a3d8d57e0 100644
--- a/llvm/lib/Support/APInt.cpp
+++ b/llvm/lib/Support/APInt.cpp
@@ -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.
OpenPOWER on IntegriCloud