[LLVMdev] Parallel Loop Metadata

Pekka Jääskeläinen pekka.jaaskelainen at tut.fi
Fri Feb 8 02:52:59 PST 2013


Good day Nadav and Tobias,

Yes, the fundamental idea of this metadata was that it would be
specifically used to avoid the need for any loop-carried dependency
analysis.

On 02/08/2013 07:35 AM, Nadav Rotem wrote:
> We already detect this case right now. Its really easy to do.  The
> llvm.loop.parallel should only provide information that is not easily
> available within this compilation unit.  For example, assumption that the
> input pointers don't overlap, or that dynamic indices are within a certain
> range that allow us to vectorize.

I see your point, but then this goes back to the similar discussion we had
with #pragma ivdep.

The risky part in this approach is to define the set of safely
ignored dependency cases in such a way that it never ignores deps that
should not be ignored.

The problematic cases are the "unknown alias" cases. Some of them might
originate from the original parallel loop (the reason why the programmer
might have added the parallellism info the first place), and some of them
might come from parallel-loop-unaware passes and cannot be safely ignored
if they have converted the loop back to a sequential one (added a
loop carried dependency).

I totally agree that annotating all the memory accesses in the parallel
loops feels somehow excessive (this wasn't done in my original patch),
but so far I do not see a more robust way, and I prefer playing it safe.

BR,
-- 
Pekka



More information about the llvm-dev mailing list