UCLA CS 232 Static Program Analysis Spring 2006
Homework 1
-
The goal of the homework is to write a competitive register allocator
and report on its performance on a suite of C programs.
-
You can work in groups of one or two.
-
Use RALF and program the register allocator
in any language of your choice.
RALF is based on gcc 2.95 which compiles to a StrongARM with 12 registers.
We have a StrongARM that you can use for experiments:
ssh to root@gayatri (ask me for the password).
You can also use your own StrongARM, if you have one.
-
The register allocator should use the basic strategy given in
the paper by
Fernando Magno Quintao Pereira and Jens Palsberg:
Register Allocation Via Coloring of Chordal Graphs
,
APLAS 2005: 315-329.
The strategy uses Maximum Cardinality Search (MCS) and Greedy Coloring
plus heuristics for spilling and coalescing.
Your task is to first implement MCS and Greedy Coloring and then
experiment with different heuristics for spilling and eventually
find a heuristics which works particularly well for the suite of C programs.
-
Submit a report [by email to Jens Palsberg (palsberg@ucla.edu)] which
-
details your implementation strategy,
-
reports on the time to do register allocation for each of the C programs,
-
for each of the C programs:
compares the execution time of the code generated by gcc versus code generated by RALF
with your register allocator, and
-
for each of the C programs: gives the total number of spills,
as a sum over all functions in the program.
- Prepare to show a demo of your register allocator.
- Ask Fernando Pereira if you have questions about RALF.