I am trying to create auto-vectorized code with clang-3.2
From the slides here - http://llvm.org/devmtg/2012-04-12/Slides/Hal_Finkel.pdf
I should be able to generate vectorized code with this command line.
bin/clang++ -c -O3 -mllvm -vectorize -bb-vectorize-aligned-only clang-auto-vec.cpp
But it throws an error error: unsupported option '-b b-vectorize-aligned-only'
If i remove just the -bb-vectorize-aligned-only
, it doesn't create any vectorized code.
whats going wrong here?
The SLP Vectorizer The goal of SLP vectorization (a.k.a. superword-level parallelism) is to combine similar independent instructions into vector instructions. Memory accesses, arithmetic operations, comparison operations, PHI-nodes, can all be vectorized using this technique.
A vectorizing compiler transforms such loops into sequences of vector operations. These vector operations perform additions on blocks of elements from the arrays a , b and c . Automatic vectorization is a major research topic in computer science.
Vectorization is the process of converting an algorithm from operating on a single value at a time to operating on a set of values (vector) at one time. Modern CPUs provide direct support for vector operations where a single instruction is applied to multiple data (SIMD).
Vectorization is the use of vector instructions to speed up program execution. Vectorization can be done both by programmers by explicitly writing vector instructions and by a compiler. The latter case is called Auto Vectorization .
Prepend -mllvm
to every flag. E.g. -mllvm -vectorize -mllvm -bb-vectorize-aligned-only
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With