docs.rs failed to build cilk-0.2.1
Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
Cilk
Toy Compiler Infrastructure influenced by LLVM written in Rust.
Do not expect too much stuff!
To Do
- Optimization
- Easy
- Spill registers not to the stack but to callee saved registers such as ebx. (llc does so)
- Take into consideration the physical registers' allocation order.
- Hard
- ....
- Easy
- Refine code
- Write documents in detail
- Write tests (because I recently removed most of them)
Build
Requirement: Rust nightly
Example
- Fibonacci (the following code may not work. take a look at ./tests)
use ;
let mut m = new;
let fibo = m.create_function;
let mut builder = new;
// Function dump:
// define i32 fibo(i32) {
// label.0:
// %0 = icmp le i32 %arg.0, i32 2
// br i1 %0 %label.1, %label.2
//
// label.1:
// ret i32 1
//
// label.2:
// %3 = sub i32 %arg.0, i32 1
// %4 = call i32 fibo(i32 %3, )
// %5 = sub i32 %arg.0, i32 2
// %6 = call i32 fibo(i32 %5, )
// %7 = add i32 %4, i32 %6
// ret i32 %7
//
// }
// In this branch, this may not work correctly.
let mut interp = new;
let ret = interp.run_function;
println!; // fibo(10) = Int32(55)
// JIT suppports for only x86_64
let mut jit = new;
let func = jit.find_function_by_name.unwrap;
println!; // fibo(10) = 55
- Useful macro to describe IR is available
let fibo = cilk_ir!;