Git Product home page Git Product logo

cc's Introduction

Overview

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.

Purpose

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.

Completed works

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.

Optimization Introduction

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.

cc's People

Stargazers

 avatar  avatar

Watchers

melbshark avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.