<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Fri, Mar 18, 2016 at 1:53 PM, Mehdi Amini <span dir="ltr"><<a href="mailto:mehdi.amini@apple.com" target="_blank">mehdi.amini@apple.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word"><br><div><span class=""><blockquote type="cite"><div>On Mar 18, 2016, at 1:47 PM, Rail Shafigulin <<a href="mailto:rail@esenciatech.com" target="_blank">rail@esenciatech.com</a>> wrote:</div><br><div><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word"><div><div><div><div><span style="color:rgb(34,34,34)">Yes this IR does not build or shuffle any vector. Try to write a function that takes 8 ints and a pointer to a <4xi32>, builds two vectors with the 8 ints,</span></div></div></div></div></div></blockquote><div><br></div><div>This might sound like a dumb question, but how does one build a vector of ints out of regular ints in IR? </div></div></div></div></div></blockquote><div><br></div></span><div>See: <a href="http://llvm.org/docs/LangRef.html#vector-operations" target="_blank">http://llvm.org/docs/LangRef.html#vector-operations</a></div><div><br></div><div>In short, the IR has "insertelement", which maps to "INSERT_VECTOR_ELT" in SDAG and "extractelement", which maps to "EXTRACT_VECTOR_ELT" in SDAG.</div><div><br></div><div>I usually find good example by grepping in the lit tests. Another way is to write the function in clang, and run it with -O3 -emit-llvm -S to get a good starting point.</div></div></div></blockquote><div>I tried using clang test.c -O3 -emit-llvm -S, but the only I didn't see any of the insertvectorelt or extractvectorelt. I'm wondering how does one trigger vector operations? </div><div><br></div><div>Below is the test.c file. It seemed to me like a good candidate for vectorization, however nothing happened. I would really appreciate  if you could point me in the right<br></div><div>direction with respect to vector generation.</div><div><br></div><div>Any help is appreciated.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word"><div><span class="HOEnZb"><font color="#888888"><div><br></div><div>-- </div><div>Mehdi</div></font></span></div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div>Rail Shafigulin<br></div>Software Engineer <br>Esencia Technologies<br></div></div></div></div>
</div></div>