<div dir="ltr"><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Jul 17, 2014 at 12:15 PM, Chandler Carruth <span dir="ltr"><<a href="mailto:chandlerc@google.com" target="_blank">chandlerc@google.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class=""><div class="gmail_quote">On Thu, Jul 17, 2014 at 3:11 PM, Tom Stellard <span dir="ltr"><<a href="mailto:tom@stellard.net" target="_blank">tom@stellard.net</a>></span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div>On Thu, Jul 17, 2014 at 04:55:00PM +0000, Chandler Carruth wrote:<br>
> Hi hfinkel, grosbach,<br>
><br>
> This allows the combiner to produce new nodes which need to go back<br>
> through legalization. This is particularly useful when generating<br>
> operands to target specific nodes in a post-legalize DAG combine where<br>
> the operands are significantly easier to express as pre-legalized<br>
> operations. My immediate use case will be PSHUFB formation where we need<br>
> to build a constant shuffle mask with a build_vector node.<br>
><br>
<br>
</div>Since the post-legalize DAG combiner is now doing combining and<br>
legalizing, do we still need to run legalize as a separate pass.<br>
Can we instead just do:<br>
<br>
combine -> legalize types -> combine w/ legalize ops</blockquote></div><br></div>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.</blockquote>
</div><br>Just as an update here...</div><div class="gmail_extra"><br></div><div class="gmail_extra">I now really want to submit the patch as-is in terms of functionality.</div><div class="gmail_extra"><br></div><div class="gmail_extra">
Changing the DAG ISel process to do legalizing as a combining phase makes a *ton* of sense to me, unfortunately absolutely nothing works if you try to do that today. =/ There are a lot of nasty, thorny, really unpleasant problems all interacting to make this impossible today. I'm going to try to fix a bunch of them, but I don't really want to hold up this patch which makes writing post-legalization DAG combines strictly more flexible and powerful (solving a specific problem they currently have) while trying to make this brave new world a reality.</div>
<div class="gmail_extra"><br></div><div class="gmail_extra">I'll be sending an email to llvmdev with some of the challenges here and what would be required to make this happen. It doesn't look infeasible, but it does look like a lot of work.</div>
</div>