<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 16, 2016, at 5:38 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">On Wed, Mar 16, 2016 at 11:48 AM, Mehdi Amini <span dir="ltr" class=""><<a href="mailto:mehdi.amini@apple.com" target="_blank" class="">mehdi.amini@apple.com</a>></span> wrote:<br class=""><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" class="">Hi Rail,<div class=""><br class=""></div><div class="">Two hints to begin with:<div class=""><br class=""></div><div class="">1) Makes sure you example is vectorized on X86 for example<div class="">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 class=""><br class=""></div></div></div></div></blockquote><div class="">Well, it sort of worked. I added a getRegisterBitWidth(...) but then I got this error:</div><div class=""><br class=""></div><div class=""><div class="">fatal error: error in backend: Cannot select: 0x5e949a8: v4i32 = BUILD_VECTOR 0x5e91ae8, 0x5e91ae8, 0x5e91ae8, 0x5e91ae8 [ORD=16] [ID=16]</div><div class="">  0x5e91ae8: i32 = Constant<0> [ID=5]</div><div class="">  0x5e91ae8: i32 = Constant<0> [ID=5]</div><div class="">  0x5e91ae8: i32 = Constant<0> [ID=5]</div><div class="">  0x5e91ae8: i32 = Constant<0> [ID=5]</div></div><div class=""><br class=""></div><div class="">What am I missing?</div></div></div></div></div></blockquote><div><br class=""></div></div><div class="">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 class="">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><div class=""><br class=""></div><div class="">-- </div><div class="">Mehdi</div><div class=""><br class=""></div></body></html>