[CST-2] OptComp: Single Static Assignment Form
Hanna Wallach
hmw26@cam.ac.uk
Sun, 20 May 2001 13:02:47 +0100 (BST)
On Sun, 20 May 2001, M.Y.W.Y. Becker wrote:
> What is meant by "formal parameters" and "local variables"? Is that a
> question about the Phi-operator? In particular, what is the difference to
> question (a)?
Temporaries require no additional transformation to ensure that the are in
SSA form. This is because, when generating the 3-address code, the
assumption is made that every need for a temporary gets a new temporary
variable (and hence virtual register) allocated (at least before register
colouring).
To deal with non-address taken formal parameters and local variables, one
has to transform the program to SSA form.
> And the last part:
> "Commonly SSA form is discussed only for temporaries and non-address-taken
> local variables. To what extent is it possible to arrange that accesses to
> address-taken locals or statically allocated global variables can be
> transformed into SSA form? What effect might such a transformation have on
> register allocation of such variables?"
This is to do with the fact that construction of SSA form requires
knowledge of those variables modified and used by a statement. Therefore,
when dealing with global variables or parameters passed by reference, one
has to make the assumption that a call to a procedure may change any
global variable or parameter passed by reference, which limits the extent
to which transformations can be performed. A new virtual register must be
assigned for each global variable or address taken parameter prior to any
call to a procedure.
HTH,
--
Hanna \ /
<:><|||>==-
/ \