Live-variable analysis: Difference between revisions

Content deleted Content added
Ramunasg (talk | contribs)
typo
Refer to code lines in a consistent way. Also, make the second part a little bit easier to understand.
Line 8:
a = f(b * c)
 
The set of live variables between lines two2 and three3 is {<code>b</code>, <code>c</code>} because both are used in the multiplication on line 3. But the set of live variables after line {{code|L1}}1 is only {<code>b</code>}, since variable <code>c</code> is updated later, inon {{code|L2}}line 2. The value of variable <code>a</code> is not used in this code.
 
Note that <code>f</code> may have side effects (printing <code>b * c</code>, perhaps), so the assignment to <code>a</code> may be eliminated as a is not used later, but there is insufficient information to justify removing all of line 3 as <code>L3f</code> may have side effects (printing <code>b * c</code>, perhaps).
 
== Expression in terms of dataflow equations ==