<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">Hi Alex,<div class=""><br class=""></div><div class="">How do you compile this program? I compile it as follows, and don’t see extra vector-bodies:</div><div class=""><br class=""></div><span style="font-family: Menlo;" class="">> bin/clang -O3 vec.c -S -o - |grep "##"</span><br class=""><blockquote style="margin: 0 0 0 40px; border: none; padding: 0px;" class=""><div class=""><div class=""><font face="Menlo" class="">_foo: ## @foo</font></div></div><div class=""><div class=""><font face="Menlo" class="">## BB#0: ## %entry</font></div></div><div class=""><div class=""><font face="Menlo" class="">## BB#1: ## %for.body.preheader</font></div></div><div class=""><div class=""><font face="Menlo" class="">## BB#8: ## %min.iters.checked</font></div></div><div class=""><div class=""><font face="Menlo" class="">## BB#9: ## %vector.memcheck</font></div></div><div class=""><div class=""><font face="Menlo" class="">## BB#10: ## %vector.memcheck</font></div></div><div class=""><div class=""><font face="Menlo" class="">## BB#11: ## %vector.body.preheader</font></div></div><div class=""><div class=""><font face="Menlo" class="">## BB#12: ## %vector.body.prol</font></div></div><div class=""><div class=""><font face="Menlo" class="">LBB0_13: ## %vector.body.prol.loopexit</font></div></div><div class=""><div class=""><font face="Menlo" class="">## BB#14: ## %vector.body.preheader.new</font></div></div><div class=""><div class=""><font face="Menlo" class="">LBB0_15: ## %vector.body</font></div></div><div class=""><div class=""><font face="Menlo" class=""> ## =>This Inner Loop Header: Depth=1</font></div></div><div class=""><div class=""><font face="Menlo" class="">LBB0_16: ## %middle.block</font></div></div><div class=""><div class=""><font face="Menlo" class="">LBB0_2: ## %for.body.preheader27</font></div></div><div class=""><div class=""><font face="Menlo" class="">## BB#3: ## %for.body.prol.preheader</font></div></div><div class=""><div class=""><font face="Menlo" class="">LBB0_4: ## %for.body.prol</font></div></div><div class=""><div class=""><font face="Menlo" class=""> ## =>This Inner Loop Header: Depth=1</font></div></div><div class=""><div class=""><font face="Menlo" class="">LBB0_5: ## %for.body.prol.loopexit</font></div></div><div class=""><div class=""><font face="Menlo" class="">## BB#6: ## %for.body.preheader27.new</font></div></div><div class=""><div class=""><font face="Menlo" class="">LBB0_7: ## %for.body</font></div></div><div class=""><div class=""><font face="Menlo" class=""> ## =>This Inner Loop Header: Depth=1</font></div></div><div class=""><div class=""><font face="Menlo" class="">LBB0_17: ## %for.cond.cleanup</font></div></div></blockquote><div class=""><br class=""></div><div class=""><br class=""></div><div class="">Best regards,</div><div class="">Michael</div><div class=""><br class=""></div><div class=""><br class=""><div><blockquote type="cite" class=""><div class="">On Jul 31, 2016, at 5:29 PM, Alex Susu <<a href="mailto:alex.e.susu@gmail.com" class="">alex.e.susu@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div class=""> Hello.<br class=""> Mikhail, with the more recent version of the LoopVectorize.cpp code (retrieved at the beginning of July 2016) I ran the following piece of C code:<br class=""> void foo(long *A, long *B, long *C, long N) {<br class=""> for (long i = 0; i < N; ++i) {<br class=""> C[i] = A[i] + B[i];<br class=""> }<br class=""> }<br class=""><br class=""> The vectorized LLVM program I obtain contains 2 vector.body blocks - one named "vector.body" and the other "vector.body34" for example. The code seems correct - the first "vector.body" block is responsible for the vector add of a number of vector elements multiple of VF * UF. There are 2 epilogues which makes things a bit strange - I am still trying to understand the code.<br class=""><br class=""><br class=""> Is it possible to explain to me where in LoopVectorize.cpp are created 2 vector.body blocks? I know that InnerLoopVectorizer::vectorize() calls InnerLoopVectorizer::createEmptyLoop() which creates the blocks required for vectorization, but I have difficulties to follow the classes instantiations.<br class=""> I ask because in fact, I would prefer having only one "vector.body" block for the above C program, as it was happening with LoopVectorize.cpp version of Nov 2015.<br class=""><br class=""> Thank you very much,<br class=""> Alex<br class=""></div></div></blockquote></div><br class=""></div></body></html>