Is my construction of SSA correct? (Renaming)

吃可爱长大的小学妹 提交于 2020-08-10 18:54:52

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!