Could we perhaps do this only if `!Dead.empty()`, that is, if something was legalized? That would avoid calling it on functions which were not modified at all, which is probably most of them.