[APInt] Remove the mul/urem/srem/udiv/sdiv functions from the APIntOps namespace. Replace the few usages with calls to the class methods. NFC

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299292 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Craig Topper 2017-04-01 05:08:57 +00:00
parent 0c554b7eb1
commit fa958b2284
3 changed files with 2 additions and 27 deletions

View File

@ -1984,31 +1984,6 @@ inline APInt RoundFloatToAPInt(float Float, unsigned width) {
return RoundDoubleToAPInt(double(Float), width);
}
/// \brief Signed division function for APInt.
///
/// Signed divide APInt LHS by APInt RHS.
inline APInt sdiv(const APInt &LHS, const APInt &RHS) { return LHS.sdiv(RHS); }
/// \brief Unsigned division function for APInt.
///
/// Unsigned divide APInt LHS by APInt RHS.
inline APInt udiv(const APInt &LHS, const APInt &RHS) { return LHS.udiv(RHS); }
/// \brief Function for signed remainder operation.
///
/// Signed remainder operation on APInt.
inline APInt srem(const APInt &LHS, const APInt &RHS) { return LHS.srem(RHS); }
/// \brief Function for unsigned remainder operation.
///
/// Unsigned remainder operation on APInt.
inline APInt urem(const APInt &LHS, const APInt &RHS) { return LHS.urem(RHS); }
/// \brief Function for multiplication operation.
///
/// Performs multiplication on APInt values.
inline APInt mul(const APInt &LHS, const APInt &RHS) { return LHS * RHS; }
} // End of APIntOps namespace
// See friend declaration above. This additional declaration is required in

View File

@ -7221,7 +7221,7 @@ SolveQuadraticEquation(const SCEVAddRecExpr *AddRec, ScalarEvolution &SE) {
// Convert from chrec coefficients to polynomial coefficients AX^2+BX+C
// The B coefficient is M-N/2
APInt B(M);
B -= sdiv(N,Two);
B -= N.sdiv(Two);
// The A coefficient is N/2
APInt A(N.sdiv(Two));

View File

@ -881,7 +881,7 @@ APInt llvm::APIntOps::GreatestCommonDivisor(const APInt& API1,
APInt A = API1, B = API2;
while (!!B) {
APInt T = B;
B = APIntOps::urem(A, B);
B = A.urem(B);
A = T;
}
return A;