Convert the following code in Static single assignment form.
I think we just need to replace the second $x$ with $x_1 $. rest everything stays the same. I referred this nptel handout. http://nptel.ac.in/courses/106108052/module13/ssa-1.pdf
they are using a flow diagram representation for SSA. since the printed $x$ can be different depending on whether or not the if is taken, they are using a $ϕ$ function termed as special merge operator. it will take the appropriate value depending on the path of execution the program takes.so we will have to add a new line before the $print(x)$ as $x_2$=$ϕ(x,x_1)$ and we print $x_2$. this is what I understood.
64.3k questions
77.9k answers
244k comments
80.0k users