<div dir="ltr"><br><div>LGTM except one nit:</div><div><div>+</div><div>+  // If the input vector is a concatenation, and the insert replaces</div><div>+  // one of the halves, we can optimize into a single concat_vectors</div>
</div><div><br></div><div>The comment should end with a period :)</div><div><br></div><div>Thanks,</div><div>Manman</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Thu, Jan 30, 2014 at 8:39 AM, Robert Lougher <span dir="ltr"><<a href="mailto:rob.lougher@gmail.com" target="_blank">rob.lougher@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">ping.<br>
<div><div class="h5"><br>
On 23 January 2014 19:57, Robert Lougher <<a href="mailto:rob.lougher@gmail.com">rob.lougher@gmail.com</a>> wrote:<br>
> Hi,<br>
><br>
> This patch teaches the DAGCombiner how to fold insert_subvector nodes<br>
> when the input is a concat_vectors and the insert replaces one of the<br>
> concat halves:<br>
><br>
> Lower half: fold (insert_subvector (concat_vectors X, Y), Z) -><br>
> (concat_vectors Z, Y)<br>
> Upper half: fold (insert_subvector (concat_vectors X, Y), Z) -><br>
> (concat_vectors X, Z)<br>
><br>
> This can be seen with the following IR:<br>
><br>
> define <8 x float> @lower_half(<4 x float> %v1, <4 x float> %v2, <4 x<br>
> float> %v3) {<br>
>   %1 = shufflevector <4 x float> %v1, <4 x float> %v2, <8 x i32> <i32<br>
> 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7><br>
>   %2 = tail call <8 x float> @llvm.x86.avx.vinsertf128.ps.256(<8 x<br>
> float> %1, <4 x float> %v3, i8 0)<br>
><br>
> The vinsertf128 intrinsic is converted into an insert_subvector node<br>
> in SelectionDAGBuilder.cpp.<br>
><br>
> Using AVX, without the patch this generates two vinsertf128 instructions:<br>
><br>
> vinsertf128 $1, %xmm1, %ymm0, %ymm0<br>
> vinsertf128 $0, %xmm2, %ymm0, %ymm0<br>
><br>
> With the patch this is optimized into:<br>
><br>
> vinsertf128 $1, %xmm1, %ymm2, %ymm0<br>
><br>
><br>
> I have added a test that checks both the upper and lower halves.  If<br>
> the patch looks OK please submit for me.<br>
><br>
> Thanks,<br>
> Rob.<br>
><br>
> --<br>
> Robert Lougher<br>
> SN Systems - Sony Computer Entertainment Group<br>
</div></div>_______________________________________________<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></div>