MLIR  19.0.0git
Classes | Functions | Variables
mlir::polynomial Namespace Reference

Classes

class  Monomial
 A class representing a monomial of a single-variable polynomial with integer coefficients. More...
 
class  Polynomial
 A single-variable polynomial with integer coefficients. More...
 

Functions

inline ::llvm::hash_code hash_value (const Polynomial &arg)
 
inline ::llvm::hash_code hash_value (const Monomial &arg)
 
raw_ostream & operator<< (raw_ostream &os, const Polynomial &polynomial)
 
ParseResult parseMonomial (AsmParser &parser, Monomial &monomial, llvm::StringRef &variable, bool &isConstantTerm, bool &shouldParseMore)
 Try to parse a monomial. More...
 

Variables

constexpr unsigned apintBitWidth = 64
 This restricts statically defined polynomials to have at most 64-bit coefficients. More...
 

Function Documentation

◆ hash_value() [1/2]

inline ::llvm::hash_code mlir::polynomial::hash_value ( const Monomial arg)

Definition at line 116 of file Polynomial.h.

◆ hash_value() [2/2]

inline ::llvm::hash_code mlir::polynomial::hash_value ( const Polynomial arg)

Definition at line 112 of file Polynomial.h.

◆ operator<<()

raw_ostream& mlir::polynomial::operator<< ( raw_ostream &  os,
const Polynomial polynomial 
)
inline

Definition at line 121 of file Polynomial.h.

References mlir::polynomial::Polynomial::print().

◆ parseMonomial()

ParseResult mlir::polynomial::parseMonomial ( AsmParser parser,
Monomial monomial,
llvm::StringRef &  variable,
bool &  isConstantTerm,
bool &  shouldParseMore 
)

Try to parse a monomial.

If successful, populate the fields of the outparam monomial with the results, and the variable outparam with the parsed variable name. Sets shouldParseMore to true if the monomial is followed by a '+'.

Definition at line 30 of file PolynomialAttributes.cpp.

References apintBitWidth, mlir::failure(), and mlir::success().

Variable Documentation

◆ apintBitWidth

constexpr unsigned mlir::polynomial::apintBitWidth = 64
constexpr

This restricts statically defined polynomials to have at most 64-bit coefficients.

This may be relaxed in the future, but it seems unlikely one would want to specify 128-bit polynomials statically in the source code.

Definition at line 28 of file Polynomial.h.

Referenced by parseMonomial().