[LLVMdev] Trying out Loop Vectorizer

Michael Lam michael.lam.sk at gmail.com
Mon Dec 31 14:22:40 PST 2012


Setting triple for opt worked.  In my case, it is

$ opt -mtriple=x86_64-apple-macosx10.8.0 -S -O3 -vectorize-loops
loopvectorize.ll

Thanks,
Siu

On Mon, Dec 31, 2012 at 1:57 PM, Benjamin Kramer <benny.kra at gmail.com>wrote:

>
> On 31.12.2012, at 20:03, Michael Lam <michael.lam.sk at gmail.com> wrote:
>
> > Hi all,
> >
> > I am trying out the new loop vectorizer in LLVM 3.2.  I wanted to see
> the effect of the pass in `opt` but I have no success.  I used LLVM IR
> generated from C examples in
> http://blog.llvm.org/2012/12/new-loop-vectorizer.html#more and pass them
> to `opt -S -O3 -vectorize-loops example.ll`.  However, I do not see
> vectorized output.  What am I doing wrong?
>
> I'm not entirely sure why this is the case, the target specific stuff for
> opt is still very new, but at the moment you have to explicitly set a
> triple for opt so it can access target-specific bits to estimate the cost
> of vectorization. Something like "opt -mtriple=x86_64-linux-gnu -S -O3
> -vectorize-loops" should work. You can also specify a target cpu with -mcpu
> (which takes the same arguments as clang -march) to experiment with
> different SSE levels.
>
> - Ben
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20121231/2ff19077/attachment.html>


More information about the llvm-dev mailing list