[PATCH] support llvm.vectorization.vector_width metadata

David Tweed david.tweed at arm.com
Wed May 29 07:09:11 PDT 2013


>"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.

A couple of minor things. Firstly, I'd prefer "valid" to "safe". Secondly, I
know
it's anthropomorphising the compiler, but how about "if it believes it is
valid
to do so" (since conceivably one could have loops which are not at the LLVM
language level valid to vectorize but which are, at the level of the
algorithm,
it yields the same result...)

Cheers,
Dave







More information about the llvm-commits mailing list