[llvm-commits] [llvm] r167758 - /llvm/trunk/lib/CodeGen/RegisterCoalescer.cpp

Jakob Stoklund Olesen stoklund at 2pi.dk
Mon Nov 12 16:51:48 PST 2012


On Nov 12, 2012, at 3:45 PM, Andrew Trick <atrick at apple.com> wrote:

> 
> On Nov 12, 2012, at 2:25 PM, Jakob Stoklund Olesen <stoklund at 2pi.dk> wrote:
> 
>> 
>> On Nov 12, 2012, at 1:42 PM, Andrew Trick <atrick at apple.com> wrote:
>> 
>>> +// Return true if this block should be vacated by the coalescer to eliminate
>>> +// branches. The important cases to handle in the coalescer are critical edges
>>> +// split during phi elimination which contain only copies. Simple blocks that
>>> +// contain non-branches should also be vacated, but this can be handled by an
>>> +// earlier pass similar to early if-conversion.
>> 
>> You probably don't want to do this for critical edges entering and exiting loops.
> 
> Ahh... I think what you're saying is that it would be nice to give the splitter a place to (re)insert copies since it doesn't try to split edges. I'll benchmark it.
> 
> Incidentally, the main problem I have with making the coalescer more aggressive is that the splitter can't seem to recover and we end up with more spills around complex control flow. I'm just guessing it's because we have less split edges but still need to verify.

The 'unsplitting' of critical edges doesn't actually happen during RegisterCoalescing.cpp. It only happens when BranchFolding runs after register allocation. The critical edge blocks are still available to live range splitting whether RegisterCoalescer clears them out or not.

/jakob



More information about the llvm-commits mailing list