<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;">Hi Josh, <div><br></div><div>Your modules does not have a triple, so the target machine and TargetTransformInfo have no way of knowing if you are running on a machine with vector registers. Try adding the '-mcpu=XXXX' to opt and see what happens. </div><div><br></div><div>Thanks,</div><div>Nadav</div><div><br><div><div>On May 9, 2013, at 1:42 PM, Josh Klontz <<a href="mailto:josh.klontz@gmail.com">josh.klontz@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div style="letter-spacing: 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;">Hi! I am trying to get the loop vectorizer to work on a simple example<br>(<a href="http://pastebin.com/tGhpc4y0">http://pastebin.com/tGhpc4y0</a>) that doubles every element in a vector.<br><br>I've found that 'opt -loop-vectorize -force-vector-width=4 -S -debug<br>double.ll' works as expected. However, removing the -force-vector-width flag<br>results in no vectorization. From the debug output I can see that the issue<br>boils down to:<br><br>LV: The Widest type: 32 bits.<br>LV: The Widest register is:32bits.<br><br>I tried to work back through the source code to figure out why the widest<br>register is incorrect, though I get lost following the code logic for how<br>TargetTransformInfo gets initialized. Therefore, I have two questions:<br><br>1) Can -force-vector-width be specified from the C++ API? And if so, how?<br>2) What am I neglecting to do so that TargetTransformInfo is set correctly<br>and vectorization happens without forcing a vector width? Ultimately I would<br>like use vectorization in conjunction with the JIT ExecutionEngine.<br><br>Thank you to those of you who have answered my questions in the past, the<br>answers have helped tremendously and I am extremely grateful!<br><br>Kindly,<br>Josh<br><br><br><br><br>--<br>View this message in context:<span class="Apple-converted-space"> </span><a href="http://llvm.1065342.n5.nabble.com/Simple-Loop-Vectorize-Question-tp57584.html">http://llvm.1065342.n5.nabble.com/Simple-Loop-Vectorize-Question-tp57584.html</a><br>Sent from the LLVM - Dev mailing list archive at<span class="Apple-converted-space"> </span><a href="http://nabble.com/">Nabble.com</a>.<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></body></html>