pliron is an extensible compiler IR framework in Rust, inspired by MLIR.
-
Install the rust toolchain.
-
cargo buildandcargo testshould build the compiler and run the testsuite. -
To see a simple IR constructed (by the print_simple test), use the following command:
cargo test print_simple -- --show-outputIt should print something like:
builtin.module @bar { ^block1v1(): builtin.func @foo: builtin.function <()->(builtin.integer si64)> { ^entry_block2v1(): c0_v0 = test.constant builtin.integer <0: si64> !0; test.return c0_v0 } } outlined_attributes: !0 = [builtin_debug_info = builtin.debug_info [c0]]
-
plironprovides an LLVM Dialect and consequently anllvm-opttool that can parse LLVM-IR bitcode into the LLVM dialect and output LLVM-IR bitcode.
Add a dependence on the crate in your Rust project.
Note: pliron is under active development. Every effort is made to ensure that the code is well tested
and of production quality. The LLVM dialect, although not complete, can be useful practically. It can,
for example, compile bzip2.
We also plan to start work on supporting a cranelift dialect/backend soon.
- Kaleidoscope tutorial.
- Latest docs (built from
master). - Release docs.rs.
- Misc articles on the wiki
- cuda-oxide: NVIDIA's Rust CUDA compiler.
- Commonly used Pliron Dialects
- Pliron Dialect for Tensors
