Problem in accessing Loops in other Functions Problem in accessing Loops in other Functions problem in accessing the Loops in other functions

Hi,
I am using Loop pass ( runOnLoop() function )
In this function I want to access all the Loops in all the functions in the current Module

the LoopInfo Pass only gives the Loops in the function where the current Loop resides :frowning:

Is there any other Pass by which I can access the Loops in others functions as well ?

…
Regards,
Shanmukha Rao

Hi,
I am using Loop pass ( runOnLoop() function )
In this function I want to access all the Loops in all the functions in the current Module

the LoopInfo Pass only gives the Loops in the function where the current Loop resides :frowning:

Is there any other Pass by which I can access the Loops in others functions as well ?

I assume you’re using a FunctionPass to do your analysis or optimization. Try writing your pass as a ModulePass instead; a FunctionPass should only operate on code within the function that it is analyzing/modifying.

– John T.

I am using LoopPass because I need the LoopDependence analysis which seems
to work with only LoopPass