18 #ifndef MLIR_ANALYSIS_PRESBURGER_SLOWMPINT_H
19 #define MLIR_ANALYSIS_PRESBURGER_SLOWMPINT_H
22 #include "llvm/ADT/APInt.h"
23 #include "llvm/ADT/Hashing.h"
24 #include "llvm/Support/raw_ostream.h"
27 namespace presburger {
42 explicit SlowMPInt(
const llvm::APInt &val);
44 explicit operator int64_t()
const;
75 void print(llvm::raw_ostream &os)
const;
A simple class providing multi-precision arithmetic.
SlowMPInt operator+(const SlowMPInt &o) const
friend SlowMPInt gcd(const SlowMPInt &a, const SlowMPInt &b)
The operands must be non-negative for gcd.
bool operator<=(const SlowMPInt &o) const
SlowMPInt & operator-=(const SlowMPInt &o)
SlowMPInt & operator/=(const SlowMPInt &o)
friend llvm::hash_code hash_value(const SlowMPInt &x)
Overload to compute a hash_code for a SlowMPInt value.
bool operator==(const SlowMPInt &o) const
friend SlowMPInt abs(const SlowMPInt &x)
Redeclarations of friend declarations above to make it discoverable by lookups.
SlowMPInt operator/(const SlowMPInt &o) const
SlowMPInt & operator+=(const SlowMPInt &o)
friend SlowMPInt ceilDiv(const SlowMPInt &lhs, const SlowMPInt &rhs)
bool operator>(const SlowMPInt &o) const
SlowMPInt operator*(const SlowMPInt &o) const
unsigned getBitWidth() const
SlowMPInt operator-() const
SlowMPInt operator%(const SlowMPInt &o) const
This operation cannot overflow.
bool operator>=(const SlowMPInt &o) const
SlowMPInt & operator=(int64_t val)
friend SlowMPInt floorDiv(const SlowMPInt &lhs, const SlowMPInt &rhs)
void print(llvm::raw_ostream &os) const
bool operator!=(const SlowMPInt &o) const
SlowMPInt & operator%=(const SlowMPInt &o)
bool operator<(const SlowMPInt &o) const
SlowMPInt & operator*=(const SlowMPInt &o)
bool operator==(const SlowMPInt &a, int64_t b)
SlowMPInt operator/(const SlowMPInt &a, int64_t b)
SlowMPInt gcd(const SlowMPInt &a, const SlowMPInt &b)
llvm::hash_code hash_value(const SlowMPInt &x)
SlowMPInt & operator*=(SlowMPInt &a, int64_t b)
SlowMPInt & operator+=(SlowMPInt &a, int64_t b)
SlowMPInt & operator%=(SlowMPInt &a, int64_t b)
bool operator<(const SlowMPInt &a, int64_t b)
SlowMPInt abs(const SlowMPInt &x)
Redeclarations of friend declarations above to make it discoverable by lookups.
SlowMPInt mod(const SlowMPInt &lhs, const SlowMPInt &rhs)
Returns the remainder of dividing LHS by RHS.
SlowMPInt operator+(const SlowMPInt &a, int64_t b)
SlowMPInt operator*(const SlowMPInt &a, int64_t b)
SlowMPInt lcm(const SlowMPInt &a, const SlowMPInt &b)
Returns the least common multiple of 'a' and 'b'.
bool operator>(const SlowMPInt &a, int64_t b)
bool operator>=(const SlowMPInt &a, int64_t b)
SlowMPInt floorDiv(const SlowMPInt &lhs, const SlowMPInt &rhs)
llvm::raw_ostream & operator<<(llvm::raw_ostream &os, const SlowMPInt &x)
SlowMPInt operator%(const SlowMPInt &a, int64_t b)
SlowMPInt operator-(const SlowMPInt &a, int64_t b)
bool operator!=(const SlowMPInt &a, int64_t b)
SlowMPInt ceilDiv(const SlowMPInt &lhs, const SlowMPInt &rhs)
bool operator<=(const SlowMPInt &a, int64_t b)
SlowMPInt & operator-=(SlowMPInt &a, int64_t b)
SlowMPInt & operator/=(SlowMPInt &a, int64_t b)
This header declares functions that assist transformations in the MemRef dialect.