[LLVMdev] Pass Scheduling Information without using opt

Devang Patel devang.patel at gmail.com
Mon Jul 27 10:38:04 PDT 2009


On Mon, Jul 27, 2009 at 1:43 AM, Ralf Karrenberg<Chareos at gmx.de> wrote:
> Here is some example code that describes what I am doing:
>
> MyPass : ModulePass {
>
> bool runOnModule(mod) {
>
> for some Functions f in mod {
> (do some stuff)
>
> ExistingModuleProvider mp(mod);
> FunctionPassManager* fpm =
> new FunctionPassManager(&mp);

I think creating a new Function Pass Manager inside a module pass is
not ideal, however...

>
> fpm->add(createLowerSwitchesPass());
> fpm->add(createBreakCriticalEdgesPass());
> fpm->add(createLoopSimplifyPass());
>
> fpm2->run(*f);
>
> mp.releaseModule();
>
> (do more stuff)
> }
>
> }
>
> }
>
>
> Now what I want to have is some runtime-output of the pass manager that
> tells me what passes were run in what order, give me timing information
> if possible etc.

You can set global PassDebugging enum. The pass manager will print
useful info while it is running. See initial part of
VMCore/PassManager.cpp for more information on PassDebugging enum.

-
Devang



More information about the llvm-dev mailing list