Loop Info Stability

I have an analysis pass which uses Scalar Evolution information. My pass
implements getAnalysisUsage as:

    virtual void getAnalysisUsage(AnalysisUsage &AU) const {

However, I am seeing cases where I'm getting bogus Loop data. That is,
the Loop object seems to be corrupted (empty block lists, etc.).

At first my pass was a LoopPass because I really only care about the
analysis within loops. But I thought maybe that's not really correct so I
made it a FunctionPass. No go, I still see the same issue.

The corruption happens during the running of the analysis itself.

Is there something tricky about the way LoopInfo or SCEV is preserved/not


If you are not manipulating loop nest (i.e. not creating/deleting loops) and maintaing loop structure in your pass then there is nothing tricky about LoopInfo.