Skip to content

Conversation

@Mond45
Copy link
Contributor

@Mond45 Mond45 commented Dec 19, 2025

Adding an MLIR dialect for Bril to bril monorepo.
More info on this PR.
Link to the original repo

Mond45 and others added 3 commits December 19, 2025 17:49
MLIR dialect for Bril
I don't think we need to ignore anything extra here; we already ignore
`build/` in the root .gitignore.
For one thing, we avoid installing the LLVM utilities anywhere---we can
just use them directly from the `build/bin` directory.
@sampsyo
Copy link
Owner

sampsyo commented Dec 20, 2025

Really awesome work here, @Mond45. Your README was super clear; I was able to follow it easily and put the tools through their paces. Putting it all together, here's the command I ran to get all the way to ARM assembly:

bril2json < test/interp/core/tiny.bril | \
  python examples/to_ssa.py | \
  python examples/tdce.py tdce+ | \
  ./brilir/build/bin/bril2mlir 2>&1 | \
  ./brilir/build/bin/bril-opt --pass-pipeline="builtin.module(convert-bril-to-std,rename-main-function,convert-arith-to-llvm,convert-func-to-llvm,convert-cf-to-llvm,canonicalize,cse)" - | \
  $LLVM_DIR/bin/mlir-translate --mlir-to-llvmir | \
  $LLVM_DIR/bin/llc

…where $LLVM_DIR points to the freshly-built build directory from the llvm-project you have us check out at the beginning of the README. Superb!

I tried to simplify and tweak the instructions a tiny bit to be slightly more generic; hopefully that didn't mess things up too much.

@sampsyo sampsyo merged commit 433a68c into sampsyo:main Dec 20, 2025
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants