Currently the semantic of coefficientModulus is unclear and a lowering
of it faces uncertainty, for example,
https://github.com/google/heir/pull/995#issuecomment-2387394895
Also, it lacks a verifier which should conform to the definition in the
document.
This PR tries to further define the semantic of coefficientModulus and
adds a verifier for it.
Cc @j2kun for review and suggestions.
#91137 reverted in #92001
A build error fix added in 28d5ece8ca93ef04fee9b0258b70b750b66c05ca
---------
Co-authored-by: Jeremy Kun <j2kun@users.noreply.github.com>
This reverts commit 91a14dbf825b79ff143d1b16124763a4a80facab.
Not sure how to fix the build error this introduced, so reverting until
I can figure it out
https://lab.llvm.org/buildbot/#/builders/264/builds/10468
Co-authored-by: Jeremy Kun <j2kun@users.noreply.github.com>
In summary:
- `Monomial` -> `MonomialBase` with two inheriting `IntMonomial` and
`FloatMonomial` for the different coefficient types
- `Polynomial` -> `PolynomialBase` with `IntPolynomial` and
`FloatPolynomial` inheriting
- `PolynomialAttr` -> `IntPolynomialAttr`, and new `FloatPolynomialAttr`
attribute, both of which may be input to `polynomial.constant`
- Refactoring common parts of attribute parsers.
---------
Co-authored-by: Jeremy Kun <j2kun@users.noreply.github.com>
These two ops represent a number-theoretic transform of a polynomial to
a tensor of evaluations of the polynomial at a list of powers of
primitive roots of the polynomial.
To support this, a new optional attribute is added to the ring attribute
to specify the primitive root of unity used for the NTT. A verifier for
the op is added to ensure the chosen root is a primitive nth root of
unity.
---------
Co-authored-by: Jeremy Kun <j2kun@users.noreply.github.com>
Co-authored-by: Oleksandr "Alex" Zinenko <ftynse@gmail.com>
…ted. (#89998)" (#90250)
This partially reverts commit 7aedd7dc754c74a49fe84ed2640e269c25414087.
This change removes calls to the deprecated member functions. It does
not mark the functions deprecated yet and does not disable the
deprecation warning in TypeSwitch. This seems to cause problems with
MSVC.
RFC:
https://discourse.llvm.org/t/rfc-a-poly-dialect-for-polynomial-arithmetic/73891
This PR implements the minimal work needed to represent the polynomial
type such that it can be tested with `lit`.
In this PR:
- Dialect shell
- `Polynomial` data structure needed for folding
- Polynomial attributes (`PolynomialAttr` and `RingAttr` which store a polynomial)
- `polynomial.polynomial` type
- Basic lit tests
---------
Co-authored-by: Jeremy Kun <j2kun@users.noreply.github.com>