<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;" class=""><br class=""><div><blockquote type="cite" class=""><div class="">On Mar 18, 2016, at 1:47 PM, Rail Shafigulin <<a href="mailto:rail@esenciatech.com" class="">rail@esenciatech.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class=""><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" class=""><div class=""><div class=""><div class="h5"><div class=""><span style="color:rgb(34,34,34)" class="">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 class=""><br class=""></div><div class="">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 class=""></div><div>See: <a href="http://llvm.org/docs/LangRef.html#vector-operations" class="">http://llvm.org/docs/LangRef.html#vector-operations</a></div><div><br class=""></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 class=""></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><br class=""></div><div>-- </div><div>Mehdi</div><div><br class=""></div><div><br class=""></div><br class=""><blockquote type="cite" class=""><div class=""><div dir="ltr" class=""><div class="gmail_extra"><div class="gmail_quote"><div class=""> </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" class=""><div class=""><div class=""><div class="h5"><div class=""><span style="color:rgb(34,34,34)" class=""> sum them, and store the result to the pointer.</span><br class=""></div></div></div><span class=""><div class=""><br class=""></div><br class=""><blockquote type="cite" class=""><div class=""><div dir="ltr" class=""><div class="gmail_extra"><div class=""><br class=""></div><div class="">In other words I left the code as is. </div><div class=""><br class=""></div><div class="">However if I use a .c code and run it through clang, I don't see any vector instructions. I'm puzzled. What am I doing wrong? There seems to be a step missing, the one that will generate vectorized IR, but I can't seem to find how to do it.</div></div></div></div></blockquote><div class=""><br class=""></div></span><div class="">Try: clang -O3 -emit-llvm -S test.c</div><span class="HOEnZb"><font color="#888888" class=""><div class=""><br class=""></div><div class="">-- </div><div class="">Mehdi</div></font></span><span class=""><div class=""><br class=""></div><br class=""><blockquote type="cite" class=""><div class=""><div dir="ltr" class=""><div class="gmail_extra"><div class=""><br class=""></div><div class="">Any help on this is really appreciated.</div><div class=""><br class=""></div>-- <br class=""><div class=""><div dir="ltr" class=""><div class=""><div dir="ltr" class=""><div class="">Rail Shafigulin<br class=""></div>Software Engineer <br class="">Esencia Technologies<br class=""></div></div></div></div>
</div></div>
</div></blockquote></span></div><br class=""></div></blockquote></div><br class=""><br clear="all" class=""><div class=""><br class=""></div>-- <br class=""><div class="gmail_signature"><div dir="ltr" class=""><div class=""><div dir="ltr" class=""><div class="">Rail Shafigulin<br class=""></div>Software Engineer <br class="">Esencia Technologies<br class=""></div></div></div></div>
</div></div>
</div></blockquote></div><br class=""></body></html>