complement in 11.13
This commit is contained in:
34
notes/8.md
34
notes/8.md
@@ -64,4 +64,36 @@ Analysis of Reaching Definition
|
||||
|
||||
Effect of an Instruction
|
||||
|
||||
`IN[b]` and `OUT[b]`
|
||||
`IN[b]` and `OUT[b]`
|
||||
|
||||
Meet Operator
|
||||
|
||||
`IN[b] = union(OUT[p1]...OUT[pn])`
|
||||
|
||||
```c
|
||||
// init
|
||||
OUT[entry] = {}
|
||||
|
||||
|
||||
|
||||
```
|
||||
|
||||
## Liveness Analysis
|
||||
|
||||
Liveness is the concept the variable is used in the future. It helps **eliminating dead code**.
|
||||
|
||||
Transfer function
|
||||
|
||||
* `USE[b]` set of variables used in `b`
|
||||
* `DEF[b]` set of variables defined in `b`
|
||||
|
||||
so transfer function `f_b` for a basic block b:
|
||||
```IN[b] = USE[b] + (OUT[b] - DEF[b])```
|
||||
|
||||
for reaching defintion
|
||||
|
||||
```OUT[b] = union(INs)```
|
||||
|
||||
For supporting cyclic graphs, repeated computation is needed.
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user