complement in 11.13

This commit is contained in:
2025-11-13 10:10:10 +09:00
parent d39f272563
commit 807ac03a6e
3 changed files with 61 additions and 1 deletions

View File

@@ -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.