During the IslAst parallelism check also compute the actual dependency distance and store it in the IstAst for node.
Details
Diff Detail
- Repository
- rL LLVM
Event Timeline
lib/Analysis/Dependences.cpp | ||
---|---|---|
521 ↗ | (On Diff #13415) | What happens when the isl_set_free function returns a non-zero error? |
test/Isl/Ast/dependence_distance_parametric.ll | ||
5 ↗ | (On Diff #13415) | j++) |
test/Isl/Ast/dependence_distance_varying.ll | ||
4 ↗ | (On Diff #13415) | I am not sure I understand what "((N - 1) % 2) + 1" means: for a given N, say 100, this expression is equal to 2, for (int i = 0; i < N; i++) A[i] = A[N - i] + 1; and the dependence distance in this loop is not constant:
|
test/Isl/Ast/dependence_distance_varying_in_outer_loop.ll | ||
6 ↗ | (On Diff #13415) | Is the distance carried by the inner loop equal to 1? Say we fix the outer loop j to iteration 5, then in the inner loop
I think that the dependence distance is not constant in this case. |
8 ↗ | (On Diff #13415) | for j < 3, A[i - 3] is a negative access function. |
test/Isl/Ast/dependence_distance_varying_multiple.ll | ||
5 ↗ | (On Diff #13415) | The difference between A[i] and A[100 - 2*i] is not constant. This loop does not carry a constant dependence distance of 1, 2, or 5. |
Answers
lib/Analysis/Dependences.cpp | ||
---|---|---|
521 ↗ | (On Diff #13415) | isl "guarantees" (with the __isl_null annotation) that we get a nullptr back. Apperently ppl don't like my shortcut, I can change that. |
test/Isl/Ast/dependence_distance_parametric.ll | ||
5 ↗ | (On Diff #13415) | thx |
test/Isl/Ast/dependence_distance_varying.ll | ||
4 ↗ | (On Diff #13415) | We compute the minimal dependence distance, everything else seems not really useful? Am I wrong here? |
test/Isl/Ast/dependence_distance_varying_in_outer_loop.ll | ||
6 ↗ | (On Diff #13415) | Again, 1 is the minimal dependence distance |
8 ↗ | (On Diff #13415) | That is totally fine for a subset of possible pointers A. |
test/Isl/Ast/dependence_distance_varying_multiple.ll | ||
5 ↗ | (On Diff #13415) | Should again be the minimal dep. distance. |
test/Isl/Ast/dependence_distance_varying_multiple.ll | ||
---|---|---|
5 ↗ | (On Diff #13415) | Ok, so then let's print: #pragma minimal dependence distance that is different than what books call "dependence distance", that's why I got confused. |
test/Isl/Ast/dependence_distance_varying_multiple.ll | ||
---|---|---|
5 ↗ | (On Diff #13415) | True, will do. |
LGTM with those changes.
Let's also wait for Tobi's ok before commit.
include/polly/CodeGen/IslAst.h | ||
---|---|---|
55 ↗ | (On Diff #13676) | MinimalDependenceDistance |
72 ↗ | (On Diff #13676) | the minimal dependence distance |
73 ↗ | (On Diff #13676) | MinimalDependenceDistance |
132 ↗ | (On Diff #13676) | Get the minimal dependence distance or nullptr. |
134 ↗ | (On Diff #13676) | getMinimalDependenceDistance |
include/polly/Dependences.h | ||
95 ↗ | (On Diff #13676) | MinDistancePtr If not nullptr, the minimal dependence distance will be returned at the address of that pointer |
lib/Analysis/Dependences.cpp | ||
490 ↗ | (On Diff #13676) | MinDistancePtr |
529 ↗ | (On Diff #13676) | Please add a comment above this stmt to explain that we take the min of the distance polyhedron. |