]> granicus.if.org Git - llvm/commitdiff
[APInt] Remove 'else' after 'return' in udiv and urem. NFC
authorCraig Topper <craig.topper@gmail.com>
Mon, 8 May 2017 23:49:49 +0000 (23:49 +0000)
committerCraig Topper <craig.topper@gmail.com>
Mon, 8 May 2017 23:49:49 +0000 (23:49 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@302486 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Support/APInt.cpp

index caa0691f9205039bb2fd65bb7416d4b2fe9075d0..774fe86f106b979a30f39dc8f11c877d5255efdb 100644 (file)
@@ -1588,16 +1588,15 @@ APInt APInt::udiv(const APInt& RHS) const {
   if (!lhsWords)
     // 0 / X ===> 0
     return APInt(BitWidth, 0);
-  else if (lhsWords < rhsWords || this->ult(RHS)) {
+  if (lhsWords < rhsWords || this->ult(RHS))
     // X / Y ===> 0, iff X < Y
     return APInt(BitWidth, 0);
-  } else if (*this == RHS) {
+  if (*this == RHS)
     // X / X ===> 1
     return APInt(BitWidth, 1);
-  } else if (lhsWords == 1 && rhsWords == 1) {
+  if (lhsWords == 1 && rhsWords == 1)
     // All high words are zero, just use native divide
     return APInt(BitWidth, this->U.pVal[0] / RHS.U.pVal[0]);
-  }
 
   // We have to compute it the hard way. Invoke the Knuth divide algorithm.
   APInt Quotient(1,0); // to hold result.
@@ -1633,19 +1632,18 @@ APInt APInt::urem(const APInt& RHS) const {
   assert(rhsWords && "Performing remainder operation by zero ???");
 
   // Check the degenerate cases
-  if (lhsWords == 0) {
+  if (lhsWords == 0)
     // 0 % Y ===> 0
     return APInt(BitWidth, 0);
-  } else if (lhsWords < rhsWords || this->ult(RHS)) {
+  if (lhsWords < rhsWords || this->ult(RHS))
     // X % Y ===> X, iff X < Y
     return *this;
-  } else if (*this == RHS) {
+  if (*this == RHS)
     // X % X == 0;
     return APInt(BitWidth, 0);
-  } else if (lhsWords == 1) {
+  if (lhsWords == 1)
     // All high words are zero, just use native remainder
     return APInt(BitWidth, U.pVal[0] % RHS.U.pVal[0]);
-  }
 
   // We have to compute it the hard way. Invoke the Knuth divide algorithm.
   APInt Remainder(1,0);