MLIR
20.0.0git
|
Classes | |
class | MonomialBase |
class | IntMonomial |
A class representing a monomial of a single-variable polynomial with integer coefficients. More... | |
class | FloatMonomial |
A class representing a monomial of a single-variable polynomial with integer coefficients. More... | |
class | PolynomialBase |
class | IntPolynomial |
A single-variable polynomial with integer coefficients. More... | |
class | FloatPolynomial |
A single-variable polynomial with double coefficients. More... | |
Typedefs | |
template<typename MonomialType > | |
using | ParseCoefficientFn = std::function< OptionalParseResult(MonomialType &)> |
A callable that parses the coefficient using the appropriate method for the given monomial type, and stores the parsed coefficient value on the monomial. More... | |
Functions | |
template<class D , typename T > | |
inline ::llvm::hash_code | hash_value (const PolynomialBase< D, T > &arg) |
template<class D , typename T > | |
inline ::llvm::hash_code | hash_value (const MonomialBase< D, T > &arg) |
template<class D , typename T > | |
raw_ostream & | operator<< (raw_ostream &os, const PolynomialBase< D, T > &polynomial) |
template<typename PolyT , typename MonomialT > | |
FailureOr< PolyT > | fromMonomialsImpl (ArrayRef< MonomialT > monomials) |
template<typename PolyT , typename MonomialT , typename CoeffT > | |
PolyT | fromCoefficientsImpl (ArrayRef< CoeffT > coeffs) |
template<typename Monomial > | |
ParseResult | parseMonomial (AsmParser &parser, Monomial &monomial, llvm::StringRef &variable, bool &isConstantTerm, bool &shouldParseMore, ParseCoefficientFn< Monomial > parseAndStoreCoefficient) |
Try to parse a monomial. More... | |
template<typename Monomial > | |
LogicalResult | parsePolynomialAttr (AsmParser &parser, llvm::SmallVector< Monomial > &monomials, llvm::StringSet<> &variables, ParseCoefficientFn< Monomial > parseAndStoreCoefficient) |
Variables | |
constexpr unsigned | apintBitWidth = 64 |
This restricts statically defined polynomials to have at most 64-bit coefficients. More... | |
using mlir::polynomial::ParseCoefficientFn = typedef std::function<OptionalParseResult(MonomialType &)> |
A callable that parses the coefficient using the appropriate method for the given monomial type, and stores the parsed coefficient value on the monomial.
Definition at line 32 of file PolynomialAttributes.cpp.
PolyT mlir::polynomial::fromCoefficientsImpl | ( | ArrayRef< CoeffT > | coeffs | ) |
Definition at line 45 of file Polynomial.cpp.
FailureOr<PolyT> mlir::polynomial::fromMonomialsImpl | ( | ArrayRef< MonomialT > | monomials | ) |
Definition at line 17 of file Polynomial.cpp.
inline ::llvm::hash_code mlir::polynomial::hash_value | ( | const MonomialBase< D, T > & | arg | ) |
Definition at line 267 of file Polynomial.h.
inline ::llvm::hash_code mlir::polynomial::hash_value | ( | const PolynomialBase< D, T > & | arg | ) |
Definition at line 262 of file Polynomial.h.
Referenced by llvm::DenseMapInfo< mlir::Block::iterator >::getHashValue(), llvm::DenseMapInfo< mlir::tblgen::DagLeaf >::getHashValue(), llvm::DenseMapInfo< mlir::tblgen::DagNode >::getHashValue(), llvm::DenseMapInfo< T, std::enable_if_t< std::is_base_of< mlir::OpState, T >::value &&!mlir::detail::IsInterface< T >::value > >::getHashValue(), mlir::detail::DenseIntOrFPElementsAttrStorage::getKey(), mlir::detail::DenseStringElementsAttrStorage::getKey(), mlir::detail::DenseIntOrFPElementsAttrStorage::getKeyForBoolData(), mlir::detail::DenseIntOrFPElementsAttrStorage::getKeyForSplatBoolData(), mlir::pdl_to_pdl_interp::OperandGroupPosition::hashKey(), mlir::pdl_to_pdl_interp::OperationPosition::hashKey(), mlir::pdl_to_pdl_interp::ResultGroupPosition::hashKey(), mlir::pdl_to_pdl_interp::UsersPosition::hashKey(), mlir::pdl_to_pdl_interp::ConstraintQuestion::hashKey(), mlir::detail::DynamicTypeStorage::hashKey(), mlir::detail::DynamicAttrStorage::hashKey(), mlir::detail::IntegerTypeStorage::hashKey(), and mlirTypeIDHashValue().
|
inline |
Definition at line 273 of file Polynomial.h.
References mlir::polynomial::PolynomialBase< Derived, Monomial >::print().
ParseResult mlir::polynomial::parseMonomial | ( | AsmParser & | parser, |
Monomial & | monomial, | ||
llvm::StringRef & | variable, | ||
bool & | isConstantTerm, | ||
bool & | shouldParseMore, | ||
ParseCoefficientFn< Monomial > | parseAndStoreCoefficient | ||
) |
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 41 of file PolynomialAttributes.cpp.
References apintBitWidth, mlir::AsmParser::emitError(), mlir::AsmParser::getCurrentLocation(), mlir::OptionalParseResult::has_value(), mlir::AsmParser::parseInteger(), mlir::AsmParser::parseOptionalKeyword(), mlir::AsmParser::parseOptionalPlus(), mlir::AsmParser::parseOptionalStar(), and mlir::AsmParser::parseStar().
LogicalResult mlir::polynomial::parsePolynomialAttr | ( | AsmParser & | parser, |
llvm::SmallVector< Monomial > & | monomials, | ||
llvm::StringSet<> & | variables, | ||
ParseCoefficientFn< Monomial > | parseAndStoreCoefficient | ||
) |
Definition at line 105 of file PolynomialAttributes.cpp.
References mlir::AsmParser::emitError(), mlir::AsmParser::getCurrentLocation(), and mlir::AsmParser::parseOptionalGreater().
|
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 30 of file Polynomial.h.
Referenced by parseMonomial().