LUND UNIVERSITY
Department of Computer Science
Lab 2, Optimizing Compilers, EDAN75
You should try to implement as much of Lab 2 as possible before going to the lab. It is difficult to implement it all during the lab session.
The purpose of this lab is to study translation to and from SSA form.
- Hints!
- What is the definition of dominance frontier?
- Implement the function df in the file ssa.c, i.e.
Algorithm 2.10 on page 97.
- Implement the function rename_symbols in the file ssa.c, i.e.
the procedure search in Algorithm 4.5 on page 134. Useful functions:
is_sym(op_t op)
- op.c
is_label(op_t op)
- op.c
temp()
- op.c
defined_sym(stmt_t* stmt)
- stmt.c
- Implement the technique to do copy propagation during renaming, i.e., for
an assignment:
a = b;
push the current value of b on the stack of a.
Do not implement Algorithm 5.1 in Lab 2!
Compare the values of C (clock cycles) printed by vcc with and without SSA form, and with and without copy propagation.
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.
☃
Tue Sep 22 14:11:03 CEST 2020
☃