llvm.org GIT mirror llvm / e2c7961
[APInt] Remove unnecessary checks of rhsWords==1 with lhsWords==1 from udiv and udivrem. NFC At this point in the code rhsWords is guaranteed to be non-zero and less than or equal to lhsWords. So if lhsWords is 1, rhsWords must also be 1. urem alread had the check removed so this makes all 3 consistent. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@302930 91177308-0d34-0410-b5e6-96231b3b80d8 Craig Topper 3 years ago
1 changed file(s) with 2 addition(s) and 2 deletion(s). Raw diff Collapse all Expand all
15781578 if (*this == RHS)
15791579 // X / X ===> 1
15801580 return APInt(BitWidth, 1);
1581 if (lhsWords == 1 && rhsWords == 1)
1581 if (lhsWords == 1) // rhsWords is 1 if lhsWords is 1.
15821582 // All high words are zero, just use native divide
15831583 return APInt(BitWidth, this->U.pVal[0] / RHS.U.pVal[0]);
15841584
16811681 return;
16821682 }
16831683
1684 if (lhsWords == 1 && rhsWords == 1) {
1684 if (lhsWords == 1) { // rhsWords is 1 if lhsWords is 1.
16851685 // There is only one word to consider so use the native versions.
16861686 uint64_t lhsValue = LHS.U.pVal[0];
16871687 uint64_t rhsValue = RHS.U.pVal[0];