<div dir="ltr">I believe we can remove the intrinsics and have AutoUpgrade.cpp convert them to the correct IR. I think Chris told me a while back that intrinsic upgrading in AutoUpgrade would have to stay until 4.0.</div><div class="gmail_extra">
<br><br><div class="gmail_quote">On Thu, May 15, 2014 at 1:45 PM, Alex Rosenberg <span dir="ltr"><<a href="mailto:alexr@leftfield.org" target="_blank">alexr@leftfield.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
After r208664, most of those patch is dead code since Clang no longer generates these intrinsics except the blendv variants. We have to keep the intrinsics as is until the next release because they may exist in IR, but we should remove unused ones when possible.<br>

<br>
Also, it seems to me that this kind of folding belongs in InstCombine since it enables other optimizations and does not generate new shuffles. The only benefit here to SelectionDAG is carrying code for X86 intrinsics in non-X86 builds of LLVM. In this case, the code is small, so I'd still favor InstCombine.<br>

<br>
Alex<br>
<br>
> On May 15, 2014, at 8:26 AM, Andrea Di Biagio <<a href="mailto:andrea.dibiagio@gmail.com">andrea.dibiagio@gmail.com</a>> wrote:<br>
><br>
> Thanks Nadav!<br>
><br>
> Committed revision 208895.<br>
><br>
>> On Thu, May 15, 2014 at 4:04 PM, Nadav Rotem <<a href="mailto:nrotem@apple.com">nrotem@apple.com</a>> wrote:<br>
>> LGTM.  Thanks Andrea.<br>
>><br>
>>> On May 15, 2014, at 7:41, Andrea Di Biagio <<a href="mailto:andrea.dibiagio@gmail.com">andrea.dibiagio@gmail.com</a>> wrote:<br>
>>><br>
>>> Hi,<br>
>>><br>
>>> This patch teaches the x86 backend how to fold SSE4.1/AVX/AVX2 blend<br>
>>> intrinsics in the following trivial cases:<br>
>>> 1)  fold (blend A, A, Mask) -> A;<br>
>>> 2)  fold (blend A, B, <allZeros>) -> A;<br>
>>> 3) fold (blend A, B, <allOnes>) -> B;<br>
>>><br>
>>> Added two new tests to verify that the new folding rules work for all<br>
>>> the optimized blend intrinsics.<br>
>>><br>
>>> Please let me know if ok to submit.<br>
>>><br>
>>> Thanks,<br>
>>> Andrea Di Biagio<br>
>>> <patch-combine-x86-blend.diff><br>
> _______________________________________________<br>
> llvm-commits mailing list<br>
> <a href="mailto:llvm-commits@cs.uiuc.edu">llvm-commits@cs.uiuc.edu</a><br>
> <a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits</a><br>
<br>
_______________________________________________<br>
llvm-commits mailing list<br>
<a href="mailto:llvm-commits@cs.uiuc.edu">llvm-commits@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits</a><br>
</blockquote></div><br><br clear="all"><div><br></div>-- <br>~Craig
</div>