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

Pekka Jääskeläinen pekka.jaaskelainen at tut.fi
Mon Jan 28 09:36:21 PST 2013


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.

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.

-- 
Pekka



More information about the llvm-dev mailing list