Skip to content

[Calyx] CIRCT Calyx dialect should have an importer to go with the exporter #2955

Open
@mikeurbach

Description

In line with common MLIR practice, we have defined a Calyx exporter to produce the textual format used by the original, Rust-based Calyx compiler. This is the common way to interface with external tools from MLIR projects (e.g. the TensorFlow compiler can produce/consume HLO to interact with XLA). In order to consume IR from the original Calyx compiler, the CIRCT Calyx compiler should also be able to import the external textual format.

In lieu of this, the original Calyx compiler is currently able to produce the CIRCT Calyx compiler's textual format, using the -b mlir option to futil, for example. Now I realize why it kept coming up that the CIRCT textual parser had to be updated, and why requests were made to enhance the CIRCT textual form to better match the Rust implementation. (I just implemented a small change to align the CIRCT parser to the Rust printer #2954).

As I keep harping, an MLIR dialect's textual format is for testing, and should not be load bearing. This issue is about fixing that. Rather than having two compilers, each exporting to the other's format, the MLIR side should import and export the other compiler's external format. This symmetry puts the burden on the MLIR side, but I think that is worth not requiring changes from the other side (cf. TensorFlow integration with XLA), and I think this is how the CIRCT Calyx compiler should do it. Then we can remove -b mlir from the Rust compiler. I'm sorry I wasn't understanding what was going on here earlier, but now I think it is clear.

cc @mortbopet @cgyurgyik @rachitnigam

Metadata

Assignees

No one assigned

    Labels

    CalyxThe Calyx dialectenhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions