Live-variable analysis: Difference between revisions

Content deleted Content added
mistake in the table
HLwiKi (talk | contribs)
No edit summary
Line 6:
 
<table>
<tr>
<td>
The set of live variables at line 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 L1 is
only {<code>b</code>} since variable <code>c</code> is updated in line 2. The value of variable <code>a</code> is never used,
so the variable is never live. 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>.
</td>
 
<td>
<code>
L1: b := 3;
Line 14 ⟶ 21:
</code>
</td>
</td></tr>
 
<td>
The set of live variables at line 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 L1 is
only {<code>b</code>} since variable <code>c</code> is updated in line 2. The value of variable <code>a</code> is never used,
so the variable is never live. 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>.
</td></tr>
</table>