[LLVMdev] [PATCH] parallel loop awareness to the LoopVectorizer

Pekka Jääskeläinen pekka.jaaskelainen at tut.fi
Mon Jan 28 05:49:16 PST 2013


Hi Renato,

On 01/28/2013 03:22 PM, Renato Golin wrote:
> This seems an awfully specific check on a generic part of the code... If

True. Perhaps the check is better encapsulated, e.g., in the Loop class?
Or, if there's such thing as a loop-carried data dependency analyzer,
the correct place could be there, as a trivial "no deps" analysis.

 > this metadata standard in any form? If this OpenCL specific? Does all

This metadata is not standard in any form. Therefore the request
for comments. However, its meaning is generic, not OpenCL
specific at all. It specifies that the loop iterations can be
treated as independent, regardless of the memory operations the
body contains. Thus, the potential cross-iteration memory dependencies
can be considered a programming error.

 > OpenCL front-ends generate the same meta-data in that way? Etc...

I have no knowledge of other OpenCL implementations than
pocl as I haven't seen their code.

>     It also converts the "min iteration count to vectorize" to a
>     parameter so
>     this can be controlled from the command line.
>
>
> Is this really necessary? Do you have use cases where this would make sense?

Where a lower threshold could be useful? At least with loops having long
bodies and loops with outer loops that iterate the inner loop many
times.

In fact, shouldn't the default minimum be the minimum vector width of the
machine? The cost estimation routine should take care of the actual
profitability estimate?

> I think you should send a test case with this patch, not separate.

As soon as there's a consensus on the metadata format and where
the check shall reside in, I'll prepare a proper patch with
a vectorizer test case.

Thanks for the comments so far,
-- 
Pekka



More information about the llvm-dev mailing list