MLIR Dialect Domain Specific Language #
This file sets up generic glue meta-code to tie together the generic MLIR parser with the
Transform mechanism, to obtain an easy way to specify a DSL that elaborates into Com/Expr
instances for a specific dialect.
comNf reduces an expression of type Com to something in between whnf and normal form.
comNf recursively calls whnf on the expression and body of a Com.var, resulting in
Com.var (Expr.mk ...) <| Com.var (Expr.mk ...) <| Com.var (Expr.mk ...) <| ... <| Com.rete _
where the arguments to Expr.mk are not reduced
elabIntoCom is a building block for defining a dialect-specific DSL based on the geneeric MLIR
syntax parser.
For example, if FooOp is the type of operations of a "Foo" dialect, we can build a term elaborator
for this dialect as follows:
elab "[foo_com| " reg:mlir_region "]" : term => SSA.elabIntoCom reg q(FooOp)
-- ^^^^^^^ ^^^^^
Equations
- One or more equations did not get rendered due to their size.