[LLVMdev] [patch] Pluggable Coalescers

David Greene dag at cray.com
Tue Aug 28 08:59:00 PDT 2007


On Monday 27 August 2007 19:02, Evan Cheng wrote:

> > interfere() isn't sufficient because the allocation algorithm may
> > place other
> > constraints on coalescing.  George and Appel's iterated register
> > coalescing
> > is a prime example.  It wants to "freeze" copies that should not be
> > coalesced
> > because doing so might cause spilling.  You don't want the coalescer
> > touching
> > these because if it does the data structures will be inconsistent.
>
> Ok. But that means this method doesn't belong to the InterferenceData
> class. Shouldn't the allocator query the coalescer instead?

No, it's the other way around.  The coalescer needs to decide whether it can
coalesce something.  It must ask the allocator if it's ok.

This is part of InterferenceData to decouple the coalescer from the allocator
so the coalescer doesn't have to keep a pointer to the allocator.  In my
current implementation, InterferenceData for the graph coloring allocator
has references to all of the necessary information to return an answer to
this question.

                                                       -Dave



More information about the llvm-dev mailing list