Use-define Chain - Purpose

Purpose

Making the use-define or define-use chains is a step in liveness analysis, so that logical representations of all the variables can be identified and tracked through the code.

Consider the following snippet of code:

int x = 0; /* A */ x = x + y; /* B */ /* 1, some uses of x */ x = 35; /* C */ /* 2, some more uses of x */

Notice that x is assigned a value at three points (marked A, B, and C). However, at the point marked "1", the use-def chain for x should indicate that its current value must have come from line B (and its value at line B must have come from line A). Contrariwise, at the point marked "2", the use-def chain for x indicates that its current value must have come from line C. Since the value of the x in block 2 does not depend on any definitions in block 1 or earlier, x might as well be a different variable there; practically speaking, it is a different variable — call it x2.

int x = 0; /* A */ x = x + y; /* B */ /* 1, some uses of x */ int x2 = 35; /* C */ /* 2, some uses of x2 */

The process of splitting x into two separate variables is called live range splitting. See also static single assignment form.

Read more about this topic:  Use-define Chain

Famous quotes containing the word purpose:

    I am firmly opposed to the government entering into any business the major purpose of which is competition with our citizens ... for the Federal Government deliberately to go out to build up and expand ... a power and manufacturing business is to break down the initiative and enterprise of the American people; it is the destruction of equality of opportunity amongst our people, it is the negation of the ideals upon which our civilization has been based.
    Herbert Hoover (1874–1964)

    I have no purpose to introduce political and social equality between the white and black races. There is a physical difference between the two, which, in my judgement, will probably for ever forbid their living together upon the footing of perfect equality; and inasmuch as it becomes a necessity that there must be a difference, I ... am in favour of the race to which I belong having the superior position.
    Abraham Lincoln (1809–1865)

    The purpose of polite behavior is never virtuous. Deceit, surrender, and concealment: these are not virtues. The goal of the mannerly is comfort, per se.
    June Jordan (b. 1939)