<html><head><meta http-equiv="Content-Type" content="text/html charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;">Hi Adam,<div><br></div><div>LGTM.</div><div><br></div><div>Thanks,<br><div apple-content-edited="true">
<div style="color: rgb(0, 0, 0); font-family: Helvetica;  font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">-Quentin</div>

</div>
<br><div style=""><div>On Apr 18, 2014, at 12:23 PM, Adam Nemet <<a href="mailto:anemet@apple.com">anemet@apple.com</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite">Quentin looked at this and suggested to be slightly less conservative in detecting the lowered idiom.<br><br>In this new version, the idiom is also matched if the extract_vector_elt accesses higher elements beyond the first.  I also fixed some formatting issues.<br><br>OK to commit?<br><br>Adam<br><br>On Apr 16, 2014, at 1:03 PM, Adam Nemet <<a href="mailto:anemet@apple.com">anemet@apple.com</a>> wrote:<br><br><blockquote type="cite">Ping<br><br>On Apr 7, 2014, at 4:09 PM, Adam Nemet <<a href="mailto:anemet@apple.com">anemet@apple.com</a>> wrote:<br><br><blockquote type="cite">For a 256-bit BUILD_VECTOR consisting mostly of shuffles of 256-bit vectors,<br>both the BUILD_VECTOR and its operands may need to be legalized in multiple<br>steps.  Consider:<br><br>(v8f32 (BUILD_VECTOR (extract_vector_elt (v8f32 %vreg0,) Constant<1>),<br>                   (extract_vector_elt %vreg0, Constant<2>),<br>                   (extract_vector_elt %vreg0, Constant<3>),<br>                   (extract_vector_elt %vreg0, Constant<4>),<br>                   (extract_vector_elt %vreg0, Constant<5>),<br>                   (extract_vector_elt %vreg0, Constant<6>),<br>                   (extract_vector_elt %vreg0, Constant<7>),<br>                   %vreg1))<br><br>a. We can't build a 256-bit vector efficiently so, we need to split it into<br>two 128-bit vecs and combine them with VINSERTX128.<br><br>b. Operands like (extract_vector_elt (v8f32 %vreg0), Constant<7>) needs to<br>be split into a VEXTRACTX128 and a further extract_vector_elt from the<br>resulting 128-bit vector.<br><br>c. The extract_vector_elt from b. is lowered into a shuffle to the first<br>element and a movss.<br><br>Depending on the order in which we legalize the BUILD_VECTOR and its<br>operands[1], buildFromShuffleMostly may be faced with:<br><br>(v4f32 (BUILD_VECTOR (extract_vector_elt<br>                    (vector_shuffle<1,u,u,u> (extract_subvector %vreg0, Constant<4>), undef),<br>                    Constant<0>),<br>                   (extract_vector_elt<br>                    (vector_shuffle<2,u,u,u> (extract_subvector %vreg0, Constant<4>), undef),<br>                    Constant<0>),<br>                   (extract_vector_elt<br>                    (vector_shuffle<3,u,u,u> (extract_subvector %vreg0, Constant<4>), undef),<br>                    Constant<0>),<br>                   %vreg1))<br><br>In order to figure out the underlying vector and their identity we need to see<br>through the shuffles.<br><br>[1] Note that the order in which operations and their operands are legalized is<br>only guaranteed in the first iteration of LegalizeDAG.<br><br>Fixes <<a href="rdar://problem/16296956">rdar://problem/16296956</a>><br><br>Adam<br><br></blockquote><br><blockquote type="cite">_______________________________________________<br>llvm-commits mailing list<br><a href="mailto:llvm-commits@cs.uiuc.edu">llvm-commits@cs.uiuc.edu</a><br>http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits<br></blockquote><br>_______________________________________________<br>llvm-commits mailing list<br><a href="mailto:llvm-commits@cs.uiuc.edu">llvm-commits@cs.uiuc.edu</a><br>http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits<br></blockquote><span><X86-Improve-buildFromShuffleMostly-for-AVX.patch></span></blockquote></div><br></div></body></html>