1 / 10

CSE 504-Compiler Project

CSE 504-Compiler Project. Group: 05 Supreet Padhi Aman Jain Duckjin Kang Wai -kit Sze Mandeep Singh. Lexical Analysis + Syntax Analysis. Event matcher DFA generation. AST generation + Type Checker. High level code optimizer. Intermediate code generator. Intermediate code optimizer.

makya
Download Presentation

CSE 504-Compiler Project

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. CSE 504-Compiler Project Group: 05 Supreet Padhi Aman Jain Duckjin Kang Wai-kit Sze Mandeep Singh

  2. Lexical Analysis + Syntax Analysis Event matcher DFA generation AST generation + Type Checker High level code optimizer Intermediate code generator Intermediate code optimizer Abstract machine code generator TypeChecker High Level Optimization 3-Address Code Intermediate Code Optimization Peephole Optimzation Machine Independent Optimization Final Code Generation

  3. TypeChecker/AST Changes • Type checker as per specification provided • Changes to AST • addition for while, break and print statements • Detecting recursion in functions

  4. High Level Optimization • Function Inlining • Criteria - # of statements <=5 • Can be improved to dynamic factor • Loop Invariant Motion • Assignments in a loop which are independent of the loop variables are moved outside.

  5. 3-Address Code

  6. Final code generation • Instruction selection • Professor’s abstract code • Check type to select instruction • Register allocation • Procedure call support • Activation records • Save/restore register (caller) • Memory management • Use stack and registers only • No dynamic, static memory allocation

  7. Intermediate Optimization • Within a basic block • Constant propagation • Static evaluation • Available expression • Across basic blocks (global optimization) • Live variable analysis for dead variable/code removal • Reachability definition for killing unused code • Jump threading optimization • Peephole optimization / Template based optimization • Removal of empty/unreachable basic blocks

  8. Event Matcher • Derivative technique to construct DFA. • Parameters are not handled. • O(1) time for transition based on table lookup.

  9. Abstract Machine Code Generator • Convert the 3 address code into the abstract machine code • Maintaining the stack for activation record

  10. Roles • Type Checker/AST/High level Optimiation • Supreet • 3-Address Code/System bring-up • Duckjin • Machine Code generation/Performance evaluation • Duckjin/Aman • Optimization • Peter/Mandeep • Event Matcher • Supreet/Peter

More Related