[PATCH] support llvm.vectorization.vector_width metadata

Redmond, Paul paul.redmond at intel.com
Wed May 29 07:34:48 PDT 2013


Here's the final wording:

"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 believes it is valid to do so."

Sound good?

paul

On 2013-05-29, at 10:27 AM, Tobias Grosser wrote:

> On 05/29/2013 07:09 AM, David Tweed 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.
>> 
>> 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...)
> 
> Yes, this is even better.
> 
> Tobi
> 





More information about the llvm-commits mailing list