Commit b0af49c4 by Sebastian Pop Committed by Sebastian Pop

Use DR_IS_WRITE instead of !DR_IS_READ.

2010-09-03  Sebastian Pop  <sebastian.pop@amd.com>

	* tree-data-ref.c (dr_may_alias_p): Replace !DR_IS_READ with
	DR_IS_WRITE.
	(compute_all_dependences): Same.
	(create_rdg_edge_for_ddr): Same.
	* tree-data-ref.h (DR_IS_WRITE): New.
	(ddr_is_anti_dependent): Replace !DR_IS_READ with DR_IS_WRITE.
	* tree-if-conv.c (write_memrefs_written_at_least_once): Same.
	(write_memrefs_written_at_least_once): Same.
	* tree-predcom.c (suitable_component_p): Same.
	(determine_roots_comp): Same.
	(execute_load_motion): Same.
	* tree-vect-data-refs.c (vect_analyze_data_ref_dependence): Same.
	(vect_enhance_data_refs_alignment): Same.
	(vect_analyze_group_access): Same.

From-SVN: r163841
parent 0edf45a3
2010-09-03 Sebastian Pop <sebastian.pop@amd.com>
* tree-data-ref.c (dr_may_alias_p): Replace !DR_IS_READ with
DR_IS_WRITE.
(compute_all_dependences): Same.
(create_rdg_edge_for_ddr): Same.
* tree-data-ref.h (DR_IS_WRITE): New.
(ddr_is_anti_dependent): Replace !DR_IS_READ with DR_IS_WRITE.
* tree-if-conv.c (write_memrefs_written_at_least_once): Same.
(write_memrefs_written_at_least_once): Same.
* tree-predcom.c (suitable_component_p): Same.
(determine_roots_comp): Same.
(execute_load_motion): Same.
* tree-vect-data-refs.c (vect_analyze_data_ref_dependence): Same.
(vect_enhance_data_refs_alignment): Same.
(vect_analyze_group_access): Same.
2010-09-03 Joern Rennecke <joern.rennecke@embecosm.com> 2010-09-03 Joern Rennecke <joern.rennecke@embecosm.com>
PR testsuite/42843 PR testsuite/42843
......
...@@ -1335,12 +1335,12 @@ dr_may_alias_p (const struct data_reference *a, const struct data_reference *b) ...@@ -1335,12 +1335,12 @@ dr_may_alias_p (const struct data_reference *a, const struct data_reference *b)
return false; return false;
/* Query the alias oracle. */ /* Query the alias oracle. */
if (!DR_IS_READ (a) && !DR_IS_READ (b)) if (DR_IS_WRITE (a) && DR_IS_WRITE (b))
{ {
if (!refs_output_dependent_p (DR_REF (a), DR_REF (b))) if (!refs_output_dependent_p (DR_REF (a), DR_REF (b)))
return false; return false;
} }
else if (DR_IS_READ (a) && !DR_IS_READ (b)) else if (DR_IS_READ (a) && DR_IS_WRITE (b))
{ {
if (!refs_anti_dependent_p (DR_REF (a), DR_REF (b))) if (!refs_anti_dependent_p (DR_REF (a), DR_REF (b)))
return false; return false;
...@@ -1372,7 +1372,7 @@ dr_may_alias_p (const struct data_reference *a, const struct data_reference *b) ...@@ -1372,7 +1372,7 @@ dr_may_alias_p (const struct data_reference *a, const struct data_reference *b)
decl_b = SSA_NAME_VAR (addr_b); decl_b = SSA_NAME_VAR (addr_b);
if (TYPE_RESTRICT (type_a) && TYPE_RESTRICT (type_b) if (TYPE_RESTRICT (type_a) && TYPE_RESTRICT (type_b)
&& (!DR_IS_READ (a) || !DR_IS_READ (b)) && (DR_IS_WRITE (a) || DR_IS_WRITE (b))
&& decl_a && DECL_P (decl_a) && decl_a && DECL_P (decl_a)
&& decl_b && DECL_P (decl_b) && decl_b && DECL_P (decl_b)
&& decl_a != decl_b && decl_a != decl_b
...@@ -4107,7 +4107,7 @@ compute_all_dependences (VEC (data_reference_p, heap) *datarefs, ...@@ -4107,7 +4107,7 @@ compute_all_dependences (VEC (data_reference_p, heap) *datarefs,
FOR_EACH_VEC_ELT (data_reference_p, datarefs, i, a) FOR_EACH_VEC_ELT (data_reference_p, datarefs, i, a)
for (j = i + 1; VEC_iterate (data_reference_p, datarefs, j, b); j++) for (j = i + 1; VEC_iterate (data_reference_p, datarefs, j, b); j++)
if (!DR_IS_READ (a) || !DR_IS_READ (b) || compute_self_and_rr) if (DR_IS_WRITE (a) || DR_IS_WRITE (b) || compute_self_and_rr)
{ {
ddr = initialize_data_dependence_relation (a, b, loop_nest); ddr = initialize_data_dependence_relation (a, b, loop_nest);
VEC_safe_push (ddr_p, heap, *dependence_relations, ddr); VEC_safe_push (ddr_p, heap, *dependence_relations, ddr);
...@@ -4772,11 +4772,11 @@ create_rdg_edge_for_ddr (struct graph *rdg, ddr_p ddr) ...@@ -4772,11 +4772,11 @@ create_rdg_edge_for_ddr (struct graph *rdg, ddr_p ddr)
/* Determines the type of the data dependence. */ /* Determines the type of the data dependence. */
if (DR_IS_READ (dra) && DR_IS_READ (drb)) if (DR_IS_READ (dra) && DR_IS_READ (drb))
RDGE_TYPE (e) = input_dd; RDGE_TYPE (e) = input_dd;
else if (!DR_IS_READ (dra) && !DR_IS_READ (drb)) else if (DR_IS_WRITE (dra) && DR_IS_WRITE (drb))
RDGE_TYPE (e) = output_dd; RDGE_TYPE (e) = output_dd;
else if (!DR_IS_READ (dra) && DR_IS_READ (drb)) else if (DR_IS_WRITE (dra) && DR_IS_READ (drb))
RDGE_TYPE (e) = flow_dd; RDGE_TYPE (e) = flow_dd;
else if (DR_IS_READ (dra) && !DR_IS_READ (drb)) else if (DR_IS_READ (dra) && DR_IS_WRITE (drb))
RDGE_TYPE (e) = anti_dd; RDGE_TYPE (e) = anti_dd;
} }
......
...@@ -193,6 +193,7 @@ struct data_reference ...@@ -193,6 +193,7 @@ struct data_reference
#define DR_ACCESS_FN(DR, I) VEC_index (tree, DR_ACCESS_FNS (DR), I) #define DR_ACCESS_FN(DR, I) VEC_index (tree, DR_ACCESS_FNS (DR), I)
#define DR_NUM_DIMENSIONS(DR) VEC_length (tree, DR_ACCESS_FNS (DR)) #define DR_NUM_DIMENSIONS(DR) VEC_length (tree, DR_ACCESS_FNS (DR))
#define DR_IS_READ(DR) (DR)->is_read #define DR_IS_READ(DR) (DR)->is_read
#define DR_IS_WRITE(DR) (!DR_IS_READ (DR))
#define DR_BASE_ADDRESS(DR) (DR)->innermost.base_address #define DR_BASE_ADDRESS(DR) (DR)->innermost.base_address
#define DR_OFFSET(DR) (DR)->innermost.offset #define DR_OFFSET(DR) (DR)->innermost.offset
#define DR_INIT(DR) (DR)->innermost.init #define DR_INIT(DR) (DR)->innermost.init
...@@ -473,7 +474,7 @@ ddr_is_anti_dependent (ddr_p ddr) ...@@ -473,7 +474,7 @@ ddr_is_anti_dependent (ddr_p ddr)
{ {
return (DDR_ARE_DEPENDENT (ddr) == NULL_TREE return (DDR_ARE_DEPENDENT (ddr) == NULL_TREE
&& DR_IS_READ (DDR_A (ddr)) && DR_IS_READ (DDR_A (ddr))
&& !DR_IS_READ (DDR_B (ddr)) && DR_IS_WRITE (DDR_B (ddr))
&& !same_access_functions (ddr)); && !same_access_functions (ddr));
} }
......
...@@ -533,7 +533,7 @@ write_memrefs_written_at_least_once (gimple stmt, ...@@ -533,7 +533,7 @@ write_memrefs_written_at_least_once (gimple stmt,
for (i = 0; VEC_iterate (data_reference_p, drs, i, a); i++) for (i = 0; VEC_iterate (data_reference_p, drs, i, a); i++)
if (DR_STMT (a) == stmt if (DR_STMT (a) == stmt
&& !DR_IS_READ (a)) && DR_IS_WRITE (a))
{ {
bool found = false; bool found = false;
int x = DR_WRITTEN_AT_LEAST_ONCE (a); int x = DR_WRITTEN_AT_LEAST_ONCE (a);
...@@ -546,7 +546,7 @@ write_memrefs_written_at_least_once (gimple stmt, ...@@ -546,7 +546,7 @@ write_memrefs_written_at_least_once (gimple stmt,
for (j = 0; VEC_iterate (data_reference_p, drs, j, b); j++) for (j = 0; VEC_iterate (data_reference_p, drs, j, b); j++)
if (DR_STMT (b) != stmt if (DR_STMT (b) != stmt
&& !DR_IS_READ (b) && DR_IS_WRITE (b)
&& same_data_refs_base_objects (a, b)) && same_data_refs_base_objects (a, b))
{ {
tree cb = bb_predicate (gimple_bb (DR_STMT (b))); tree cb = bb_predicate (gimple_bb (DR_STMT (b)));
......
...@@ -829,7 +829,7 @@ suitable_component_p (struct loop *loop, struct component *comp) ...@@ -829,7 +829,7 @@ suitable_component_p (struct loop *loop, struct component *comp)
gcc_assert (dominated_by_p (CDI_DOMINATORS, ba, bp)); gcc_assert (dominated_by_p (CDI_DOMINATORS, ba, bp));
bp = ba; bp = ba;
if (!DR_IS_READ (a->ref)) if (DR_IS_WRITE (a->ref))
has_write = true; has_write = true;
} }
...@@ -1197,7 +1197,7 @@ determine_roots_comp (struct loop *loop, ...@@ -1197,7 +1197,7 @@ determine_roots_comp (struct loop *loop,
FOR_EACH_VEC_ELT (dref, comp->refs, i, a) FOR_EACH_VEC_ELT (dref, comp->refs, i, a)
{ {
if (!chain || !DR_IS_READ (a->ref) if (!chain || DR_IS_WRITE (a->ref)
|| double_int_ucmp (uhwi_to_double_int (MAX_DISTANCE), || double_int_ucmp (uhwi_to_double_int (MAX_DISTANCE),
double_int_sub (a->offset, last_ofs)) <= 0) double_int_sub (a->offset, last_ofs)) <= 0)
{ {
...@@ -1611,7 +1611,7 @@ execute_load_motion (struct loop *loop, chain_p chain, bitmap tmp_vars) ...@@ -1611,7 +1611,7 @@ execute_load_motion (struct loop *loop, chain_p chain, bitmap tmp_vars)
gcc_assert (chain->type == CT_INVARIANT); gcc_assert (chain->type == CT_INVARIANT);
gcc_assert (!chain->combined); gcc_assert (!chain->combined);
FOR_EACH_VEC_ELT (dref, chain->refs, i, a) FOR_EACH_VEC_ELT (dref, chain->refs, i, a)
if (!DR_IS_READ (a->ref)) if (DR_IS_WRITE (a->ref))
n_writes++; n_writes++;
/* If there are no reads in the loop, there is nothing to do. */ /* If there are no reads in the loop, there is nothing to do. */
...@@ -1627,7 +1627,7 @@ execute_load_motion (struct loop *loop, chain_p chain, bitmap tmp_vars) ...@@ -1627,7 +1627,7 @@ execute_load_motion (struct loop *loop, chain_p chain, bitmap tmp_vars)
bool is_read = DR_IS_READ (a->ref); bool is_read = DR_IS_READ (a->ref);
mark_virtual_ops_for_renaming (a->stmt); mark_virtual_ops_for_renaming (a->stmt);
if (!DR_IS_READ (a->ref)) if (DR_IS_WRITE (a->ref))
{ {
n_writes--; n_writes--;
if (n_writes) if (n_writes)
......
...@@ -614,7 +614,7 @@ vect_analyze_data_ref_dependence (struct data_dependence_relation *ddr, ...@@ -614,7 +614,7 @@ vect_analyze_data_ref_dependence (struct data_dependence_relation *ddr,
} }
/* We do not vectorize basic blocks with write-write dependencies. */ /* We do not vectorize basic blocks with write-write dependencies. */
if (!DR_IS_READ (dra) && !DR_IS_READ (drb)) if (DR_IS_WRITE (dra) && DR_IS_WRITE (drb))
return true; return true;
/* We deal with read-write dependencies in basic blocks later (by /* We deal with read-write dependencies in basic blocks later (by
...@@ -641,7 +641,7 @@ vect_analyze_data_ref_dependence (struct data_dependence_relation *ddr, ...@@ -641,7 +641,7 @@ vect_analyze_data_ref_dependence (struct data_dependence_relation *ddr,
} }
/* Do not vectorize basic blcoks with write-write dependences. */ /* Do not vectorize basic blcoks with write-write dependences. */
if (!DR_IS_READ (dra) && !DR_IS_READ (drb)) if (DR_IS_WRITE (dra) && DR_IS_WRITE (drb))
return true; return true;
/* Check if this dependence is allowed in basic block vectorization. */ /* Check if this dependence is allowed in basic block vectorization. */
...@@ -1553,7 +1553,7 @@ vect_enhance_data_refs_alignment (loop_vec_info loop_vinfo) ...@@ -1553,7 +1553,7 @@ vect_enhance_data_refs_alignment (loop_vec_info loop_vinfo)
dr0 = dr; dr0 = dr;
} }
if (!first_store && !DR_IS_READ (dr)) if (!first_store && DR_IS_WRITE (dr))
first_store = dr; first_store = dr;
} }
...@@ -1565,7 +1565,7 @@ vect_enhance_data_refs_alignment (loop_vec_info loop_vinfo) ...@@ -1565,7 +1565,7 @@ vect_enhance_data_refs_alignment (loop_vec_info loop_vinfo)
if (!supportable_dr_alignment) if (!supportable_dr_alignment)
{ {
dr0 = dr; dr0 = dr;
if (!first_store && !DR_IS_READ (dr)) if (!first_store && DR_IS_WRITE (dr))
first_store = dr; first_store = dr;
} }
} }
...@@ -2078,7 +2078,7 @@ vect_analyze_group_access (struct data_reference *dr) ...@@ -2078,7 +2078,7 @@ vect_analyze_group_access (struct data_reference *dr)
DR_INIT (STMT_VINFO_DATA_REF ( DR_INIT (STMT_VINFO_DATA_REF (
vinfo_for_stmt (next))))) vinfo_for_stmt (next)))))
{ {
if (!DR_IS_READ (data_ref)) if (DR_IS_WRITE (data_ref))
{ {
if (vect_print_dump_info (REPORT_DETAILS)) if (vect_print_dump_info (REPORT_DETAILS))
fprintf (vect_dump, "Two store stmts share the same dr."); fprintf (vect_dump, "Two store stmts share the same dr.");
...@@ -2123,7 +2123,7 @@ vect_analyze_group_access (struct data_reference *dr) ...@@ -2123,7 +2123,7 @@ vect_analyze_group_access (struct data_reference *dr)
{ {
/* FORNOW: SLP of accesses with gaps is not supported. */ /* FORNOW: SLP of accesses with gaps is not supported. */
slp_impossible = true; slp_impossible = true;
if (!DR_IS_READ (data_ref)) if (DR_IS_WRITE (data_ref))
{ {
if (vect_print_dump_info (REPORT_DETAILS)) if (vect_print_dump_info (REPORT_DETAILS))
fprintf (vect_dump, "interleaved store with gaps"); fprintf (vect_dump, "interleaved store with gaps");
...@@ -2215,7 +2215,7 @@ vect_analyze_group_access (struct data_reference *dr) ...@@ -2215,7 +2215,7 @@ vect_analyze_group_access (struct data_reference *dr)
/* SLP: create an SLP data structure for every interleaving group of /* SLP: create an SLP data structure for every interleaving group of
stores for further analysis in vect_analyse_slp. */ stores for further analysis in vect_analyse_slp. */
if (!DR_IS_READ (dr) && !slp_impossible) if (DR_IS_WRITE (dr) && !slp_impossible)
{ {
if (loop_vinfo) if (loop_vinfo)
VEC_safe_push (gimple, heap, LOOP_VINFO_STRIDED_STORES (loop_vinfo), VEC_safe_push (gimple, heap, LOOP_VINFO_STRIDED_STORES (loop_vinfo),
......
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