MLIR  18.0.0git
Classes | Functions
mlir::presburger::detail Namespace Reference

Classes

class  SlowMPInt
 A simple class providing multi-precision arithmetic. More...
 

Functions

LLVM_ATTRIBUTE_ALWAYS_INLINE bool addOverflow (int64_t x, int64_t y, int64_t &result)
 If builtin intrinsics for overflow-checked arithmetic are available, use them. More...
 
LLVM_ATTRIBUTE_ALWAYS_INLINE bool subOverflow (int64_t x, int64_t y, int64_t &result)
 
LLVM_ATTRIBUTE_ALWAYS_INLINE bool mulOverflow (int64_t x, int64_t y, int64_t &result)
 
LLVM_ATTRIBUTE_ALWAYS_INLINE bool divWouldOverflow (int64_t x, int64_t y)
 
llvm::raw_ostream & operator<< (llvm::raw_ostream &os, const SlowMPInt &x)
 
SlowMPInt mod (const SlowMPInt &lhs, const SlowMPInt &rhs)
 Returns the remainder of dividing LHS by RHS. More...
 
SlowMPInt lcm (const SlowMPInt &a, const SlowMPInt &b)
 Returns the least common multiple of 'a' and 'b'. More...
 
SlowMPInt abs (const SlowMPInt &x)
 Redeclarations of friend declarations above to make it discoverable by lookups. More...
 
SlowMPInt ceilDiv (const SlowMPInt &lhs, const SlowMPInt &rhs)
 
SlowMPInt floorDiv (const SlowMPInt &lhs, const SlowMPInt &rhs)
 
SlowMPInt gcd (const SlowMPInt &a, const SlowMPInt &b)
 
llvm::hash_code hash_value (const SlowMPInt &x)
 
SlowMPIntoperator+= (SlowMPInt &a, int64_t b)
 
SlowMPIntoperator-= (SlowMPInt &a, int64_t b)
 
SlowMPIntoperator*= (SlowMPInt &a, int64_t b)
 
SlowMPIntoperator/= (SlowMPInt &a, int64_t b)
 
SlowMPIntoperator%= (SlowMPInt &a, int64_t b)
 
bool operator== (const SlowMPInt &a, int64_t b)
 
bool operator!= (const SlowMPInt &a, int64_t b)
 
bool operator> (const SlowMPInt &a, int64_t b)
 
bool operator< (const SlowMPInt &a, int64_t b)
 
bool operator<= (const SlowMPInt &a, int64_t b)
 
bool operator>= (const SlowMPInt &a, int64_t b)
 
SlowMPInt operator+ (const SlowMPInt &a, int64_t b)
 
SlowMPInt operator- (const SlowMPInt &a, int64_t b)
 
SlowMPInt operator* (const SlowMPInt &a, int64_t b)
 
SlowMPInt operator/ (const SlowMPInt &a, int64_t b)
 
SlowMPInt operator% (const SlowMPInt &a, int64_t b)
 
bool operator== (int64_t a, const SlowMPInt &b)
 
bool operator!= (int64_t a, const SlowMPInt &b)
 
bool operator> (int64_t a, const SlowMPInt &b)
 
bool operator< (int64_t a, const SlowMPInt &b)
 
bool operator<= (int64_t a, const SlowMPInt &b)
 
bool operator>= (int64_t a, const SlowMPInt &b)
 
SlowMPInt operator+ (int64_t a, const SlowMPInt &b)
 
SlowMPInt operator- (int64_t a, const SlowMPInt &b)
 
SlowMPInt operator* (int64_t a, const SlowMPInt &b)
 
SlowMPInt operator/ (int64_t a, const SlowMPInt &b)
 
SlowMPInt operator% (int64_t a, const SlowMPInt &b)
 

Function Documentation

◆ abs()

SlowMPInt mlir::presburger::detail::abs ( const SlowMPInt x)

Redeclarations of friend declarations above to make it discoverable by lookups.

◆ addOverflow()

LLVM_ATTRIBUTE_ALWAYS_INLINE bool mlir::presburger::detail::addOverflow ( int64_t  x,
int64_t  y,
int64_t &  result 
)

If builtin intrinsics for overflow-checked arithmetic are available, use them.

Otherwise, call through to LLVM's overflow-checked arithmetic functionality. Those functions also have such macro-gated uses of intrinsics but they are not always_inlined, which is important for us to achieve high-performance; calling the functions directly would result in a slowdown of 1.15x.

Definition at line 45 of file MPInt.h.

Referenced by mlir::presburger::MPInt::operator+(), and mlir::presburger::MPInt::operator+=().

◆ ceilDiv()

SlowMPInt mlir::presburger::detail::ceilDiv ( const SlowMPInt lhs,
const SlowMPInt rhs 
)

◆ divWouldOverflow()

LLVM_ATTRIBUTE_ALWAYS_INLINE bool mlir::presburger::detail::divWouldOverflow ( int64_t  x,
int64_t  y 
)

Definition at line 274 of file MPInt.h.

References min().

Referenced by mlir::presburger::MPInt::operator/(), and mlir::presburger::MPInt::operator/=().

◆ floorDiv()

