From 3522a09753e79c8625d1f9386c3eb9dff53f9c58 Mon Sep 17 00:00:00 2001 From: Craig Topper Date: Mon, 8 May 2017 06:34:36 +0000 Subject: [PATCH] [APInt] Remove 'else' after 'return' in tcMultiply methods. NFC git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@302406 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Support/APInt.cpp | 47 +++++++++++++++++++++---------------------- 1 file changed, 23 insertions(+), 24 deletions(-) diff --git a/lib/Support/APInt.cpp b/lib/Support/APInt.cpp index a337b5f8727..68a3d8d57e0 100644 --- a/lib/Support/APInt.cpp +++ b/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. -- 2.50.1