Commit 1a4571cb by Razya Ladelsky Committed by Razya Ladelsky

re PR tree-optimization/49960 (inconsistent outputs when enabling autopar for a…

re PR tree-optimization/49960 (inconsistent outputs when enabling autopar for a self -dependence testcase)

	PR tree-optimization/49960

	* tree-data-ref.c (initialize_data_dependence_relation): Add initializations. 
	Remove call to compute_self_dependence.
	(compute_affine_dependence): Remove the !DDR_SELF_REFERENCE condition.
	(compute_self_dependence): Remove old code. Add call to compute_affine_dependence.
	(compute_all_dependences): Remove call to compute_self_dependence. 
	Add call to compute_affine_dependence.

From-SVN: r181411
parent 4122ed2b
2011-11-16 Razya Ladelsky <razya@il.ibm.com>
PR tree-optimization/49960
* tree-data-ref.c (initialize_data_dependence_relation): Add initializations.
Remove call to compute_self_dependence.
(compute_affine_dependence): Remove the !DDR_SELF_REFERENCE condition.
(compute_self_dependence): Remove old code. Add call to compute_affine_dependence.
(compute_all_dependences): Remove call to compute_self_dependence.
Add call to compute_affine_dependence.
2011-11-16 Andreas Krebbel <Andreas.Krebbel@de.ibm.com> 2011-11-16 Andreas Krebbel <Andreas.Krebbel@de.ibm.com>
PR middle-end/50325 PR middle-end/50325
...@@ -1389,13 +1389,30 @@ initialize_data_dependence_relation (struct data_reference *a, ...@@ -1389,13 +1389,30 @@ initialize_data_dependence_relation (struct data_reference *a,
the data dependence tests, just initialize the ddr and return. */ the data dependence tests, just initialize the ddr and return. */
if (operand_equal_p (DR_REF (a), DR_REF (b), 0)) if (operand_equal_p (DR_REF (a), DR_REF (b), 0))
{ {
if (loop_nest
&& !object_address_invariant_in_loop_p (VEC_index (loop_p, loop_nest, 0),
DR_BASE_OBJECT (a)))
{
DDR_ARE_DEPENDENT (res) = chrec_dont_know;
return res;
}
DDR_AFFINE_P (res) = true; DDR_AFFINE_P (res) = true;
DDR_ARE_DEPENDENT (res) = NULL_TREE; DDR_ARE_DEPENDENT (res) = NULL_TREE;
DDR_SUBSCRIPTS (res) = VEC_alloc (subscript_p, heap, DR_NUM_DIMENSIONS (a)); DDR_SUBSCRIPTS (res) = VEC_alloc (subscript_p, heap, DR_NUM_DIMENSIONS (a));
DDR_LOOP_NEST (res) = loop_nest; DDR_LOOP_NEST (res) = loop_nest;
DDR_INNER_LOOP (res) = 0; DDR_INNER_LOOP (res) = 0;
DDR_SELF_REFERENCE (res) = true; DDR_SELF_REFERENCE (res) = true;
compute_self_dependence (res); for (i = 0; i < DR_NUM_DIMENSIONS (a); i++)
{
struct subscript *subscript;
subscript = XNEW (struct subscript);
SUB_CONFLICTS_IN_A (subscript) = conflict_fn_not_known ();
SUB_CONFLICTS_IN_B (subscript) = conflict_fn_not_known ();
SUB_LAST_CONFLICT (subscript) = chrec_dont_know;
SUB_DISTANCE (subscript) = chrec_dont_know;
VEC_safe_push (subscript_p, heap, DDR_SUBSCRIPTS (res), subscript);
}
return res; return res;
} }
...@@ -4040,8 +4057,7 @@ compute_affine_dependence (struct data_dependence_relation *ddr, ...@@ -4040,8 +4057,7 @@ compute_affine_dependence (struct data_dependence_relation *ddr,
} }
/* Analyze only when the dependence relation is not yet known. */ /* Analyze only when the dependence relation is not yet known. */
if (DDR_ARE_DEPENDENT (ddr) == NULL_TREE if (DDR_ARE_DEPENDENT (ddr) == NULL_TREE)
&& !DDR_SELF_REFERENCE (ddr))
{ {
dependence_stats.num_dependence_tests++; dependence_stats.num_dependence_tests++;
...@@ -4122,31 +4138,11 @@ compute_affine_dependence (struct data_dependence_relation *ddr, ...@@ -4122,31 +4138,11 @@ compute_affine_dependence (struct data_dependence_relation *ddr,
void void
compute_self_dependence (struct data_dependence_relation *ddr) compute_self_dependence (struct data_dependence_relation *ddr)
{ {
unsigned int i;
struct subscript *subscript;
if (DDR_ARE_DEPENDENT (ddr) != NULL_TREE) if (DDR_ARE_DEPENDENT (ddr) != NULL_TREE)
return; return;
for (i = 0; VEC_iterate (subscript_p, DDR_SUBSCRIPTS (ddr), i, subscript); if (DDR_LOOP_NEST (ddr))
i++) compute_affine_dependence (ddr, VEC_index (loop_p, DDR_LOOP_NEST (ddr), 0));
{
if (SUB_CONFLICTS_IN_A (subscript))
free_conflict_function (SUB_CONFLICTS_IN_A (subscript));
if (SUB_CONFLICTS_IN_B (subscript))
free_conflict_function (SUB_CONFLICTS_IN_B (subscript));
/* The accessed index overlaps for each iteration. */
SUB_CONFLICTS_IN_A (subscript)
= conflict_fn (1, affine_fn_cst (integer_zero_node));
SUB_CONFLICTS_IN_B (subscript)
= conflict_fn (1, affine_fn_cst (integer_zero_node));
SUB_LAST_CONFLICT (subscript) = chrec_dont_know;
}
/* The distance vector is the zero vector. */
save_dist_v (ddr, lambda_vector_new (DDR_NB_LOOPS (ddr)));
save_dir_v (ddr, lambda_vector_new (DDR_NB_LOOPS (ddr)));
} }
/* Compute in DEPENDENCE_RELATIONS the data dependence graph for all /* Compute in DEPENDENCE_RELATIONS the data dependence graph for all
...@@ -4179,7 +4175,8 @@ compute_all_dependences (VEC (data_reference_p, heap) *datarefs, ...@@ -4179,7 +4175,8 @@ compute_all_dependences (VEC (data_reference_p, heap) *datarefs,
{ {
ddr = initialize_data_dependence_relation (a, a, loop_nest); ddr = initialize_data_dependence_relation (a, a, loop_nest);
VEC_safe_push (ddr_p, heap, *dependence_relations, ddr); VEC_safe_push (ddr_p, heap, *dependence_relations, ddr);
compute_self_dependence (ddr); if (loop_nest)
compute_affine_dependence (ddr, VEC_index (loop_p, loop_nest, 0));
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment