[PATCH] support llvm.vectorization.vector_width metadata

Du Toit, Stefanus stefanus.du.toit at intel.com
Wed May 29 06:59:00 PDT 2013


On 2013-05-29 12:18 AM, "Tobias Grosser" <tobias at grosser.es> wrote:

>"This metadata forces the loop vectorizer to widen scalar values to a
>vector width of ``N`` rather than computing the width using a cost model."
>
>Could you add the following senctence.
>
>"The ``llvm.vectorizer.width'' metadata overwrites only the cost
>heuristics of the vectorizer. To actually vectorize a loop the
>vectorizer either needs to be able to prove that a loop is parallel or
>the loop has to be marked with additional
>``llvm.mem.parallel_loop_access'' as parallel"

I like where you're going, but I think this is too over-specified. How
about (as a general cleanup of this section):

"""
This metadata sets the target width of the vectorizer to ``N``. Without
this metadata, the vectorizer will choose a width automatically.
Regardless of this metadata, the vectorizer will only vectorize loops if
it is safe to do so.

[Š]

Setting ``llvm.vectorizer.width`` to 0 is equivalent to not setting it at
all.
Setting ``llvm.vectorizer.width`` to 1 disables vectorization of the loop.
"""

Stefanus

--
Stefanus Du Toit <stefanus.du.toit at intel.com>
Intel Waterloo
Phone: 519-591-1738





More information about the llvm-commits mailing list