LLVM-Based Optimizing Compiler
Extended an LLVM-based teaching compiler from IR generation through control-flow analysis, SSA optimization, profile-guided live-range splitting, and graph-coloring register allocation.
Read project details +
I worked across abstract syntax trees, LLVM IR, control-flow graphs, SSA form, live intervals, and machine instructions. The project connected compiler theory with the practical work of safely updating LLVM values, uses, predecessors, phi nodes, and instruction ownership.
KEY IMPLEMENTATION
- Built loop peeling, instruction combining, constant folding, and algebraic simplification passes
- Implemented natural-loop detection and optimized edge profiling with a maximum spanning tree
- Created SSA phi insertion, cleanup, copy propagation, and dead-block removal
- Implemented speculative LICM and Chaitin-style graph-coloring allocation
Contribution note: Compiler infrastructure, pass skeletons, and tests were supplied. I implemented and debugged the analyses, transformations, profiling, optimizations, and allocator methods.