[PATCH] [SDAG] When performing post-legalize DAG combining, run the legalizer over each node in the worklist prior to combining.

Chandler Carruth chandlerc at google.com
Thu Jul 17 22:07:47 PDT 2014


If you want to dump the DAG after each iteration, we can add that, but
it'll be *noisy*.

But I'm not at all inclined to make this switch yet. Currently, I'm seeing
hundereds of test failures when i do all of the legalizing as part of the
combiner. I think a bunch of post legalization DAG combines were written to
only see legalized code, and vice versa. I'm going to keep poking it on the
back-burner, but it doesn't seem worth gating this on, and gating making
the rules for post-legalization combines less onerous in general.


On Thu, Jul 17, 2014 at 10:51 PM, Tom Stellard <tom at stellard.net> wrote:

> On Thu, Jul 17, 2014 at 03:15:33PM -0400, Chandler Carruth wrote:
> > On Thu, Jul 17, 2014 at 3:11 PM, Tom Stellard <tom at stellard.net> wrote:
> >
> > > On Thu, Jul 17, 2014 at 04:55:00PM +0000, Chandler Carruth wrote:
> > > > Hi hfinkel, grosbach,
> > > >
> > > > This allows the combiner to produce new nodes which need to go back
> > > > through legalization. This is particularly useful when generating
> > > > operands to target specific nodes in a post-legalize DAG combine
> where
> > > > the operands are significantly easier to express as pre-legalized
> > > > operations. My immediate use case will be PSHUFB formation where we
> need
> > > > to build a constant shuffle mask with a build_vector node.
> > > >
> > >
> > > Since the post-legalize DAG combiner is now doing combining and
> > > legalizing, do we still need to run legalize as a separate pass.
> > > Can we instead just do:
> > >
> > > combine -> legalize types -> combine w/ legalize ops
> >
> >
> > I'm specifically going to try this, but wanted to get at least the meat
> of
> > the patch out there to make sure folks were still OK with the general
> > direction and the necessary changes I had to make to the legalization
> > engine.
>
> Thinking about this a little more.  My only concern with dropping the
> legalize ops pass is that it will make it more difficult to debug.
> Right now it's easy to tell if it was the legalizer or the combiner
> which made a change, so I know which file to look at while debugging.
>
> Is there something we can do to make debugging this new hybrid pass
> a little easier?  Maybe dump the DAG after every iteration?
>
> -Tom
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20140718/21295e34/attachment.html>


More information about the llvm-commits mailing list