我的SSA构造正确吗? (重命名) [英] Is my construction of SSA correct? (Renaming)
问题描述
我一直在学习ssa(静态单分配形式),并且获得了以下插入了phi函数的图,但是该图尚未重命名:
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:
< a href = https://i.stack.imgur.com/Q0jcA.png rel = nofollow noreferrer>
我不得不重命名变量,这就是我得到的:
I had to rename the variables, and this is what I got:
我非常不确定这是正确的。我是否正确重命名了变量?这是最小的ssa吗?我正在此处(Cytron等人的论文)来重命名变量。请帮忙! :)
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! :)
推荐答案
不,您的图形不正确。 x
和 y
的phi函数和重命名是正确的,问题是临时变量 t1
到 t3
。当输入块 L1
时,这些变量将失效,并且根本不需要任何phi函数。如果您坚持要这些变量使用phi函数,则必须假定变量存在,并且在输入图形时具有som不确定的值。令 t1_0
, t2_0
和 t3_0
为这些值并更新重命名的图形相应。
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.
这篇关于我的SSA构造正确吗? (重命名)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!