[LLVMdev] parallel loop metadata question

Pekka Jääskeläinen pekka.jaaskelainen at tut.fi
Fri May 2 01:36:35 PDT 2014


On 05/02/2014 01:49 AM, Humphreys, Jonathan wrote:
> Here’s where I have a question:
>
> - if not all memory instructions in a loop have this metadata, can the
> compiler still infer that the instructions having this metadata do not have
> any loop carried dependencies with any other instruction also having this
> metadata (for the common loops referenced by the metadata)?
>
> If so, it would be nice if we documented the actual meaning of
> llvm.mem.parallel_loop_access as such.  And the conclusion that a loop is
> ‘parallel’ if all its memory instructions have this metadata would be a
> natural consequence of that meaning.
>
> This will allow us to potentially vectorize and/or software pipeline large
> portions of loops even when some transformation introduces a memory operation
> whose dependence effects are unknown.

This would be certainly useful.

We discussed a similar issue when the original parallel loop MD was
sketched last year:

http://lists.cs.uiuc.edu/pipermail/llvmdev/2013-February/059256.html

In this case the question is whether we can be sure the (new) accesses
inserted between the parallel annotated accesses cannot not ruin
the parallel (independence) semantics between the annotated ones.

While I cannot give you a breaking example/optimization immediately,
I'm not confident there isn't one. The problem is that we need
to be extra careful to not break the metadata rules; if an
optimization does not understand a metadata, it should not be able
to accidentally break any additional semantics implied by it.

-- 
Pekka





More information about the llvm-dev mailing list