Commit a3698dfc by Jakub Jelinek Committed by Jakub Jelinek

tree-data-ref.c (struct data_ref_loc_d): Replace pos field with ref.

	* tree-data-ref.c (struct data_ref_loc_d): Replace pos field with ref.
	(get_references_in_stmt): Don't record operand addresses, but
	operands themselves.
	(find_data_references_in_stmt, graphite_find_data_references_in_stmt):
	Adjust for the pos -> ref change.

From-SVN: r205760
parent bbafacb6
2013-12-06 Jakub Jelinek <jakub@redhat.com>
* tree-data-ref.c (struct data_ref_loc_d): Replace pos field with ref.
(get_references_in_stmt): Don't record operand addresses, but
operands themselves.
(find_data_references_in_stmt, graphite_find_data_references_in_stmt):
Adjust for the pos -> ref change.
2013-12-06 H.J. Lu <hongjiu.lu@intel.com> 2013-12-06 H.J. Lu <hongjiu.lu@intel.com>
* config.gcc: Change --with-cpu=ia to --with-cpu=intel. * config.gcc: Change --with-cpu=ia to --with-cpu=intel.
...@@ -4320,8 +4320,8 @@ compute_all_dependences (vec<data_reference_p> datarefs, ...@@ -4320,8 +4320,8 @@ compute_all_dependences (vec<data_reference_p> datarefs,
typedef struct data_ref_loc_d typedef struct data_ref_loc_d
{ {
/* Position of the memory reference. */ /* The memory reference. */
tree *pos; tree ref;
/* True if the memory reference is read. */ /* True if the memory reference is read. */
bool is_read; bool is_read;
...@@ -4336,7 +4336,7 @@ get_references_in_stmt (gimple stmt, vec<data_ref_loc, va_heap> *references) ...@@ -4336,7 +4336,7 @@ get_references_in_stmt (gimple stmt, vec<data_ref_loc, va_heap> *references)
{ {
bool clobbers_memory = false; bool clobbers_memory = false;
data_ref_loc ref; data_ref_loc ref;
tree *op0, *op1; tree op0, op1;
enum gimple_code stmt_code = gimple_code (stmt); enum gimple_code stmt_code = gimple_code (stmt);
/* ASM_EXPR and CALL_EXPR may embed arbitrary side effects. /* ASM_EXPR and CALL_EXPR may embed arbitrary side effects.
...@@ -4369,15 +4369,15 @@ get_references_in_stmt (gimple stmt, vec<data_ref_loc, va_heap> *references) ...@@ -4369,15 +4369,15 @@ get_references_in_stmt (gimple stmt, vec<data_ref_loc, va_heap> *references)
if (stmt_code == GIMPLE_ASSIGN) if (stmt_code == GIMPLE_ASSIGN)
{ {
tree base; tree base;
op0 = gimple_assign_lhs_ptr (stmt); op0 = gimple_assign_lhs (stmt);
op1 = gimple_assign_rhs1_ptr (stmt); op1 = gimple_assign_rhs1 (stmt);
if (DECL_P (*op1) if (DECL_P (op1)
|| (REFERENCE_CLASS_P (*op1) || (REFERENCE_CLASS_P (op1)
&& (base = get_base_address (*op1)) && (base = get_base_address (op1))
&& TREE_CODE (base) != SSA_NAME)) && TREE_CODE (base) != SSA_NAME))
{ {
ref.pos = op1; ref.ref = op1;
ref.is_read = true; ref.is_read = true;
references->safe_push (ref); references->safe_push (ref);
} }
...@@ -4386,16 +4386,16 @@ get_references_in_stmt (gimple stmt, vec<data_ref_loc, va_heap> *references) ...@@ -4386,16 +4386,16 @@ get_references_in_stmt (gimple stmt, vec<data_ref_loc, va_heap> *references)
{ {
unsigned i, n; unsigned i, n;
op0 = gimple_call_lhs_ptr (stmt); op0 = gimple_call_lhs (stmt);
n = gimple_call_num_args (stmt); n = gimple_call_num_args (stmt);
for (i = 0; i < n; i++) for (i = 0; i < n; i++)
{ {
op1 = gimple_call_arg_ptr (stmt, i); op1 = gimple_call_arg (stmt, i);
if (DECL_P (*op1) if (DECL_P (op1)
|| (REFERENCE_CLASS_P (*op1) && get_base_address (*op1))) || (REFERENCE_CLASS_P (op1) && get_base_address (op1)))
{ {
ref.pos = op1; ref.ref = op1;
ref.is_read = true; ref.is_read = true;
references->safe_push (ref); references->safe_push (ref);
} }
...@@ -4404,11 +4404,11 @@ get_references_in_stmt (gimple stmt, vec<data_ref_loc, va_heap> *references) ...@@ -4404,11 +4404,11 @@ get_references_in_stmt (gimple stmt, vec<data_ref_loc, va_heap> *references)
else else
return clobbers_memory; return clobbers_memory;
if (*op0 if (op0
&& (DECL_P (*op0) && (DECL_P (op0)
|| (REFERENCE_CLASS_P (*op0) && get_base_address (*op0)))) || (REFERENCE_CLASS_P (op0) && get_base_address (op0))))
{ {
ref.pos = op0; ref.ref = op0;
ref.is_read = false; ref.is_read = false;
references->safe_push (ref); references->safe_push (ref);
} }
...@@ -4435,7 +4435,7 @@ find_data_references_in_stmt (struct loop *nest, gimple stmt, ...@@ -4435,7 +4435,7 @@ find_data_references_in_stmt (struct loop *nest, gimple stmt,
FOR_EACH_VEC_ELT (references, i, ref) FOR_EACH_VEC_ELT (references, i, ref)
{ {
dr = create_data_ref (nest, loop_containing_stmt (stmt), dr = create_data_ref (nest, loop_containing_stmt (stmt),
*ref->pos, stmt, ref->is_read); ref->ref, stmt, ref->is_read);
gcc_assert (dr != NULL); gcc_assert (dr != NULL);
datarefs->safe_push (dr); datarefs->safe_push (dr);
} }
...@@ -4464,7 +4464,7 @@ graphite_find_data_references_in_stmt (loop_p nest, loop_p loop, gimple stmt, ...@@ -4464,7 +4464,7 @@ graphite_find_data_references_in_stmt (loop_p nest, loop_p loop, gimple stmt,
FOR_EACH_VEC_ELT (references, i, ref) FOR_EACH_VEC_ELT (references, i, ref)
{ {
dr = create_data_ref (nest, loop, *ref->pos, stmt, ref->is_read); dr = create_data_ref (nest, loop, ref->ref, stmt, ref->is_read);
gcc_assert (dr != NULL); gcc_assert (dr != NULL);
datarefs->safe_push (dr); datarefs->safe_push (dr);
} }
......
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