<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;">Both the SLP vectorizer and the Loop vectorizer support vectorizing pointers. The attached code looks like a candidate for the SLP-vectorizer. Can you run the SLP-vectorizer with the flag -mllvm -debug-only=SLP and attach the log ? I think that we are missing the pattern for the roots of the tree. <div><br></div><div>Thanks,</div><div>Nadav<br><div><br><div><div>On Oct 16, 2013, at 5:28 PM, Tom Stellard <<a href="mailto:tom@stellard.net">tom@stellard.net</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div style="font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;">On Wed, Oct 16, 2013 at 11:14:06AM -0400, Matthieu Dubet wrote:<br><blockquote type="cite">Hi,<br><br>Thank you for the information,<br><br>So I'm now keeping the array as a pointer (i32*) but the vectorizer doesn't<br>vectorize it .<br><br>I've pasted the function code before and after optimization (and the list<br>of optimization that I have activated) in this Gist :<br><a href="https://gist.github.com/maattd/7008683">https://gist.github.com/maattd/7008683</a><br><br>Some "weird" fact of my LLVM code :<br><br>* all variables (even the one used for the loop condition) are pointers to<br>memory allocated from the C world and passed to the LLVM functions as an<br>argument<br>* even with "opt->add(new llvm::DataLayout(*ee->getDataLayout())) ;" in the<br>code, the module->dump() doesn't output neither data layout, nor triple<br>target<br><br>Both those points might confuse the vectorizer ?<br><br><br>On Fri, Oct 11, 2013 at 1:40 PM, Renato Golin <renato.golin@linaro.org>wrote:<br><br><blockquote type="cite">On 11 October 2013 18:27, Matthieu Dubet <maattdd@gmail.com> wrote:<br><br><blockquote type="cite">How can I tell LLVM to consider this i32* as an <10 x i32> (and thus get<br>the performance improvements thanks to SIMD ..etc..) ?<br><br></blockquote><br>Hi Matthieu,<br><br>You shouldn't need to do anything, the vectorizer should spot that for<br>you, if the machine you're compiling to has support for vector<br>instructions. Any kind of vector operations that you may want to hard-code<br>will make it not work on anything other than the intrinsics/inline asm<br>you're using, which is not a good idea.<br><br></blockquote></blockquote><br>Which part of the vectorizer is responsible for doing pointer->vector transformations?<br><br>-Tom<br><br><blockquote type="cite"><blockquote type="cite">If your code didn't get vectorized, it's possible that it is not clear<br>enough that that pointer is being iterated in a way that it's easy for the<br>vectorizer to spot, so maybe you need to make it clearer, and that depends<br>on the code in question. If you could share the code (or a similar example)<br>with the list, people could help you spot the pattern and make it vectorize.<br><br>cheers,<br>--renato<br></blockquote></blockquote><br><br><blockquote type="cite"><blockquote type="cite"><br></blockquote></blockquote><br><blockquote type="cite">_______________________________________________<br>LLVM Developers mailing list<br><a href="mailto:LLVMdev@cs.uiuc.edu">LLVMdev@cs.uiuc.edu</a> <a href="http://llvm.cs.uiuc.edu">http://llvm.cs.uiuc.edu</a><br><a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev">http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev</a><br></blockquote><br>_______________________________________________<br>LLVM Developers mailing list<br><a href="mailto:LLVMdev@cs.uiuc.edu">LLVMdev@cs.uiuc.edu</a><span class="Apple-converted-space"> </span> <a href="http://llvm.cs.uiuc.edu/">http://llvm.cs.uiuc.edu</a><br><a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev">http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev</a></div></blockquote></div><br></div></div></body></html>