Live-variable analysis: Difference between revisions

Content deleted Content added
AnomieBOT (talk | contribs)
m Dating maintenance tags: {{Elucidate}} {{Clarify}}
m Example: -<code>
Line 8:
== Example ==
{| class="floatright"
|
|<code>
L1: b := 3;
L2: c := 5;
L3: a := f(b + c);
goto L1;
</code>
|}
The set of live variables at line {{code|L3}} is {<code>b</code>, <code>c</code>} because both are used in the addition, and thereby the call to <code>f</code> and assignment to <code>a</code>. But the set of live variables at line {{code|L1}} is
only {<code>b</code>} since variable <code>c</code> is updated in {{code|L2}}. The value of variable <code>a</code> is never used. Note that <code>f</code> may be stateful, so the never-live assignment to <code>a</code> can be eliminated, but there is insufficient information to rule on the entirety of <code>L3</code>.
 
== Expression in terms of dataflow equations ==