Calculate live registers at each CFG location. A register is live at a location if it can be read along some CFG path starting from the location.
(blocks: list[BasicBlock], cfg: CFG)
| 503 | |
| 504 | |
| 505 | def analyze_live_regs(blocks: list[BasicBlock], cfg: CFG) -> AnalysisResult[Value]: |
| 506 | """Calculate live registers at each CFG location. |
| 507 | |
| 508 | A register is live at a location if it can be read along some CFG path starting |
| 509 | from the location. |
| 510 | """ |
| 511 | return run_analysis( |
| 512 | blocks=blocks, |
| 513 | cfg=cfg, |
| 514 | gen_and_kill=LivenessVisitor(), |
| 515 | initial=set(), |
| 516 | backward=True, |
| 517 | kind=MAYBE_ANALYSIS, |
| 518 | ) |
| 519 | |
| 520 | |
| 521 | # Analysis kinds |
no test coverage detected
searching dependent graphs…