Skip to content

Stop retaining old ModGuts throughout subsequent simplifier phases

Matthew Pickering requested to merge wip/simplifer-phase-leak into master

Each phase of the simplifier typically rewrites the majority of ModGuts, so we want to be able to release the old ModGuts as soon as possible.

name_ppr_ctxt lives throught the whole optimiser phase and it was retaining a reference to ModGuts, so we were failing to release the old ModGuts until the end of the phase (potentially doubling peak memory usage for that particular phase).

This was discovered using eras profiling (#24332 (closed))

Fixes #24328 (closed)

Merge request reports