[LLVMdev] PassManager Error
David Greene
dag at cray.com
Fri Jul 27 15:39:27 PDT 2007
On Friday 27 July 2007 15:15, Devang Patel wrote:
> Now, if pass sequence is - ModuleLevelPass A, FunctionLevelPass B,
> ModuleLevelPass D, FunctionLevelPass C then
>
> For each Module
> run ModuleLevelPass A
> for each function in this module
> run FunctionLevelPass B
> run ModuleLevelPass D
> for each function in this module
> run FunctionLevelPass C
>
>
> In this situation, while processing 'foo' FunctionLevelPass C can not
> use analysis info generated by FunctionLevelPass B for 'foo'.
Why? I expect the answer is something like, "because B doesn't exist
anymore," or, "because you processed function 'bar' with B after 'foo.'"
But why? B doesn't _have_ to exist and it shouldn't necessarily matter
in what order PassManager processes functions. Only the information
that pass B generates for foo need exist.
If you're running module-level passes anyway, you're probably burning a bit
of memory to hold state, so maybe keeping around information for all functions
is feasible. I don't know.
Yes, I understand that these questions imply rethinking how PassManager
works. That's why I'm asking them. I reordered my code and got things to
work but it's always good to take a step back from time-to-time and ask
fundamental questions. Even if no changes are immediately forthcoming,
it at least helps to identify areas of potential future work.
-Dave
More information about the llvm-dev
mailing list