Compiler Architecture in ZKVM
graph TB
advance-program-language -- Lexer ---> Tokens
Tokens -- Parser ---> AST
AST -- Sema ---> Sema-AST
Sema-AST -- HirGen ---> HIR
HIR -- HirOpt ---> opt-HIR
opt-HIR -- LirGen ---> LIR
LIR -- Opt ---> Opt-LiR
Opt-LiR -- CodeGen ---> TargetAsm
TargetAsm -- CodeGenOpt ---> TargetOptAsm
TargetOptAsm -- Assembler ---> TargetByteCode
TargetByteCode -- Executor ---> Trace
abstract model of a computer
- data type
- instructions set
- register
- addressing(fundamental)
- storage model
- break and exception(fundamental)
- input/output model(fundamental)
- frame lowering
- instruction selection
- slot eliminate
- pro/epi-logue
- inst schdule
- register allocation
- asm print
- ...
- fixup
- relocation
- encoding
- link, load and lib
- generate trace