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

Tom Stellard tom at stellard.net
Thu Jul 17 19:51:04 PDT 2014


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



More information about the llvm-commits mailing list