[LLVMdev] [global-isel] Simplifying the simplifier

Jakob Stoklund Olesen stoklund at 2pi.dk
Fri Aug 9 13:55:48 PDT 2013


On Aug 8, 2013, at 4:59 PM, Hal Finkel <hfinkel at anl.gov> wrote:

> ----- Original Message -----
> [snip]
> 
>> 
>> DAGCombine is supposed to clean up legalization products, but today
>> it seems to be accumulating some transformations that probably
>> belong in InstCombine. Since it is running so late in the pass
>> pipeline, its canonicalizing approach is causing problems for
>> targets that are trying to arrange the IR optimally. Optimal and
>> canonical are not always the same thing.
>> 
>> Can we get away with a gentler instruction simplifier that is more
>> focused at cleaning up after legalization?
> 
> From what I've observed, there tends to be a lot to cleanup after legalization, especially because of the complexity of expanding GEP and all kinds of vector operations. Can you provide some examples of simplifications in DAGCombine that you think that we won't need with this new infrastructure?

There is no doubt that we need a lot of cleanup after legalization.

The problem is with the approach taken by DAGCombine which is a canonicalizer more than it is an optimizer. Specifically, it will reassociate expressions without achieving anything by the transformation.

LSR is sometimes trying to make code look right for post-increment addressing mode patterns, but DAGCombine messes things up before the instruction selector gets to see them.

Thanks
/jakob



More information about the llvm-dev mailing list