Deadline: 1pm, Wednesday, November 21, 2007
In this class, you have been writing the compiler for a toy programming language, TL07. The first extra credit part is to add a compiler pass to convert your three-address ILOC code into Static Single Assingment (SSA) Form and a second pass to convert it back into non-SSA three-address ILOC code.
The SSA roundtrip may be always on or implmented as an optional compiler feature enabled by a command-line switch. Providing a command-line switch that will allow the rest of the compiler to be tested/graded independently of the SSA conversion in the case of bugs in the SSA implementation. When SSA is active, the compiler should additionally output a Graphviz file containing a control flow graph whose nodes are labelled with SSA instructions (named basename.ssa.dot), and a graphviz file containing a control flow graph whose nodes are labelled with the three-address ILOC instructions after translation from SSA (named basename.cfg2.dot).
There are several published algorithms for translation into SSA, and you may use any one of several methods:
Translation out of SSA form should pay careful attention to semantics of the $phi;-functions, especially their "simultaneous" execution, which leads to the swap problem (Cooper 9.3.5). Morgan's "Building an Optimizing Compiler" has a detailed algorithm for handling this. Contact the instructor if you're interested.
Please include the extra credit as part of your 10/31 or 11/21 project submission, following the revised packaging and submission instructions.
Up to 10 points (equivalent to 15 midterm exam points) may be earned by completing this extra credit. Points will be awarded on the basis of correctness and completeness. For full credit it is necessary to correctly implement an algorithm that produces minimal, semi-pruned, or pruned SSA form and correctly implement translation out of SSA.
There may need to be corrections, clarifications, or other modifications to these instructions, you are responsible for monitoring the class web site, monitoring your CS account mailboxes, and listening during lecture for announcements related to this assignment.