mirror of git://gcc.gnu.org/git/gcc.git
Fix PR46194: fix the computation of distance vectors.
2011-02-04 Sebastian Pop <sebastian.pop@amd.com> PR tree-optimization/46194 * tree-data-ref.c (analyze_miv_subscript): Remove comment. (build_classic_dist_vector_1): Do not represent classic distance vectors when the access functions are variating in different loops. * gcc.dg/autopar/pr46194.c: New. From-SVN: r169847
This commit is contained in:
parent
a44b6422a3
commit
a130584a8a
|
|
@ -1,3 +1,10 @@
|
||||||
|
2011-02-04 Sebastian Pop <sebastian.pop@amd.com>
|
||||||
|
|
||||||
|
PR tree-optimization/46194
|
||||||
|
* tree-data-ref.c (analyze_miv_subscript): Remove comment.
|
||||||
|
(build_classic_dist_vector_1): Do not represent classic distance
|
||||||
|
vectors when the access functions are variating in different loops.
|
||||||
|
|
||||||
2011-02-04 Joseph Myers <joseph@codesourcery.com>
|
2011-02-04 Joseph Myers <joseph@codesourcery.com>
|
||||||
|
|
||||||
* config/mips/iris6.opt: New.
|
* config/mips/iris6.opt: New.
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,8 @@
|
||||||
|
2011-02-04 Sebastian Pop <sebastian.pop@amd.com>
|
||||||
|
|
||||||
|
PR tree-optimization/46194
|
||||||
|
* gcc.dg/autopar/pr46194.c: New.
|
||||||
|
|
||||||
2011-02-04 H.J. Lu <hongjiu.lu@intel.com>
|
2011-02-04 H.J. Lu <hongjiu.lu@intel.com>
|
||||||
|
|
||||||
PR tree-optimization/43695
|
PR tree-optimization/43695
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,24 @@
|
||||||
|
/* PR tree-optimization/46194 */
|
||||||
|
/* { dg-do compile } */
|
||||||
|
/* { dg-options "-O -ftree-parallelize-loops=2 -fdump-tree-parloops-details" } */
|
||||||
|
|
||||||
|
#define N 1000
|
||||||
|
int a[N];
|
||||||
|
|
||||||
|
int foo (void)
|
||||||
|
{
|
||||||
|
int j;
|
||||||
|
int i;
|
||||||
|
|
||||||
|
/* This is not blocked as it is not profitable. */
|
||||||
|
for (i = 0; i < N; i++)
|
||||||
|
for (j = 0; j < N; j++)
|
||||||
|
a[j] = a[i] + 1;
|
||||||
|
|
||||||
|
return a[0];
|
||||||
|
}
|
||||||
|
|
||||||
|
/* This loop cannot be parallelized due to a dependence. */
|
||||||
|
|
||||||
|
/* { dg-final { scan-tree-dump-times "SUCCESS: may be parallelized" 0 "parloops" } } */
|
||||||
|
/* { dg-final { cleanup-tree-dump "parloops" } } */
|
||||||
|
|
@ -2681,14 +2681,6 @@ analyze_miv_subscript (tree chrec_a,
|
||||||
tree *last_conflicts,
|
tree *last_conflicts,
|
||||||
struct loop *loop_nest)
|
struct loop *loop_nest)
|
||||||
{
|
{
|
||||||
/* FIXME: This is a MIV subscript, not yet handled.
|
|
||||||
Example: (A[{1, +, 1}_1] vs. A[{1, +, 1}_2]) that comes from
|
|
||||||
(A[i] vs. A[j]).
|
|
||||||
|
|
||||||
In the SIV test we had to solve a Diophantine equation with two
|
|
||||||
variables. In the MIV case we have to solve a Diophantine
|
|
||||||
equation with 2*n variables (if the subscript uses n IVs).
|
|
||||||
*/
|
|
||||||
tree type, difference;
|
tree type, difference;
|
||||||
|
|
||||||
dependence_stats.num_miv++;
|
dependence_stats.num_miv++;
|
||||||
|
|
@ -2960,29 +2952,19 @@ build_classic_dist_vector_1 (struct data_dependence_relation *ddr,
|
||||||
&& TREE_CODE (access_fn_b) == POLYNOMIAL_CHREC)
|
&& TREE_CODE (access_fn_b) == POLYNOMIAL_CHREC)
|
||||||
{
|
{
|
||||||
int dist, index;
|
int dist, index;
|
||||||
int index_a = index_in_loop_nest (CHREC_VARIABLE (access_fn_a),
|
int var_a = CHREC_VARIABLE (access_fn_a);
|
||||||
DDR_LOOP_NEST (ddr));
|
int var_b = CHREC_VARIABLE (access_fn_b);
|
||||||
int index_b = index_in_loop_nest (CHREC_VARIABLE (access_fn_b),
|
|
||||||
DDR_LOOP_NEST (ddr));
|
|
||||||
|
|
||||||
/* The dependence is carried by the outermost loop. Example:
|
if (var_a != var_b
|
||||||
| loop_1
|
|| chrec_contains_undetermined (SUB_DISTANCE (subscript)))
|
||||||
| A[{4, +, 1}_1]
|
|
||||||
| loop_2
|
|
||||||
| A[{5, +, 1}_2]
|
|
||||||
| endloop_2
|
|
||||||
| endloop_1
|
|
||||||
In this case, the dependence is carried by loop_1. */
|
|
||||||
index = index_a < index_b ? index_a : index_b;
|
|
||||||
*index_carry = MIN (index, *index_carry);
|
|
||||||
|
|
||||||
if (chrec_contains_undetermined (SUB_DISTANCE (subscript)))
|
|
||||||
{
|
{
|
||||||
non_affine_dependence_relation (ddr);
|
non_affine_dependence_relation (ddr);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
dist = int_cst_value (SUB_DISTANCE (subscript));
|
dist = int_cst_value (SUB_DISTANCE (subscript));
|
||||||
|
index = index_in_loop_nest (var_a, DDR_LOOP_NEST (ddr));
|
||||||
|
*index_carry = MIN (index, *index_carry);
|
||||||
|
|
||||||
/* This is the subscript coupling test. If we have already
|
/* This is the subscript coupling test. If we have already
|
||||||
recorded a distance for this loop (a distance coming from
|
recorded a distance for this loop (a distance coming from
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue