updated on 2022/12/5
- commands
- semantic notes
- semantic checklist
- IR design
- raw IR checklist
- codegen notes
- raw codegen checklist
test.ll(generated by my compiler from test.mx) and builtin.ll are both x86-64 target.
sh ir-test.shsh ir-draw.sh
The testIR flag in Compiler.java should be set to true.
python3 ir-auto-test.py
sh asm-riscv-gen.shto generatetest.sin risv32 target.sh codegen-test.shusetest.s,builtin.sandravelto execute the program.
- to
.llclang -S -emit-llvm test.cclang -S -emit-llvm test.c --target=riscv32
- to
.bcclang -c -emit-llvm test.c
llvm-link test.ll builtin.ll -o linked.bc
clang test.ll -o testclang test.bc -o test
lli test.lllli test.bc
llc test.ll -o test.sllc test.bc -o test.s
clang -S test.cclang -S test.c --target=riscv32 -march=rv32imimeans basic integer instructions,mmeans multiply and divide, which we will use in code-generation phase.
llc test.ll -o test.s -march=riscv32 -mattr=+mmtells the compiler not to use__mulbut to usemulinstruction.