SlowMPInt mlir::presburger::detail::floorDiv ( const SlowMPInt lhs,
const SlowMPInt rhs 
)

◆ gcd()

SlowMPInt mlir::presburger::detail::gcd ( const SlowMPInt a,
const SlowMPInt b 
)

◆ hash_value()

llvm::hash_code mlir::presburger::detail::hash_value ( const SlowMPInt x)

◆ lcm()

SlowMPInt mlir::presburger::detail::lcm ( const SlowMPInt a,
const SlowMPInt b 
)

Returns the least common multiple of 'a' and 'b'.

◆ mod()

SlowMPInt mlir::presburger::detail::mod ( const SlowMPInt lhs,
const SlowMPInt rhs 
)

Returns the remainder of dividing LHS by RHS.

The RHS is always expected to be positive, and the result is always non-negative.

◆ mulOverflow()

LLVM_ATTRIBUTE_ALWAYS_INLINE bool mlir::presburger::detail::mulOverflow ( int64_t  x,
int64_t  y,
int64_t &  result 
)

◆ operator!=() [1/2]

bool mlir::presburger::detail::operator!= ( const SlowMPInt a,
int64_t  b 
)

◆ operator!=() [2/2]

bool mlir::presburger::detail::operator!= ( int64_t  a,
const SlowMPInt b 
)

◆ operator%() [1/2]

SlowMPInt mlir::presburger::detail::operator% ( const SlowMPInt a,
int64_t  b 
)

◆ operator%() [2/2]

SlowMPInt mlir::presburger::detail::operator% ( int64_t  a,
const SlowMPInt b 
)

◆ operator%=()

SlowMPInt& mlir::presburger::detail::operator%= ( SlowMPInt a,
int64_t  b 
)

◆ operator*() [1/2]

SlowMPInt mlir::presburger::detail::operator* ( const SlowMPInt a,
int64_t  b 
)

◆ operator*() [2/2]

SlowMPInt mlir::presburger::detail::operator* ( int64_t  a,
const SlowMPInt b 
)

◆ operator*=()

SlowMPInt& mlir::presburger::detail::operator*= ( SlowMPInt a,
int64_t  b 
)

◆ operator+() [1/2]

SlowMPInt mlir::presburger::detail::operator+ ( const SlowMPInt a,
int64_t  b 
)

◆ operator+() [2/2]

SlowMPInt mlir::presburger::detail::operator+ ( int64_t  a,
const SlowMPInt b 
)

◆ operator+=()

SlowMPInt& mlir::presburger::detail::operator+= ( SlowMPInt a,
int64_t  b 
)

Convenience operator overloads for int64_t.

◆ operator-() [1/2]

SlowMPInt mlir::presburger::detail::operator- ( const SlowMPInt a,
int64_t  b 
)

◆ operator-() [2/2]

SlowMPInt mlir::presburger::detail::operator- ( int64_t  a,
const SlowMPInt b 
)

◆ operator-=()

SlowMPInt& mlir::presburger::detail::operator-= ( SlowMPInt a,
int64_t  b 
)

◆ operator/() [1/2]

SlowMPInt mlir::presburger::detail::operator/ ( const SlowMPInt a,
int64_t  b 
)

◆ operator/() [2/2]

SlowMPInt mlir::presburger::detail::operator/ ( int64_t  a,
const SlowMPInt b 
)

◆ operator/=()

SlowMPInt& mlir::presburger::detail::operator/= ( SlowMPInt a,
int64_t  b 
)

◆ operator<() [1/2]

bool mlir::presburger::detail::operator< ( const SlowMPInt a,
int64_t  b 
)

◆ operator<() [2/2]

bool mlir::presburger::detail::operator< ( int64_t  a,
const SlowMPInt b 
)

◆ operator<<()

llvm::raw_ostream& mlir::presburger::detail::operator<< ( llvm::raw_ostream &  os,
const SlowMPInt x 
)

◆ operator<=() [1/2]

bool mlir::presburger::detail::operator<= ( const SlowMPInt a,
int64_t  b 
)

◆ operator<=() [2/2]

bool mlir::presburger::detail::operator<= ( int64_t  a,
const SlowMPInt b 
)

◆ operator==() [1/2]

bool mlir::presburger::detail::operator== ( const SlowMPInt a,
int64_t  b 
)

◆ operator==() [2/2]

bool mlir::presburger::detail::operator== ( int64_t  a,
const SlowMPInt b 
)

◆ operator>() [1/2]

bool mlir::presburger::detail::operator> ( const SlowMPInt a,
int64_t  b 
)

◆ operator>() [2/2]

bool mlir::presburger::detail::operator> ( int64_t  a,
const SlowMPInt b 
)

◆ operator>=() [1/2]

bool mlir::presburger::detail::operator>= ( const SlowMPInt a,
int64_t  b 
)

◆ operator>=() [2/2]

bool mlir::presburger::detail::operator>= ( int64_t  a,
const SlowMPInt b 
)

◆ subOverflow()

LLVM_ATTRIBUTE_ALWAYS_INLINE bool mlir::presburger::detail::subOverflow ( int64_t  x,
int64_t  y,
int64_t &  result 
)