[LLVMdev] llvm passes

Chris Lattner sabre at nondot.org
Mon Sep 25 13:35:16 PDT 2006

On Mon, 25 Sep 2006, Ryan M. Lefever wrote:
> So, am I correct that the implication of what you're saying is that if
> pass X requires pass Y, then pass Y does not necessarily run to
> completion on every component of a program, before pass X runs.


> Furthermore, if those passes X and Y are both function passes, then when
> pass X runs on function F, the last function Y will have run on is
> function F.

Please read:


> Chris Lattner wrote:
>> On Fri, 22 Sep 2006, Ryan M. Lefever wrote:
>> Imagine you have a functionpass X, for example DominatorSet.  DominatorSet
>> runs on a function at a time and captures information about the current
>> function's dominator information in its instance variables.
>> Now you have ModulePass Y that runs and requires X to be run.  Because it
>> is a functionpass, X will be run on every function in the module before Y
>> starts.  Further, because X only has one set of instance variables, Y
>> could see, at most, information for one function.
> I assumed that X would run to completion before pass Y ran and that pass
> X would have stored instance data for each function in some sort of list
> or map.  I think my confusion must be with what type of pass to use.  Am
> I correct that if I have a pass M that runs on each function but needs
> to collect data from every function before it can be used by another
> pass N, then M should be a ModulePass?
> Regards,
> Ryan
>> -Chris



More information about the llvm-dev mailing list