On Tue, Jan 29, 2013 at 8:38 AM, Pekka Jääskeläinen <span dir="ltr"><<a href="mailto:pekka.jaaskelainen@tut.fi" target="_blank">pekka.jaaskelainen@tut.fi</a>></span> wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hi,<br>
<br>
The attached patch implements a simple mechanism to mark parallel<br>
loops.<br>
<br>
It uses two types of metadata:<br>
llvm.loop.ignore_assumed_deps attached to the loop latch's<br>
branch instruction and llvm.mem.parallel_loop_access attached to<br>
all of the parallel loop's memory accesses.<br>
<br>
Loop::isParallel() checks these. If llvm.loop.ignore_assumed_deps<br>
is found, it ensures all the memory instructions inside the<br>
loop body have the llvm.mem.parallel_loop_access attached before<br>
returning true.<br></blockquote><div><br></div><div> "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.</div>
<div><br></div><div>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.</div>
<div><br></div><div>Dan</div><div><br></div></div>