Skip to content
hexratccPublic

About

Small C compiler with a Sea of Nodes backend, made for trying out optimizations.

Topics

Resources

Stars

44 stars

Watchers

0 watching

Forks

Latest commit

 

History

805 Commits

Folders and files

Repository files navigation

rat test (ubuntu-latest)

emanuel

rat is a simple, handmade, and relatively minimal compiler suite (including a C99 frontend, a simple linker, and a Sea of Nodes backend). Some of the features include but are not limited to:

  • ratcc -O1 compiles sqlite3.c about 17x faster than clang -O1)
  • ratcc -O1 code runs within 5% of gcc -O1 and 26% of clang -O1.
  • rat is small, readable and easy to hack on.

running

$ make
$ make test
$ make bench

optimization passes

  • sccp: sparse conditional constant propagation
  • fold: constant folding, algebraic simplification
  • simplifycfg: control-flow simplification
  • gvn: global value numbering
  • memoryopt: load/store forwarding
  • inline: function inlining
  • strengthreduce: induction-variable strength reduction
  • loadcanon: moves loads to their canonical memory state
  • slp: scheduling-free SLP vectorization with runtime alias guards
  • dfe: dead function elimination

machine passes

tool passes

About

Small C compiler with a Sea of Nodes backend, made for trying out optimizations.

Topics

Resources

Stars

44 stars

Watchers

0 watching

Forks

Contributors

Languages