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

Hal Finkel hfinkel at anl.gov
Mon Jan 28 10:00:11 PST 2013

----- Original Message -----
> From: "Pekka Jääskeläinen" <pekka.jaaskelainen at tut.fi>
> To: "Hal Finkel" <hfinkel at anl.gov>
> Cc: "Nadav Rotem" <nrotem at apple.com>, "LLVM Developers Mailing List" <llvmdev at cs.uiuc.edu>
> Sent: Monday, January 28, 2013 11:36:21 AM
> Subject: Re: [LLVMdev] [PATCH] parallel loop awareness to the LoopVectorizer
> On 01/28/2013 06:51 PM, Hal Finkel wrote:
> > Is this sufficient to implement #pragma ivdep in clang?
> I'm not completely sure of this:
> "Note: The proven dependencies that prevent vectorization are not
> ignored,
> only assumed dependencies are ignored."
> http://software.intel.com/sites/products/documentation/studio/composer/en-us/2011Update/compiler_c/cref_cls/common/cppref_pragma_ivdep.htm
> Thus, there's a slight difference. It cannot be used to disable
> dependency
> checking altogether (and just blame a sloppy programmer if there
> actually
> are dependencies), but it just converts the "unknown alias" to "no
> alias".
> If there's a "yes" from the analyzer it still prevents the
> vectorization.
> So, sort of a softened programmer-friendlier version of the
> semantics.
> The vagueness comes from that it depends on the intelligence
> of the dependency analysis implementation whether a dependency can be
> "proven"
> or not, doesn't it? Thus, #pragma ivdep with a non-existing
> loop dependence analyzer is equivalent to the semantics of the
> proposed
> metadata.

And the user has no way of knowing which dependencies are proven and which are assumed, right? It seems like the user just needs to assume that nothing is proven ;) Nevertheless, based on this, we probably do need something with slightly weaker semantics for ivdep.

> Also, it's a bit unclear what is the real difference to the #pragma
> parallel:
> http://software.intel.com/sites/products/documentation/studio/composer/en-us/2011Update/compiler_c/cref_cls/common/cppref_pragma_parallel.htm
> It similarly states: "However, if dependencies are proven, they are
> not
> ignored." So conversely, if the compiler cannot prove a dependency
> for
> some reason, they *are* ignored?


> OpenMP's 'omp for', on the other hand, can be used to mark a truly
> parallel
> loop where this metadata could be used if one wants to parallelize
> those
> loops using a finer-granularity mechanism than threads.

Agreed; we should make sure to incorporate this into the upcoming OpenMP support. The loops will be outlined, but the outlined pieces can then be marked with this 'parallel' metadata.

Thanks again,

> --
> Pekka

More information about the llvm-dev mailing list