问题
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:
I had to rename the variables, and this is what I got:
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! :)
回答1:
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.
来源:https://stackoverflow.com/questions/62984347/is-my-construction-of-ssa-correct-renaming