The Sub.compute_liveness function was accidentally published in #1051 without consideration that it works only for the non-SSA form. This PR fixes this by updating the algorithm to handle the SSA form as well.
The semantics of phi nodes modulo liveness is the following. For a phi-node at block b0, x0 := phi([b1,x1; b2,x2;...;bN,xN]), the defined variable x0 is considered to be at the entry of b0, i.e., x0 is live-in of b0, and the variable xi is live-out of basic block bi, for i > 0.
Informally, a phi-node defines the values on the corresponding edges of the predecessors.
The
Sub.compute_liveness
function was accidentally published in #1051 without consideration that it works only for the non-SSA form. This PR fixes this by updating the algorithm to handle the SSA form as well.The semantics of phi nodes modulo liveness is the following. For a phi-node at block
b0
,x0 := phi([b1,x1; b2,x2;...;bN,xN])
, the defined variablex0
is considered to be at the entry ofb0
, i.e.,x0
is live-in ofb0
, and the variablexi
is live-out of basic blockbi
, fori > 0
.Informally, a phi-node defines the values on the corresponding edges of the predecessors.