CS 5363: TL07 Compiler Project, Extra Credit #3

Deadline: 1pm, Wednesday, November 21, 2007

Third Extra Credit Assignment, Register Allocation

Extra credit can be earned by replacing the dummy register allocator described in the instructions for part #4 with a proper register allocator. There are some options for how to go about this.

One option is to build a proper graph-coloring algorithm as described in the text book. This register allocation should analyze live ranges of virtual registers in the final MIPS code (Cooper 13.5.1), build an interference graph (Cooper 13.5.3), spill and color the live ranges according to a bottom-up Chaitin-Briggs graph coloring algorithm (Cooper 13.5.5). In order to avoid repeated coloring after spilling, you may reserve a couple registers for temporaries involved in the spill code. To receive the maximum amount of extra credit points, you must implement some kind of register coalescing (Cooper 13.5.6).

In addition, there are two recent alternatives: Pereira and Palsberg's algorithm and Brisk et al.'s algorithm. These takes advantage of the fact that many interference graphs (in particular those of programs in SSA form) are in fact chordal. The latter, may require combining the translation out of SSA (extra credit #1) and MIPS code generation (part #4) with register allocation; this is OK, but please include a description of what was done in the cover letter.

Deliverables and Submission

You may include these optimizations in your final submission for part #4. Please, include the following additional information in the cover letter for that assignment:

  1. the fact that you implemented a register allocator
  2. the register allocation algorithm used
  3. specify what spill metric you used and why you chose it
  4. any other enhancements you added to the base algorithm

Also make sure that your included test cases demonstrate and test your optimizations including the spilling of live ranges for which there are insufficient registers.

Grading Criteria

You may earn extra credit worth up to 10% of the total class grade by implementing a proper register allocator. To earn all 10 points, your register allocator should include support for coalescing live ranges.

Errata

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.