[llvm] r299292 - [APInt] Remove the mul/urem/srem/udiv/sdiv functions from the APIntOps namespace. Replace the few usages with calls to the class methods. NFC
Craig Topper via llvm-commits
llvm-commits at lists.llvm.org
Fri Mar 31 22:08:58 PDT 2017
Author: ctopper
Date: Sat Apr 1 00:08:57 2017
New Revision: 299292
URL: http://llvm.org/viewvc/llvm-project?rev=299292&view=rev
Log:
[APInt] Remove the mul/urem/srem/udiv/sdiv functions from the APIntOps namespace. Replace the few usages with calls to the class methods. NFC
Modified:
llvm/trunk/include/llvm/ADT/APInt.h
llvm/trunk/lib/Analysis/ScalarEvolution.cpp
llvm/trunk/lib/Support/APInt.cpp
Modified: llvm/trunk/include/llvm/ADT/APInt.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/ADT/APInt.h?rev=299292&r1=299291&r2=299292&view=diff
==============================================================================
--- llvm/trunk/include/llvm/ADT/APInt.h (original)
+++ llvm/trunk/include/llvm/ADT/APInt.h Sat Apr 1 00:08:57 2017
@@ -1984,31 +1984,6 @@ inline APInt RoundFloatToAPInt(float Flo
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
Modified: llvm/trunk/lib/Analysis/ScalarEvolution.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/ScalarEvolution.cpp?rev=299292&r1=299291&r2=299292&view=diff
==============================================================================
--- llvm/trunk/lib/Analysis/ScalarEvolution.cpp (original)
+++ llvm/trunk/lib/Analysis/ScalarEvolution.cpp Sat Apr 1 00:08:57 2017
@@ -7221,7 +7221,7 @@ SolveQuadraticEquation(const SCEVAddRecE
// 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));
Modified: llvm/trunk/lib/Support/APInt.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Support/APInt.cpp?rev=299292&r1=299291&r2=299292&view=diff
==============================================================================
--- llvm/trunk/lib/Support/APInt.cpp (original)
+++ llvm/trunk/lib/Support/APInt.cpp Sat Apr 1 00:08:57 2017
@@ -881,7 +881,7 @@ APInt llvm::APIntOps::GreatestCommonDivi
APInt A = API1, B = API2;
while (!!B) {
APInt T = B;
- B = APIntOps::urem(A, B);
+ B = A.urem(B);
A = T;
}
return A;
More information about the llvm-commits
mailing list