[Polly] Isl AST reduction pragmas [V2]

Johannes Doerfert jdoerfert at codeaurora.org
Thu Jun 19 11:47:02 PDT 2014


On 19/06/2014 18:56, Johannes Doerfert wrote:
> So if I have the dependences and schedule like shown below (assume they are e.g., WAW dependences).
> Would a function like "astScheduleDimIsParallel" in IslAst tell me it is parallel or not (without my patch and reductions)?
>
> I was under the impression that it would (and should) say __not__ parallel.

>> It would say 'parallel', as there are no loop carried dependences between the statements that are part of the loop. Or does the code suggest otherwise?
There is a loop carried dependency.

Looking at the C versions (before & after) we clearly see the assignments to the same memory location.
Looking at the dependences we see a dependency between one iteration and every following one (even if transitive dependences are only implicitly represented).
Looking at the "parallelism tests" (e.g., the one ion astScheduleDimIsParallel [btw. there are also others which perform the same/a similar function... we should not duplicate such important functions!]),
  we see that the original dependences S[i]->S[i+1] are transformed according to the schedule and then we look if the dependency is carried by an outer loop or not carried by the current dimension.

My point is that in all these cases I see the forward dependency from one iteration to the next of the same loop, and one between the loops. 

I simply do not understand where we get parallelism here, other than from the "excluded" (see above) reductions. Even with reductions the test (to my understanding) will yield the correct result (which is now "reduction parallel", not "not parallel" any more).

--

Johannes Doerfert
Employee of Qualcomm Innovation Center, Inc.
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, hosted by The Linux Foundation





More information about the llvm-commits mailing list