Adding a new incoming value the to LCSSA phi in the exit block requires invalidating SCEV for the phi. Add missing forgetLcssaPhiWithNewPredecessor, like ConnectProlog already does. Fixes https://github.com/llvm/llvm-project/issues/231756 PR: https://github.com/llvm/llvm-project/pull/234202 (cherry picked from commit 1782f9b2cef910440a06240f3bcc638bef981584)