Monday, June 1, 2009

What to do next?

I'm now studying how to transform a representation from SSA to SSI. My approach will be to transform on demand. So not all the code will be in SSI, just the variables asked to be transformed by a client.

So a client will request to transform one variable, lets call it A. The Pass will run through each use of that variable A and will see if it is used in any branch. In case it is used in a branch, we will include a copy instruction like A = A in all basic blocks that succeeds the branch.

This approach will break the SSA IR for the moment. But now to construct SSI, we need to use the same SSA algorithm in variable A, thus changing all copy instructions inserted before to Ai = A, and inserting phi functions when necessary. This will bring the IR back to SSA, and variable A will be in SSI.

No comments:

Post a Comment