This repo contains LAKSA, the compiler infrastructure component of the MYRTUS project, which funds this work. All analysis, optimization, and backend code generation for LAKSA targets flow through the dialects and passes defined here.
The compiler is built on top of MLIR, which allows each stage of the pipeline to be expressed as a dialect lowering, from high-level dataflow graph descriptions down to target-specific output. Each dialect in this project represents one layer of that pipeline.
The
DFGdialect is a reimplementation of Feliix42/dfg-mlir.
The paper describing this project has been accepted at CASES'26. The proceedings aren't out yet (a link to the paper will be added here later).
This repo ships a Nix flake that provides a complete dev shell
with LLVM/MLIR, cmake, ninja, mold, doxygen, gurobi, and the Python
toolchain already on PATH, with LLVM_DIR, MLIR_DIR, LLVM_EXTERNAL_LIT,
PYTHONPATH, and GUROBI_HOME set automatically:
nix developIf you use direnv, direnv allow will load the shell
automatically via the included .envrc. With the shell active, build.sh
detects the toolchain env vars and configures/builds directly, no arguments
needed:
bash build.shBuilt and tested against
llvm-22.1.7.
Outside the Nix shell, build.sh also installs the system
packages, downloads Gurobi, and sets up the Python venv:
-
Download
llvm-22.tar.zstfrom this repo's Releases page. -
Run the script, pointing it at the downloaded file:
bash build.sh /path/to/llvm-22.tar.zst
A Gurobi license is required either way. Either export WLSACCESSID,
WLSSECRET, and LICENSEID before running the script (it writes
$HOME/.gurobi/gurobi.lic for you), or place a license file there yourself.
The .mlir FileCheck test suite under test/ is run with:
cmake --build build --target check-laksa-mlirUsing the Python bindings
See python/examples/ — it mirrors test/'s
layout, with one .py file per .mlir test rebuilding the same IR via the
Python bindings and running the same pass(es). Start there for runnable
references on constructing ops and invoking passes.
cmake --build build --target check-laksa-pythonThis target verifies every example still matches its .mlir counterpart,
depending on install-python-package to rebuild and reinstall first.
The Doxygen and Sphinx documentation is found under
build/docs/sphinx/index.html:
cmake --build build --target build-laksa-doc