We're now defaulting to preserving LCSSA, with the NPM, so a couple of tests have changed slightly.
Seems this is an issue from LPM, but hardware loop insertion pass should preserve some other analysis as well, like ScalarEvolutionAnalysis, BranchProbabilityAnalysis, DependenceAnalysis and MemorySSAAnalysis (although there is no handling for it now, we may need pass it to InsertPreheaderForLoop if want to preserve this analysis)? I saw some other pass that calls InsertPreheaderForLoop but declare to preserve these analysis.
I can't say I understand the LPM, but we're not using it here, nor are we using MemorySSA or BranchProbability. So could you please explain why/what you'd like to see change here?
I think the pass should try its best to declare the preservation of analysis passes to avoid the analysis passes are run again unnecessarily. If we don't change BranchProbability or some other analysis pass results, we should better to declare it as preserved, otherwise later pass that depends on this analysis will have to rerun the analysis pass again? I think this is the reason why we return PreservedAnalyses::all() if the pass does not do any transformation.
I said the LPM because in the legacy pass implementation of hardware loop pass, it also preserves these two analysis DominatorTreeAnalysis and LoopAnalysis, so I thought you were implementing the same thing in NPM with the LPM?
Ah, sorry, for some reason I've always thought we can only 'preserve' anything that we directly use!
As for the LPM, I guess my ignorance continues... I don't think I'm using it? I thought this is just a port of a function pass into another function pass.
@samparker Good morning/afternoon from the UK :)
I believe this patch may have caused this following build bot to start failing:
The test is CodeGen/ARM/O3-pileline.ll
Are you able to take a look at it?
Thank you so much, this has been fixed mid-investigation, apologies for the unnecessary ping.