[LLVMdev] Optimization passes organization and tradeoffs

Nicolas Capens nicolas at capens.net
Wed May 21 14:09:35 PDT 2008


Hi David,

Thanks for the info, but I'm not using any of the command line options. I'm
dynamically generating code at run-time. So unless I'm missing some way to
set these command line options at run-time I think I need another API for
controlling register allocation and scheduling.

I was also under the impression that linear scan register allocation is
quite cheap, faster than graph coloring. Or does it use an advanced
variation (with aggressive coalescing), while other register allocation
algorithms are more straightforward?

Cheers,

Nicolas


-----Original Message-----
From: David Greene [mailto:dag at cray.com] 
Sent: Wednesday, 21 May, 2008 18:57
To: Nicolas Capens
Subject: Re: [LLVMdev] Optimization passes organization and tradeoffs

On Wednesday 21 May 2008 04:01, you wrote:
> Thanks for the clarifications David!
>
> My main target is x86. How do I control register allocation and
scheduling?
> The docs talk about IR level optimization passes only (as far as I found).

There's a -regalloc option to pick from various register allocators.  Linear
scan is the most effective but also the most expensive.

-pre-RA-sched is the option to select schedulers.  By default LLVM schedules
to reduce register pressure.

You can run opt -help and opt -help-hidden to see what available.

                                             -Dave




More information about the llvm-dev mailing list