The purpose of this lab is to study translation to and from SSA form.
Hints!
Use join_set to add something to a set.
To walk through a set (eg the dominance frontier of w, w->df), do as follows:
bb_t** a;
int n;
...
a = set_to_array(w->df, &n);
for (i = 0; i < n; i++) {
use a[i] here
}
free(a);
What is the definition of dominance frontier?
Implement the function df in the file ssa.c, i.e.
Algorithm 3.4 on page 108.
Implement the function rename_symbols in the file ssa.c, i.e.
the procedure search in Algorithm 3.6 on page 113.
Implement the technique to do copy propagation during renaming, described
on page 135 in the third sentence starting with "When the statement is a copy...".
Do not implement Algorithm 5.1 in Lab 2.
Requirements for the Lab
When you have performed the tasks above, contact your teacher and then
you will discuss what you have learnt during the lab.