tiny

github

A compiler for the Tiny language that generates SSA-form intermediate representation with optimizations like common subexpression elimination and copy propagation.

Try it

Write Tiny code below and compile it to see the control flow graph.

Source code
Control flow graphLoading...
Loading compiler...

The Language

Tiny is a simple imperative language with:

The Compiler

The compiler pipeline:

  1. Lexer - Tokenizes source into a stream of tokens
  2. Parser - Builds an AST from the token stream
  3. IR Generator - Converts AST to SSA-form IR with phi functions
  4. Optimizations - CSE, copy propagation, dead code elimination

The visualization shows the control flow graph with basic blocks connected by edges (fall-through and branch). Each block contains SSA instructions with unique IDs.


back to work