-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathjustfile
63 lines (46 loc) · 1.76 KB
/
justfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
export RUST_BACKTRACE := "1"
test_c := "hello.c"
level := "lv9"
test_koopa := replace_regex(test_c, '\.c$', ".kp")
test_riscv := replace_regex(test_c, '\.c$', ".s")
test_llvm := replace_regex(test_c, '\.c$', ".ll")
test_llvm_riscv := replace_regex(test_c, '\.c$', ".ll.s")
default: koopa riscv perf
dump-ast:
cargo run -- -dump-ast {{test_c}}
koopa:
cargo run -- -koopa {{test_c}} -o {{test_koopa}}
cat {{test_koopa}}
riscv:
cargo run -- -riscv {{test_c}} -o {{test_riscv}}
cat {{test_riscv}}
perf:
cargo run -- -perf {{test_c}} -o {{test_riscv}}
cat {{test_riscv}}
trace:
cargo run --features=trace -- -perf {{test_c}} -o {{test_riscv}}
cat {{test_riscv}}
llvm:
clang -S -emit-llvm {{test_c}} -O0 -Xclang -disable-O0-optnone --target=riscv32-unknown-unknown
opt -S -p=mem2reg {{test_llvm}} -o {{test_llvm}}
llc {{test_llvm}} -o {{test_llvm_riscv}} -O0 --frame-pointer=none -march=riscv32 -mattr=+m,+relax
cat {{test_llvm_riscv}}
koopac: koopa
koopac {{test_koopa}} -o {{test_koopa}}.ll
llc {{test_koopa}}.ll -o {{test_koopa}}.s -O0 --frame-pointer=none -march=riscv32 -mattr=+m,+relax
cat {{test_koopa}}.s
autotest: autotest-koopa autotest-riscv autotest-perf
autotest-koopa:
docker run -it --rm -v .:/root/compiler maxxing/compiler-dev autotest -koopa -s {{level}} /root/compiler/
autotest-riscv:
docker run -it --rm -v .:/root/compiler maxxing/compiler-dev autotest -riscv -s {{level}} /root/compiler/
autotest-perf:
docker run -it --rm -v .:/root/compiler maxxing/compiler-dev autotest -perf -s {{level}} /root/compiler/
doc:
cargo doc --no-deps --document-private-items
dufs
build-timings:
cargo clean
cargo build --release --timings
bloat:
cargo bloat --release --crates --split-std