Number of loops in a region

Hi,

I was wondering if there is a way to count the number of loops contained in a region.

For example in a program like this:

Simone,

While not a complete solution, I believe the LoopInfo analysis pass will get you part of the way there.

-Josh