graphcompiler-constructioncompiler-optimizationcontrol-flow-graphssa

Is my construction of SSA correct? (Renaming)


I've been learning about ssa (static single assignment form), and I was given the following graph with phi functions inserted, but the graph hasn't been renamed:

The given ssa graph

I had to rename the variables, and this is what I got:

The ssa graph that I converted

I am very unsure that this is correct. Did I rename the variables correctly? Is this minimal ssa? I am using this algorithm from here (Cytron, et. al's paper) to rename the variables. Please help! :)


Solution

  • No, your graph is not correct. The phi-functions and renaming for x and y are correct, the problem is the temporary variables t1 through t3. These variable are dead when the block L1 is entered and does not require any phi-functions at all. If you insist on having phi-functions for these variables you must assume that the variables exist and have som indeterminate value when the graph is entered. Let t1_0, t2_0 and t3_0 be those values and update the renamed graph accordingly.