(ir: FuncIR, env: ClassIR)
| 20 | |
| 21 | |
| 22 | def 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 | |
| 34 | def spill_regs( |
no test coverage detected
searching dependent graphs…