At the moment, LoopAccessAnalysis is a loop analysis for the new pass
manager. The issue with that is that LAI caches SCEV expressions and
modifications in a loop may impact SCEV expressions in other loops, but
we do not have a convenient way to invalidate LAI for other loops
withing a loop pipeline.
To avoid this issue, turn it into a function analysis which returns a
manager object that keeps track of the individual LAI objects per loop.
Fixes #50940.
Fixes #51669.
With this addition, could you drop the function pointer passed in all the passes and update the APIs to take LAIs instead? And call getInfo() internally when doing the processing on loops?
I know it means more changes, but I think the cleanup makes sense (unless I'm missing something). Ok to do as follow up NFC.