google / google/heir

Use ArithmeticDag for all `polynomial.eval` lowerings

Open
#1,946 4 comments 0 reactions 0 assignees View on GitHub
dialect: polynomial good first issue
Dominant language
MLIR
Stars
906
Forks
171
Avg merge
4d 12h
Merged PRs (30d)
32

Description

In https://github.com/google/heir/pull/1945 we split the process of lowering `polynomial.eval` into two steps: constructing an [ArithemticDag](https://github.com/google/heir/blob/main/lib/Utils/ArithmeticDag.h) for the lowered eval and materializing the IR in the pass by running a visitor over the DAG.

The first step is good because you can unit test the lowered arithmetic DAG outside of any MLIR nonsense (e.g., evaluate the DAG to assert you get the same output as the polynomial, assert the multiplicative depth is what you expect, cf. lib/Utils/Polynomial/ChebyshevPatersonStockmeyerTest.cpp for examples). The second step is good because it's really independent of the lowering method, so all the IR construction logic can be shared across all lowering options.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.