Skip to content

lemonidas/Alan-Compiler

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

38 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Alan Compiler
Project for Course: http://courses.softlab.ntua.gr/compilers/
Author: Lampropoulos Leonidas - 03107044

Compilation:
make depend
make

Basics:

Lexer:        Lexer.mll AlanString.ml
Parser:       Parser.mly
Semantic:     Semantic.ml
Intermediate: QuadTypes.ml Quads.ml
Final Code:   FinalTypes.ml Final.ml AlanString.ml

Optimizations:

Easy ones:
-Constant Folding (Deactivated)       : Optimizations.ml
-Reverse Copy Propagation             : Optimizations.ml
-Linear Unreachable Code Elimination  : CodeElimination.ml
-Jump Simplification                  : Optimizations.ml

Control Flow:
-Block Conversion                     : Blocks.ml
-Flowgraph creation                   : ControlFlow.ml
-Dominators (used for SSA)            : ControlFlow.ml
-Tail Recursion Elimination           : TailRecursion.ml
-Unreachable Code Elimination (flow)  : CodeElimination.ml

Data Flow:
-SSA (calculation of phi-points)      : SSA.ml (unused - UDChains used for CP instead)
-Copy Propagation                     : CopyPropagation.ml
-Reaching Definitions                 : UDChains.ml
-Dead Code Elimination                : DeadCodeElimination.ml
-Constant Propagation                 : ConstantPropagation.ml

Low Level:
-Consecutive Load/Store Deletions     : FinalOptimizations.ml

Other:
-Remove unused temporaries            : CodeElimination.ml
-Fixed point computation              : Main.ml (trivial)

Significant Changes:

-Added type to scope, library flag in functions
-Added hashtable field in functions to contain global use information
-Added special "TailCall" Quad
-Added live parameter list in par quad
-Changed the logic of intermediate code jump creation (see pdf readme...)
-Added pointer type to handle arrays more clearly
-Debug.ml contains flag declaration to enable debugging messages

For more information, AlanCompiler.pdf. (Turned out little longer than expected...)

About

NTUA - 8th Semester - Compilers

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages