Live Range vs Reaching Definitions

In compiler data flow analysis, what is the difference between the range of a variable and the achievement of a definition? Both seem to refer to the same thing ...

+4
source share
2 answers

Theyre very different things, and I suggest you come back and re-read, no matter what concepts you are confused about. The achievable definition of a variable for a point that uses a given variable should be, among other things, the definition of that variable. The lifetime of a variable is part of the program in which it can be used, which includes things other than definitions, such as reading.

See, for example, The Dragon Book of 1986, pages 534 (perhaps too general to be useful) and 610.

+2
source

Achievement of definitions is determined in relation to a specific place in the program. For example, on line 10 with the code β€œa = b + c”, it is useful for the compiler to know what the definition of β€œc” is, or, in other words, to answer the question β€œin which statement does the variable c acquire a value that can reach line 10? "

The real-time range is determined by the variable. The direct range of the variable c begins with the definition of the variable c and goes until the next definition of the variable (in which the place is killed by the variable or defined as another variable if you use SSA) or the end of the region (block, function or program) in which the variable c exists.

Both concepts are similar, but they are not the same.

+3
source

All Articles