All Projects → bjorn3 → Rustc_codegen_cranelift

bjorn3 / Rustc_codegen_cranelift

Licence: other
Cranelift based backend for rustc

Programming Languages

rust
11053 projects

Projects that are alternatives of or similar to Rustc codegen cranelift

Asmjit
Machine code generation for C++
Stars: ✭ 2,874 (+325.78%)
Mutual labels:  compiler, jit
Awesome Graal
A curated list of awesome resources for Graal, GraalVM, Truffle and related topics
Stars: ✭ 302 (-55.26%)
Mutual labels:  jit, aot
Lightbeam
Lightbeam has moved and now lives in the Wasmtime repository!
Stars: ✭ 253 (-62.52%)
Mutual labels:  compiler, jit
Cranelift
Cranelift code generator
Stars: ✭ 2,485 (+268.15%)
Mutual labels:  compiler, jit
Ilgpu
ILGPU JIT Compiler for high-performance .Net GPU programs
Stars: ✭ 374 (-44.59%)
Mutual labels:  compiler, jit
Ts Llvm
TypeScript to LLVM compiler (abandoned)
Stars: ✭ 230 (-65.93%)
Mutual labels:  compiler, aot
transonic
🚀 Make your Python code fly at transonic speeds!
Stars: ✭ 93 (-86.22%)
Mutual labels:  jit, aot
Nanojit
NanoJIT is a small, cross-platform C++ library that emits machine code.
Stars: ✭ 101 (-85.04%)
Mutual labels:  compiler, jit
Dora
Dora VM
Stars: ✭ 371 (-45.04%)
Mutual labels:  compiler, jit
Numpile
A tiny 1000 line LLVM-based numeric specializer for scientific Python code.
Stars: ✭ 341 (-49.48%)
Mutual labels:  compiler, jit
Minijit
A basic x86-64 JIT compiler written from scratch in stock Python
Stars: ✭ 185 (-72.59%)
Mutual labels:  compiler, jit
Scala Native
Your favorite language gets closer to bare metal.
Stars: ✭ 4,053 (+500.44%)
Mutual labels:  compiler, aot
Jitfromscratch
Example project from my talks in the LLVM Social Berlin and C++ User Group
Stars: ✭ 158 (-76.59%)
Mutual labels:  compiler, jit
Openj9
Eclipse OpenJ9: A Java Virtual Machine for OpenJDK that's optimized for small footprint, fast start-up, and high throughput. Builds on Eclipse OMR (https://github.com/eclipse/omr) and combines with the Extensions for OpenJDK for OpenJ9 repo.
Stars: ✭ 2,802 (+315.11%)
Mutual labels:  compiler, jit
Jphp
JPHP - an implementation of PHP on Java VM
Stars: ✭ 1,665 (+146.67%)
Mutual labels:  compiler, jit
vox
Vox language compiler. AOT / JIT / Linker. Zero dependencies
Stars: ✭ 288 (-57.33%)
Mutual labels:  jit, aot
B2dpipe
2D Pipeline Compiler.
Stars: ✭ 51 (-92.44%)
Mutual labels:  compiler, jit
Jit Compiler
JIT compiler in Go
Stars: ✭ 70 (-89.63%)
Mutual labels:  compiler, jit
Enso Archive
Looking for Enso, the visual programming language? ➡️ https://github.com/enso-org/enso
Stars: ✭ 305 (-54.81%)
Mutual labels:  compiler, jit
Enso
Hybrid visual and textual functional programming.
Stars: ✭ 5,238 (+676%)
Mutual labels:  compiler, jit

Cranelift codegen backend for rust

The goal of this project is to create an alternative codegen backend for the rust compiler based on Cranelift. This has the potential to improve compilation times in debug mode. If your project doesn't use any of the things listed under "Not yet supported", it should work fine. If not please open an issue.

Building and testing

$ git clone https://github.com/bjorn3/rustc_codegen_cranelift.git
$ cd rustc_codegen_cranelift
$ ./prepare.sh # download and patch sysroot src and install hyperfine for benchmarking
$ ./build.sh

To run the test suite replace the last command with:

$ ./test.sh

This will implicitly build cg_clif too. Both build.sh and test.sh accept a --debug argument to build in debug mode.

Alternatively you can download a pre built version from GHA. It is listed in the artifacts section of workflow runs. Unfortunately due to GHA restrictions you need to be logged in to access it.

Usage

rustc_codegen_cranelift can be used as a near-drop-in replacement for cargo build or cargo run for existing projects.

Assuming $cg_clif_dir is the directory you cloned this repo into and you followed the instructions (prepare.sh and build.sh or test.sh).

In the directory with your project (where you can do the usual cargo build), run:

$ $cg_clif_dir/build/cargo.sh build

This will build your project with rustc_codegen_cranelift instead of the usual LLVM backend.

For additional ways to use rustc_codegen_cranelift like the JIT mode see usage.md.

Env vars

See env_vars.md for all env vars used by rustc_codegen_cranelift.

Not yet supported

  • Inline assembly (no cranelift support)
    • On Linux there is support for invoking an external assembler for global_asm! and asm!. llvm_asm! will remain unimplemented forever. asm! doesn't yet support reg classes. You have to specify specific registers instead.
  • SIMD (tracked here, some basic things work)

License

Licensed under either of

at your option.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you shall be dual licensed as above, without any additional terms or conditions.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].