![]() | ![]() | ![]() | Live "variable" analysis |
< p1 > x := exp < p2 >
LIVE(p1) = LIVE(p2) + use(exp) - kill(exp)
< p0 > | if exp | then | < p1 > stmt1 < p3 > | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
else | < p2 > stmt2 < p4 > | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
end < p5 > |
LIVE( p0 ) = LIVE( p1 ) + LIVE( p2 ) + use(exp)
LIVE( p3 ) = LIVE( p4 ) = LIVE( p5 )
< p0 > | while | exp do | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
< p1 > stmt < p2 > | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
end < p3 > |
LIVE( p0 ) = LIVE( p1 ) + LIVE( p3 ) + use( exp )
LIVE( p2 ) = LIVE( p0 )
So, the "liveness" information gives you what is needed to build an interference graph and do temporary (i.e. register) allocation.
These categories are used to partition data-flow analysis problems into four groups (of which you have seen everything but a backwards-must example).
![]() | ![]() | ![]() | Live "variable" analysis |