Sorry, I didn't notice that the legacy PM's getLoopAnalysisUsage() preserved some analyses.
I'm not super familiar with loop passes, but getLoopPassPreservedAnalyses() says
/// Returns the minimum set of Analyses that all loop passes must preserve.
so why wouldn't that apply here?
Good point, reading the code it looked like certain changes would affect the CFG and there were no DT or LI updates. Looking further, it looks like only instructions are added/updated, and not the BB, so it looks like we should use getLoopPassPreservedAnalyses here.
For the LPM, the above mustPreserveAnalysisID doesn't make sense to me if the pass already requires LCSSA in the getLoopAnalysisUsage call. It should always be true.