Project6 - CSE 450 Project 6 Spring 2008 Objective Exercise strategies for optimizing and generating target code from three-address code

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
CSE 450 Project 6, Spring 2008 Objective: Exercise strategies for optimizing and generating target code from three-address code. Description: For this final project, you are to: use your compiler to generate three address code for the SpartanAda program in: /user/cse450/Public/Projects/P5/test27.adb and then take this output and translate it (by hand) into the target language described in the lecture notes of Monday, April 7th. We recommend you proceed as follows: First, run your compiler on the example program to generate the three-address code. Second, break the sequence of three-address code into basic blocks and perform liveness analysis on the flow graph of each subprogram (i.e., procedure reverse and the main body) to determine the sets of addresses that are live at the end of each basic block. If any compiler-generated temporaries are live on exit of any basic block, you will need to allocate space for them in the activation record, following the area used to represent local variables. Then, for each basic block you should: 1. optimize the code in that block by applying constant folding, copy propagation, common sub-expression elimination, and dead code elimination wherever possible. 2. translate the instructions in the block using the simple code-generation techniques we dis-
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 07/25/2008 for the course CSE 450 taught by Professor Stirewalt during the Spring '08 term at Michigan State University.

Page1 / 2

Project6 - CSE 450 Project 6 Spring 2008 Objective Exercise strategies for optimizing and generating target code from three-address code

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online