[PATCH] parallel loop metadata

Dan Gohman dan433584 at gmail.com
Tue Jan 29 10:22:44 PST 2013


On Tue, Jan 29, 2013 at 8:38 AM, Pekka Jääskeläinen <
pekka.jaaskelainen at tut.fi> wrote:

> Hi,
>
> The attached patch implements a simple mechanism to mark parallel
> loops.
>
> It uses two types of metadata:
> llvm.loop.ignore_assumed_deps attached to the loop latch's
> branch instruction and llvm.mem.parallel_loop_access attached to
> all of the parallel loop's memory accesses.
>
> Loop::isParallel() checks these. If llvm.loop.ignore_assumed_deps
> is found, it ensures all the memory instructions inside the
> loop body have the llvm.mem.parallel_loop_access attached before
> returning true.
>

 "Ignore assumed dependencies" is shaky semantics. I haven't seen anything
explicitly spell out which dependencies a compiler is guaranteed to detect.
How can users use such a directive safely in a loop which has dependencies?
I understand that this is what icc's documentation says, but I'm wondering
if there's a real motivation for this design other than blind compatibility.

Also, hiding this "assumed dependencies" concept inside an API call named
isParallel is confusing. Presumably there will also be a loop directive
indicating that a loop is simply parallel, without this concept of assumed
dependencies, and that's what I would otherwise assume a method named
isParallel would test for.

Dan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20130129/dc8f10bb/attachment.html>


More information about the llvm-commits mailing list