[LLVMdev] Pluggable Register Coalescers

David Greene dag at cray.com
Wed Jul 11 11:39:48 PDT 2007


On Wednesday 11 July 2007 12:41, Tanya M. Lattner wrote:

> I think the coalescer should be flexible enough to be run independent of
> the register allocator. For example, you may want to expose the copies
> induced by transforming out of SSA to the scheduler. If the scheduler is
> run before register allocation, then you would want the coalescing to
> happen before as well.

I agree that we want to allow for this possibility, but there are some
coalescers that cannot run independent of the register allocator.
So how do we handle both?  If I as a user ask for a regalloc-dependent
coalescer, what should it do if someone tries to run it as an independent
pass?

It could provide a fallback, perhaps invoking the existing coalescer,
but that would cause coalescing the user might not want.

It could do nothing and count on the register allocator to run it at some
point, but not all register allocators will necessarily run a coalescing pass.

I agree with Evan that we don't want to strangle short-term gain, but these
are the kinds of questions we should keep in mind as we design interfaces.
Interfaces can always change later, of course, but it's good to get them as
right as possible initially.

                                                  -Dave




More information about the llvm-dev mailing list