To simply put, Static Single Assignment is a modification of Three-Address Code, such that no temporaries are re-assignable.
PS: An address can be a:-
- name
- constant
- temporary variable generated by compiler.
It is common knowledge that $+$ and $-$ have equal priorities. And so do $*$ and $/$. And they both have left associativity to break the tie.
$$q+r/3+s−t∗5+u∗v/w $$
So, $r/3$ is done first. Then $t*5$... so on.
I'll use $a,b,c,d...$ for temporaries instead of $t_1,t_2...$ to avoid using subscripts repeatedly.
Here's, the $SSA$ code:
$a=r/3$
$b=t∗5$
$c=u∗v$
$d=c/w$
$e=q+a$
$f=e+s$
$g=f−b$
$h=g+d$
8 temporaries are used.