summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Support/APInt.cpp
diff options
context:
space:
mode:
authorCraig Topper <craig.topper@gmail.com>2017-05-09 16:47:33 +0000
committerCraig Topper <craig.topper@gmail.com>2017-05-09 16:47:33 +0000
commit0acb6654d365508a2732d83134dff22daae1abee (patch)
treead05291bf15060ff68e86c0c9c5ff598dc79e62c /llvm/lib/Support/APInt.cpp
parent6604a2ffbb5d0bc24e96106a67507985c25ff5bb (diff)
downloadbcm5719-llvm-0acb6654d365508a2732d83134dff22daae1abee.tar.gz
bcm5719-llvm-0acb6654d365508a2732d83134dff22daae1abee.zip
[APInt] Remove return value from tcFullMultiply.
The description says it returns the number of words needed to represent the results. But the way it was coded it always returns (lhsWords + rhsWords) or (lhsWords + rhsWords - 1). But the result could be even smaller than that and it wouldn't tell you. No one uses the result today so rather than try to fix it, just remove it. llvm-svn: 302551
Diffstat (limited to 'llvm/lib/Support/APInt.cpp')
-rw-r--r--llvm/lib/Support/APInt.cpp16
1 files changed, 5 insertions, 11 deletions
diff --git a/llvm/lib/Support/APInt.cpp b/llvm/lib/Support/APInt.cpp
index c7685c3a730..3bfd6ba5ec7 100644
--- a/llvm/lib/Support/APInt.cpp
+++ b/llvm/lib/Support/APInt.cpp
@@ -2344,13 +2344,11 @@ int APInt::tcMultiply(WordType *dst, const WordType *lhs,
return overflow;
}
-/* DST = LHS * RHS, where DST has width the sum of the widths of the
- operands. No overflow occurs. DST must be disjoint from both
- operands. Returns the number of parts required to hold the
- result. */
-unsigned APInt::tcFullMultiply(WordType *dst, const WordType *lhs,
- const WordType *rhs, unsigned lhsParts,
- unsigned rhsParts) {
+/// DST = LHS * RHS, where DST has width the sum of the widths of the
+/// operands. No overflow occurs. DST must be disjoint from both operands.
+void 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)
return tcFullMultiply (dst, rhs, lhs, rhsParts, lhsParts);
@@ -2361,10 +2359,6 @@ unsigned APInt::tcFullMultiply(WordType *dst, const WordType *lhs,
for (unsigned i = 0; i < lhsParts; i++)
tcMultiplyPart(&dst[i], rhs, lhs[i], 0, rhsParts, rhsParts + 1, true);
-
- 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