Polynomial
polynomial
A polynomial dialect for representing unevaluated polynomial approximations, designed for use with equality saturation.
Cost estimation can be done on a single polynomial.eval op
that carries all the information needed. After extraction, the selected
polynomial variant will be expanded into arithmetic operations.
Polynomial = Dialect('polynomial', [], [RingAttr, PolynomialType])
module-attribute
RingAttr
dataclass
Bases: ParametrizedAttribute
A polynomial ring, parameterized by the coefficient type.
Syntax: #polynomial.ring
Source code in xdsl/dialects/polynomial.py
30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 | |
name = 'polynomial.ring'
class-attribute
instance-attribute
coefficient_type: Attribute
instance-attribute
parse_parameters(parser: AttrParser) -> Sequence[Attribute]
classmethod
Source code in xdsl/dialects/polynomial.py
42 43 44 45 46 47 48 | |
print_parameters(printer: Printer) -> None
Source code in xdsl/dialects/polynomial.py
50 51 52 53 | |
PolynomialType
dataclass
Bases: ParametrizedAttribute, TypeAttribute
Type of an element of a polynomial ring.
Syntax: !polynomial.polynomial
Source code in xdsl/dialects/polynomial.py
56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 | |
name = 'polynomial.polynomial'
class-attribute
instance-attribute
ring: RingAttr
instance-attribute
parse_parameters(parser: AttrParser) -> Sequence[Attribute]
classmethod
Source code in xdsl/dialects/polynomial.py
68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 | |
print_parameters(printer: Printer) -> None
Source code in xdsl/dialects/polynomial.py
85 86 87 88 | |