pub fn checkpoint_defs(prog: &CompiledProgram, budget: usize) -> HashSet<usize>Expand description
The recomputable-chain intermediates to KEEP as checkpoints (corner 2) — the budget nodes that
most shorten the reverse re-walk. An INTERMEDIATE is a recomputable node whose register is an input
to another recomputable def in the same frame (so it sits inside a chain, not at its top). We
checkpoint the intermediates CLOSEST to the chain tops (highest def_pc) first: keeping a node near
the top caps every above-it read at a re-walk of length 1, the largest marginal saving per pebble
(the Bennett “cache near the read” heuristic). budget = 0 ⇒ none (recompute everything).