Batata.Lower (batata v0.1.0)

Copy Markdown View Source

Lowers ex dialect IR to func/arith/scf/cf and then to LLVM.

The conversion patterns live in Beaver (Beaver.MLIR.Conversion.Ex); this module wires them together with the standard arith-to-llvm and func-to-llvm passes for the lowering phase.

Summary

Functions

Converts an ex dialect module to func/arith/scf/cf.

Lowers an ex dialect module to LLVM dialect IR.

Functions

to_func(module)

Converts an ex dialect module to func/arith/scf/cf.

The module is converted in place and returned.

to_llvm(module, ctx, opts \\ [])

Lowers an ex dialect module to LLVM dialect IR.

Runs the ex conversion plan followed by the standard arith-to-llvm and func-to-llvm passes. With c_interface: true, requests C wrappers on the functions (llvm-request-c-wrappers) between the passes so they can be invoked through the MLIR JIT (Beaver.MLIR.ExecutionEngine). The module is converted in place and returned.