Running non-LCSSA-preserving loop-simplify followed by LoopSimplify on (roughly) the same loop is incorrect, since LoopSimplify may break LCSSA arbitrarily higher in the loop nest.
Instead, run LCSSA first, and then run LCSSA-perserving LoopSimplify on the result.
This fixes PR31718.