In PolyMulToNTT, the polynomial.constant op can be changed to have its output in eval form if needed. In this case, we should eagerly apply a compile-time NTT to the static coefficients array attached to the op, so that the semantics of the polynomial.constant op can be straightforwardly redefined as: "the operand are coefficients if the result type is in coeff form, and evaluations if the result type is in eval form."
We may want to do this for some other ops, like polynomial.monomial, but since polynomial.monomial is manly used as an interim implementation detail of the lowering of coefficient form polynomial.mul, it is unlikely to be load bearing here. But polynomial.constant would participate in more meaningful optimizations, such as constant folding.
In PolyMulToNTT, the polynomial.constant op can be changed to have its output in eval form if needed. In this case, we should eagerly apply a compile-time NTT to the static coefficients array attached to the op, so that the semantics of the
polynomial.constantop can be straightforwardly redefined as: "the operand are coefficients if the result type is in coeff form, and evaluations if the result type is in eval form."We may want to do this for some other ops, like
polynomial.monomial, but sincepolynomial.monomialis manly used as an interim implementation detail of the lowering of coefficient formpolynomial.mul, it is unlikely to be load bearing here. Butpolynomial.constantwould participate in more meaningful optimizations, such as constant folding.