[Polly] Isl AST reduction pragmas [V2]
Johannes Doerfert
doerfert at cs.uni-saarland.de
Thu Jun 19 08:28:21 PDT 2014
> There may be a test case (I did not create one), where the scheduler
> decides for whatever reason to transform the code from:
>
> for(i = 0; i < n; i++
> S1: A[0] +=
>
> to:
>
> for(i = 0; i < n; i+=2
> S1a: A[0] +=
>
>
> for(i = 1; i < n; i+=2
> S1b: A[0] +=
>
> In this case, there will be no loop carried dependences any more, as
> dependences now go always back and forth between S1a and S2b. So we may
> incorrectly detect the new loops as parallel.
Why incorrectly?
1) Reordering the reductions is exactly what we allow by removing the reduction
dependences before scheduling.
2) Marking them as parallel clearly break the reduction dependences, thus we
need (and would now) introduce privatization.
My reasoning is that we have the privatization dependences to restrict the
scheduler only to legal transformations. The "is parallel test" in the end is
only concern with the if and now also the how to parallelize loops, like the
need to privatize. I'm still convinced that the current solution does not
produce invalid code in any way, but only privatizes without need in case of
loop reversals.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 213 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20140619/baefeecb/attachment.sig>
More information about the llvm-commits
mailing list