https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90594
--- Comment #2 from Richard Biener <rguenth at gcc dot gnu.org> --- For example DCE could, when it comes to marking a loop-closed PHI node necessary see if it can replace it by computing the final value and if so do _not_ mark its definition necessary (and record this somewhere). If at the end the definition did not become necessary we will remove it and replace the LC PHI with the final value computation. If not then we keep the loop-closed PHI. We already perform similar tricks for eliding malloc/free pairs for example. IVOPTs would be another candidate which could disregard some IV uses if it can replace them via a final value.