Skip to content

A compiler from scratch for Mx (a c-and-java-like language)

License

Notifications You must be signed in to change notification settings

yujie6/MX-Compiler

Repository files navigation

MX-Compiler

A compiler from scratch for Mx*(a c-and-java-like language) to riscv32. Able to generate correct assembly file.

To run the project

./gradlew installDist
./build/install/Compiler/bin/Compiler inputfile

To run codegen tests with llvm or assembly

./gradlew test --tests LLVMTest
./gradlew test --tests CodegenTest

More command line options:

usage: MX-Compiler
 -g,--debug <arg>    set level of debug information
 -h,--help           print this message
 -i,--input <arg>    input file path
 -o,--output <arg>   output file (rv32 Assembly)

debug option	description
-g 0		no debug information
-g 1		only warning information
-g 2		with minimal information
-g 3		with detail information

Current Objectives

  • Optimizations
    • Graph simplification (edge splitter & preheader)
    • Inst Combine
    • Strength Reduction
    • Induction Variable Recognition
  • Some non-trivial optimizations
  • Improve code quality in code generation and IR

About

A compiler from scratch for Mx (a c-and-java-like language)

Resources

License

Stars

Watchers

Forks

Packages

No packages published