<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Wed, Mar 16, 2016 at 6:38 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"><span class=""><br><div><blockquote type="cite"><div>On Mar 16, 2016, at 5:38 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">On Wed, Mar 16, 2016 at 11:48 AM, 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:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div style="word-wrap:break-word">Hi Rail,<div><br></div><div>Two hints to begin with:<div><br></div><div>1) Makes sure you example is vectorized on X86 for example<div>2) Is your target correctly overriding the TTI (declaring the vector register size for example) so that the vectorizer can kicks-in (see X86TTIImpl::getRegisterBitWidth for instance). Alternatively you can test the SLP vectorizer by passing to clang: -mllvm -slp-max-reg-size -mllvm 512  (I don't see an equivalent option for the loop vectorizer though).</div><div><br></div></div></div></div></blockquote><div>Well, it sort of worked. I added a getRegisterBitWidth(...) but then I got this error:</div><div><br></div><div><div>fatal error: error in backend: Cannot select: 0x5e949a8: v4i32 = BUILD_VECTOR 0x5e91ae8, 0x5e91ae8, 0x5e91ae8, 0x5e91ae8 [ORD=16] [ID=16]</div><div>  0x5e91ae8: i32 = Constant<0> [ID=5]</div><div>  0x5e91ae8: i32 = Constant<0> [ID=5]</div><div>  0x5e91ae8: i32 = Constant<0> [ID=5]</div><div>  0x5e91ae8: i32 = Constant<0> [ID=5]</div></div><div><br></div><div>What am I missing?</div></div></div></div></div></blockquote><div><br></div></div></span><div>I means that you have a vectorized IR that reached your backend, but your backend is not ready to deal with all the vector constructs in SelectionDAG. </div><div>You need to express how to legalize/select the BUILD_VECTOR in SelectionDAG to instructions that your target supports. You can look at what other targets are doing.</div><span class="HOEnZb"><font color="#888888"><div><br></div><div>-- </div><div>Mehdi</div><div><br></div></font></span></div></blockquote></div><br>Thanks for the reply. Do you mind pointing out the files I need to look at? I looked at X86SelectionDAGInfo.cpp as well as ARMSelectionDAGInfo.cpp but couldn't find anything relevant.<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>