Commit 68b26d5c by Sebastian Pop Committed by Sebastian Pop

tree-data-ref.c (array_base_name_differ_p): Fix comments.

	* tree-data-ref.c (array_base_name_differ_p): Fix comments.  When
	the predicate cannot be computed, don't initialize the result to
	false.

From-SVN: r88479
parent 2d01edd7
2004-10-04 Sebastian Pop <pop@cri.ensmp.fr>
* tree-data-ref.c (array_base_name_differ_p): Fix comments. When
the predicate cannot be computed, don't initialize the result to
false.
2004-10-01 Eric Christopher <echristo@redhat.com> 2004-10-01 Eric Christopher <echristo@redhat.com>
* dwarf2.h (dwarf_calling_convention): Add GNU prefix to * dwarf2.h (dwarf_calling_convention): Add GNU prefix to
......
...@@ -96,12 +96,12 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA ...@@ -96,12 +96,12 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#include "tree-pass.h" #include "tree-pass.h"
#include "lambda.h" #include "lambda.h"
/* This is the simplest data dependence test: determines whether the /* This is the simplest data dependence test: determines whether the
data references A and B access the same array/region. If can't determine - data references A and B access the same array/region. Returns
return false; Otherwise, return true, and DIFFER_P will record false when the property is not computable at compile time.
the result. This utility will not be necessary when alias_sets_conflict_p Otherwise return true, and DIFFER_P will record the result. This
will be less conservative. */ utility will not be necessary when alias_sets_conflict_p will be
less conservative. */
bool bool
array_base_name_differ_p (struct data_reference *a, array_base_name_differ_p (struct data_reference *a,
...@@ -113,17 +113,16 @@ array_base_name_differ_p (struct data_reference *a, ...@@ -113,17 +113,16 @@ array_base_name_differ_p (struct data_reference *a,
tree ta = TREE_TYPE (base_a); tree ta = TREE_TYPE (base_a);
tree tb = TREE_TYPE (base_b); tree tb = TREE_TYPE (base_b);
/* Determine if same base. Example: for the array accesses
/** Determine if same base **/ a[i], b[i] or pointer accesses *a, *b, bases are a, b. */
/* array accesses: a[i],b[i] or pointer accesses: *a,*b. bases are a,b. */
if (base_a == base_b) if (base_a == base_b)
{ {
*differ_p = false; *differ_p = false;
return true; return true;
} }
/* pointer based accesses - (*p)[i],(*q)[j]. bases are (*p),(*q) */ /* For pointer based accesses, (*p)[i], (*q)[j], the bases are (*p)
and (*q) */
if (TREE_CODE (base_a) == INDIRECT_REF && TREE_CODE (base_b) == INDIRECT_REF if (TREE_CODE (base_a) == INDIRECT_REF && TREE_CODE (base_b) == INDIRECT_REF
&& TREE_OPERAND (base_a, 0) == TREE_OPERAND (base_b, 0)) && TREE_OPERAND (base_a, 0) == TREE_OPERAND (base_b, 0))
{ {
...@@ -140,21 +139,21 @@ array_base_name_differ_p (struct data_reference *a, ...@@ -140,21 +139,21 @@ array_base_name_differ_p (struct data_reference *a,
return true; return true;
} }
/* Determine if different bases. */
/** Determine if different bases **/ /* At this point we know that base_a != base_b. However, pointer
accesses of the form x=(*p) and y=(*q), which bases are p and q,
/* at this point we know that base_a != base_b. However, pointer accesses may still pointing to the same base. In SSAed GIMPLE p and q will
of the form x=(*p) and y=(*q), which bases are p and q, may still by pointing be SSA_NAMES in this case. Therefore, here we check if it's
to the same base. In SSAed GIMPLE p and q will be SSA_NAMES in this case. really two diferent declarations. */
Therefore, here we check if it's really two different declarations. */
if (TREE_CODE (base_a) == VAR_DECL && TREE_CODE (base_b) == VAR_DECL) if (TREE_CODE (base_a) == VAR_DECL && TREE_CODE (base_b) == VAR_DECL)
{ {
*differ_p = true; *differ_p = true;
return true; return true;
} }
/* compare two record/union bases s.a and t.b: /* Compare two record/union bases s.a and t.b: s != t or (a != b and
s != t or (a != b and s and t are not unions) */ s and t are not unions). */
if (TREE_CODE (base_a) == COMPONENT_REF && TREE_CODE (base_b) == COMPONENT_REF if (TREE_CODE (base_a) == COMPONENT_REF && TREE_CODE (base_b) == COMPONENT_REF
&& ((TREE_CODE (TREE_OPERAND (base_a, 0)) == VAR_DECL && ((TREE_CODE (TREE_OPERAND (base_a, 0)) == VAR_DECL
&& TREE_CODE (TREE_OPERAND (base_b, 0)) == VAR_DECL && TREE_CODE (TREE_OPERAND (base_b, 0)) == VAR_DECL
...@@ -167,7 +166,7 @@ array_base_name_differ_p (struct data_reference *a, ...@@ -167,7 +166,7 @@ array_base_name_differ_p (struct data_reference *a,
return true; return true;
} }
/* compare a record/union access and an array access. */ /* Compare a record/union access and an array access. */
if ((TREE_CODE (base_a) == VAR_DECL if ((TREE_CODE (base_a) == VAR_DECL
&& (TREE_CODE (base_b) == COMPONENT_REF && (TREE_CODE (base_b) == COMPONENT_REF
&& TREE_CODE (TREE_OPERAND (base_b, 0)) == VAR_DECL)) && TREE_CODE (TREE_OPERAND (base_b, 0)) == VAR_DECL))
...@@ -185,10 +184,9 @@ array_base_name_differ_p (struct data_reference *a, ...@@ -185,10 +184,9 @@ array_base_name_differ_p (struct data_reference *a,
return true; return true;
} }
/* An insn writing through a restricted pointer is "independent" of any /* An instruction writing through a restricted pointer is
insn reading or writing through a different pointer, in the same "independent" of any instruction reading or writing through a
block/scope. different pointer, in the same block/scope. */
*/
if ((TREE_CODE (ta) == POINTER_TYPE && TYPE_RESTRICT (ta) if ((TREE_CODE (ta) == POINTER_TYPE && TYPE_RESTRICT (ta)
&& !DR_IS_READ(a)) && !DR_IS_READ(a))
|| (TREE_CODE (tb) == POINTER_TYPE && TYPE_RESTRICT (tb) || (TREE_CODE (tb) == POINTER_TYPE && TYPE_RESTRICT (tb)
...@@ -198,7 +196,6 @@ array_base_name_differ_p (struct data_reference *a, ...@@ -198,7 +196,6 @@ array_base_name_differ_p (struct data_reference *a,
return true; return true;
} }
*differ_p = false; /* Don't know, but be conservative. */
return false; return false;
} }
......
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