MCPcopy Index your code
hub / github.com/python/mypy / insert_spills

Function insert_spills

mypyc/transform/spill.py:22–31  ·  view source on GitHub ↗
(ir: FuncIR, env: ClassIR)

Source from the content-addressed store, hash-verified

20
21
22def insert_spills(ir: FuncIR, env: ClassIR) -> None:
23 cfg = get_cfg(ir.blocks, use_yields=True)
24 live = analyze_live_regs(ir.blocks, cfg)
25 entry_live = live.before[ir.blocks[0], 0]
26
27 entry_live = {op for op in entry_live if not (isinstance(op, Register) and op.is_arg)}
28 # TODO: Actually for now, no Registers at all -- we keep the manual spills
29 entry_live = {op for op in entry_live if not isinstance(op, Register)}
30
31 ir.blocks = spill_regs(ir.blocks, env, entry_live, live, ir.arg_regs[0])
32
33
34def spill_regs(

Callers 1

compile_scc_to_irFunction · 0.90

Calls 4

get_cfgFunction · 0.90
analyze_live_regsFunction · 0.90
isinstanceFunction · 0.85
spill_regsFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…