From fa958b2284e76af9cd585ce1dde7f1947803727d Mon Sep 17 00:00:00 2001 From: Craig Topper Date: Sat, 1 Apr 2017 05:08:57 +0000 Subject: [PATCH] [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 --- include/llvm/ADT/APInt.h | 25 ------------------------- lib/Analysis/ScalarEvolution.cpp | 2 +- lib/Support/APInt.cpp | 2 +- 3 files changed, 2 insertions(+), 27 deletions(-) diff --git a/include/llvm/ADT/APInt.h b/include/llvm/ADT/APInt.h index 8adbfdfeecb..f2d4390a811 100644 --- a/include/llvm/ADT/APInt.h +++ b/include/llvm/ADT/APInt.h @@ -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 diff --git a/lib/Analysis/ScalarEvolution.cpp b/lib/Analysis/ScalarEvolution.cpp index 659a1e5e1e7..986209acfd0 100644 --- a/lib/Analysis/ScalarEvolution.cpp +++ b/lib/Analysis/ScalarEvolution.cpp @@ -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)); diff --git a/lib/Support/APInt.cpp b/lib/Support/APInt.cpp index 8ac881e4c7f..d6139504f9a 100644 --- a/lib/Support/APInt.cpp +++ b/lib/Support/APInt.cpp @@ -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;