[polly] Memory access based dependency analysis
Tobias Grosser
tobias at grosser.es
Tue Jun 24 14:50:43 PDT 2014
On 24/06/2014 23:44, Johannes Doerfert wrote:
> As I said, I don't want to stick to the statement only contains one
> reduction limit.
I understood that and I got (almost) convinced already by the need to
handle multiple reductions.
I am not yet 100% sure what the best approach for dependency handling is.
> In such a case we can have a statement which induces exactly the same
> dependences as a reduction like:
>
> for (i) {
> A[i] = A[i] + A[i-1];
> A[i-1] = A[i] + A[i-2];
> }
>
> Printing analysis 'Polly - Calculate dependences' for region: 'for.cond =>
> for.end' in function 'onlyA':
> RAW dependences:
> { Stmt_for_body[i0] -> Stmt_for_body[1 + i0] : i0 >= 0 and
> i0 <= 1022 }
> WAR dependences:
> { }
> WAW dependences:
> { Stmt_for_body[i0] -> Stmt_for_body[1 + i0] : i0 >= 0 and
> i0 <= 1022 }
> Reduction dependences:
> { }
>
> for (i)
> *sum += i;
>
> Printing analysis 'Polly - Calculate dependences' for region: 'for.cond =>
> for.end' in function 'onlySum':
> RAW dependences:
> { }
> WAR dependences:
> { }
> WAW dependences:
> { }
> Reduction dependences:
> { Stmt_for_body[i0] -> Stmt_for_body[1 + i0] : i0 <= 1022
> and i0 >= 0 }
>
> for (i) {
> A[i] = A[i] + A[i-1];
> A[i-1] = A[i] + A[i-2];
> *sum += i;
> }
>
> Printing analysis 'Polly - Calculate dependences' for region: 'for.cond =>
> for.end' in function 'AandSum':
> RAW dependences:
> { Stmt_for_body[i0] -> Stmt_for_body[1 + i0] : i0 <= 1022
> and i0 >= 0 }
> WAR dependences:
> { }
> WAW dependences:
> { Stmt_for_body[i0] -> Stmt_for_body[1 + i0] : i0 <= 1022
> and i0 >= 0 }
> Reduction dependences:
> { }
>
>
> Is that a valid reason to use memory access based tracking?
This is an interesting test case. However, you did not explain what the
expected output would be here? At least at the moment we would not
detect reduction dependences with and without memory access based
tracking. Do you expect reduction dependences to be detected?
Cheers,
Tobias
More information about the llvm-commits
mailing list