[LLVMdev] RFC: Pass Manager Redux

dag at cray.com dag at cray.com
Wed Jul 11 08:59:32 PDT 2012


Duncan Sands <baldrick at free.fr> writes:

> Two get the previous scheduling, you would create a function pass manager FPM,
> which would itself be a function pass, and add FP1 and FP2 to FPM.  When FPM
> is run on a function, what it would do is: run FP1 on the function, then run
> FP2 on the function.  Scheduling FPM, which would act as a module pass, would
> thus do: for each function F, run FPM on it.  I.e. this would do: for each
> function F, run FP1 on F then run FP2 on F.  In short, you can easily implement
> the current behaviour in a simple, natural and explicit way.

I like this very much.  The current system is overly complex and often
results in puzzling runtime errors if the module/function pass
separation is not respected.

One thing I have wanted very much is to run some function-level passes,
then some module-level passes and then some more function-level passes.
It sounds like this new scheme will make that easier.

It's a pity this won't cover pass registration because that is also
overly complex, IMHO, both for the initial coding (specifying passes in
multiple places) and for debugging (figuring out why a pass didn't run).
It's all a bit too C++-magical for me.

But one thing at a time.  :)

                              -Dave



More information about the llvm-dev mailing list