Problem scheduling a ModulePass which requires LoopInfo.

Hello,

I am trying to use the LLVM pass registry to schedule a Module pass. This pass requires one analysis ( LoopInfo ).

But as soon as the AU.addRequired() method executes I get the following error:

Unable to schedule ‘Natural Loop Information’ required by ‘MyPass.’
Unable to schedule pass
UNREACHABLE executed at /…/llvm/lib/IR/PassManager.cpp:1250!

… … …

In the pass code I also have the following code:
… … …
INITIALIZE_PASS_BEGIN(MyPass,“MyPass”,“MyPass.”, false, false)
INITIALIZE_PASS_DEPENDENCY(LoopInfo)
INITIALIZE_PASS_END(MyPass,“MyPass”,“MyPass.”, false, false)
… … …

For what I understood, the PassManager request another PassManager for the lower level function analysis (In this case LoopInfo). And no one is able to answer to that request.

Thanks,