MCPcopy Create free account
hub / github.com/python/mypy / analyze_live_regs

Function analyze_live_regs

mypyc/analysis/dataflow.py:505–518  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

503
504
505def 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

Callers 2

insert_ref_count_opcodesFunction · 0.90
insert_spillsFunction · 0.90

Calls 3

run_analysisFunction · 0.85
LivenessVisitorClass · 0.85
setClass · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…