This is a C-like language compiler just for researching and studying data flow analysis and backend optimization. It combines so many features derived from Java and C rather than excluding many complicated type declaration from C language and class supported from Java.
The purpose of this design is that minimizing labor-consuming of front-end, and takes attention to IR's designing and TAC data flow analysis, further, making use of the
advanced features of modern processor, like ILP (Instruction-level parallel), SIMD instruction, multi-level cache etc, in the future.
First, The scanner and parser have finished for C-like language, in the same time, there are other works involved, like semantic analysis that consists of type checking and etc.
Then, HIR(High level Intermediate Representation) have been generated by HIRGenerator class, and large amount of machine-independence optimization have been performed in HIR.
Last, we design a LIR(Low Immediate Representation) elaborative which is simpler variant of LIR of Java HotSpot VM, and designated easily to operating upon it. Furthermore, the purpose of designation of LIR is for register allocation. Currently, there are two mainstream register allocation approaches yet, linear scanning or graph coloring. For sake of simple and easy to implement, the linear scanning regsiter allocation was chosen for us and we implement it.
In this compiler for studying, the optimization is the main point, consequently, Constant folding have been down well and constant propagation as subtask. In the same time, the introduction of Strength reduction is appropriate. Then Dead Code Elimination should not be ignoreed which performed in HIR by taking advantage of sparse traits of HIR in SSA form for reducing the cost of time and space. Also, Useless Control Flow Elimination is desired according to Keith D. Cooper & Linda Torczon. Moreover, Global Common Subexpression Elimination should be involved in the modern compiler, so it have been accomplished througth Global Value Numbering which references to HotSpot Client Compiler.
##Future We will accomplish a x86 assembler based JIT compiler in simpler level instead of high performance to avoid greatly complexity, since lack of sufficient time.