git submodule update --init externals/llvm-project
make llvm # one-time LLVM/MLIR/Clang build
make dev # project build + backend symlinks
export PYTHONPATH=$PWD/python:$PYTHONPATH
make test # lit + pytest, everything must passmake scalehls additionally builds the ScaleHLS-HIDA toolchain (needed only
for the scalehls backend and its tests; they self-skip otherwise).
make llvm builds clangd, make build generates the compilation
database; the committed .clangd and .vscode/ wire them up (plus the
TableGen/MLIR LSP servers), so navigation and diagnostics work out of
the box in VS Code. Other editors: use the in-tree
externals/llvm-project/build/bin/clangd.
- C++ follows the LLVM style (2-space indent, 80 columns,
lowerCamelCasefunctions). New passes are declared in tablegen (include/sar/Conversion/Passes.td) and registered insar-opt. - Python is PEP 8 with 79-column lines; keep the frontend dependency-free
beyond numpy.
python -m pyflakes python/sar third_party test/python examples/*/*.py benchmarks/*.pymust be clean. - Tests are mandatory. Dialect/lowering changes need lit coverage under
test/Dialect/test/Conversion; user-visible behavior needs pytest coverage undertest/python. Numerical kernels are validated against numpy references with explicit tolerances. - Folds must be bit-exact. Rewrites that can change floating-point results (even by one ULP) do not belong in canonicalization.
- New SAR operation: ODS definition in
SAROps.td(+ verifier), lowering pattern inlib/Conversion/, frontend wrapper inpython/sar/language, lit + pytest coverage, and a row indocs/dialect.md. - New backend: see
docs/backends.md; nothing in the core should change. - Runtime kernels:
runtime/SARRuntime.cppis dependency-free C++17 with a C ABI; keep it that way.
Local fixes to externals/ must be captured as patch files under
scripts/patches/ and applied idempotently from the build scripts, so a
fresh clone reproduces the toolchain exactly.