- Get LoopInfo for the function.
- Given an SCC, take one random block of it. Then, call getLoopFor() with
that block.
If we don't get a loop back, then this SCC is definitely not a loop.
- Otherwise, we compare the size of the SCC with that of the loop and there
are 3 cases:
- They're equal: this SCC is a loop.
- The SCC is smaller: This SCC is not a loop because getLoopFor() gives
the innermost loop. So, if this is smaller, it is an SCC inside a loop.
- The SCC is bigger: In that case, we can't decide since let's say the
SCC has blocks A, B, C. And the loop has blocks A, B. But blocks A, B, C
might also make a loop. However, since getLoopFor() gives us the
innermost loop, it will give us A, B. So, in that case, use
getParentLoop() repeatedly and repeat the procedure for the parent loops.