nir: Make algebraic backtrack and reprocess after a replacement.