Skip to content

Divyanshu1998/opt-compiler

Repository files navigation

opt-compiler

It demonstrates how modern compiler optimizations can be applied step by step on an intermediate representation (Three-Address Code).

The project is split into three phases (modules), each implemented as an independent component but designed to work together as a pipeline:

  1. three-address – Converts Java source into Three-Address Code (TACo), an intermediate representation commonly used in compilers.
  2. conditional-constant-propagation – Performs Conditional Constant Propagation (CCP) to evaluate expressions at compile-time and remove dead code.
  3. inlining – Applies Function Inlining to replace method calls with their body, reducing function call overhead and enabling further optimizations.

πŸš€ Features

  • Each optimization pass can be run independently or as part of the pipeline
  • Preserves individual repository history via git subtree
  • Built with Java 17 and standard compiler design techniques

πŸ› οΈ Technologies Used

  • Java 17
  • Compiler theory (Intermediate Representations, Data-flow Analysis, Optimization passes)

πŸ“‚ Project Structure

πŸ“Š Mermaid Diagram

flowchart LR
    A[Java Source Code] --> B[Three-Address Code]
    B --> C[Conditional Constant Propagation]
    C --> D[Function Inlining]
    D --> E[Optimized Code]


Loading

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages