Beaver.MLIR.Conversion.Ex (beaver v0.4.8)

Copy Markdown

Conversion plan for lowering the ex dialect to func/arith/scf/cf.

M1 lowering for the scalar subset of the ex dialect:

  • ex.lit -> arith.constant
  • ex.add -> arith.addi
  • ex.sub -> arith.subi
  • ex.mul -> arith.muli
  • ex.call -> func.call
  • ex.return -> func.return
  • ex.func -> func.func (body region moved, argument and ex.return types converted)

The ex term types (!ex.dyn/!ex.bound/!ex.unbound) convert to a scalar word type (i64) until the Zig term runtime lands.

plan/1 returns a reusable Beaver.MLIR.Conversion.Plan; run it with Beaver.MLIR.Conversion.Plan.run/2 and continue with the standard arith-to-llvm and func-to-llvm passes.

ex.var/ex.bind must be materialized to SSA first with Beaver.MLIR.Dialect.Ex.MaterializeBoundVariables.

Summary

Functions

Converts an ex term type to its scalar word representation.

Returns a conversion plan lowering the ex scalar subset to func/arith.

Functions

convert_type(type)

@spec convert_type(Beaver.MLIR.Type.t()) :: Beaver.MLIR.Type.t()

Converts an ex term type to its scalar word representation.

plan(opts \\ [])

Returns a conversion plan lowering the ex scalar subset to func/arith.