tree.h (INDIRECT_REF_P): New macro.

2004-09-29  Daniel Berlin  <dberlin@dberlin.org>

	* tree.h (INDIRECT_REF_P): New macro.
	* alias.c (get_alias_set): Use it
	(nonoverlapping_memrefs_p): Ditto.
	* emit-rtl.c (mem_expr_equal_p): Ditto.
	(set_mem_attributes_minus_bitpos): Ditto.
	(is_gimple_addressable): Ditto.
	(get_base_address): Ditto.
	* tree-ssa-alias.c (find_ptr_derefernece): Ditto.
	* tree-ssa-dce.c (mark_stmt_if_obviously_necessary): Ditto.
	* tree-ssa-dom.c (record_equivalences_from_stmt): Ditto.
	* tree-ssa-loop-im.c (is_call_clobbered_ref): Ditto.
	* tree-ssa-loop-ivopts.c (find_interesting_uses_address): Ditto.
	(add_address_candidates): Ditto.
	(rewrite_address_base): Ditto.

From-SVN: r88309
This commit is contained in:
Daniel Berlin 2004-09-29 23:08:32 +00:00 committed by Daniel Berlin
parent 2a7cd6864b
commit 1b096a0a0a
9 changed files with 36 additions and 36 deletions

View File

@ -1,3 +1,20 @@
2004-09-29 Daniel Berlin <dberlin@dberlin.org>
* tree.h (INDIRECT_REF_P): New macro.
* alias.c (get_alias_set): Use it
(nonoverlapping_memrefs_p): Ditto.
* emit-rtl.c (mem_expr_equal_p): Ditto.
(set_mem_attributes_minus_bitpos): Ditto.
(is_gimple_addressable): Ditto.
(get_base_address): Ditto.
* tree-ssa-alias.c (find_ptr_derefernece): Ditto.
* tree-ssa-dce.c (mark_stmt_if_obviously_necessary): Ditto.
* tree-ssa-dom.c (record_equivalences_from_stmt): Ditto.
* tree-ssa-loop-im.c (is_call_clobbered_ref): Ditto.
* tree-ssa-loop-ivopts.c (find_interesting_uses_address): Ditto.
(add_address_candidates): Ditto.
(rewrite_address_base): Ditto.
2004-09-30 Ben Elliston <bje@au.ibm.com> 2004-09-30 Ben Elliston <bje@au.ibm.com>
* tree-flow.h (struct bb_ann_d): Remove num_preds member. * tree-flow.h (struct bb_ann_d): Remove num_preds member.

View File

@ -450,9 +450,7 @@ get_alias_set (tree t)
} }
/* Check for accesses through restrict-qualified pointers. */ /* Check for accesses through restrict-qualified pointers. */
if (TREE_CODE (inner) == INDIRECT_REF if (INDIRECT_REF_P (inner))
|| TREE_CODE (inner) == ALIGN_INDIRECT_REF
|| TREE_CODE (inner) == MISALIGNED_INDIRECT_REF)
{ {
tree decl = find_base_decl (TREE_OPERAND (inner, 0)); tree decl = find_base_decl (TREE_OPERAND (inner, 0));
@ -2008,9 +2006,7 @@ nonoverlapping_memrefs_p (rtx x, rtx y)
moffsetx = adjust_offset_for_component_ref (exprx, moffsetx); moffsetx = adjust_offset_for_component_ref (exprx, moffsetx);
exprx = t; exprx = t;
} }
else if (TREE_CODE (exprx) == INDIRECT_REF else if (INDIRECT_REF_P (exprx))
|| TREE_CODE (exprx) == ALIGN_INDIRECT_REF
|| TREE_CODE (exprx) == MISALIGNED_INDIRECT_REF)
{ {
exprx = TREE_OPERAND (exprx, 0); exprx = TREE_OPERAND (exprx, 0);
if (flag_argument_noalias < 2 if (flag_argument_noalias < 2
@ -2027,9 +2023,7 @@ nonoverlapping_memrefs_p (rtx x, rtx y)
moffsety = adjust_offset_for_component_ref (expry, moffsety); moffsety = adjust_offset_for_component_ref (expry, moffsety);
expry = t; expry = t;
} }
else if (TREE_CODE (expry) == INDIRECT_REF else if (INDIRECT_REF_P (expry))
|| TREE_CODE (expry) == ALIGN_INDIRECT_REF
|| TREE_CODE (expry) == MISALIGNED_INDIRECT_REF)
{ {
expry = TREE_OPERAND (expry, 0); expry = TREE_OPERAND (expry, 0);
if (flag_argument_noalias < 2 if (flag_argument_noalias < 2

View File

@ -1485,9 +1485,7 @@ mem_expr_equal_p (tree expr1, tree expr2)
&& mem_expr_equal_p (TREE_OPERAND (expr1, 1), /* field decl */ && mem_expr_equal_p (TREE_OPERAND (expr1, 1), /* field decl */
TREE_OPERAND (expr2, 1)); TREE_OPERAND (expr2, 1));
if (TREE_CODE (expr1) == INDIRECT_REF if (INDIRECT_REF_P (expr1))
|| TREE_CODE (expr1) == ALIGN_INDIRECT_REF
|| TREE_CODE (expr1) == MISALIGNED_INDIRECT_REF)
return mem_expr_equal_p (TREE_OPERAND (expr1, 0), return mem_expr_equal_p (TREE_OPERAND (expr1, 0),
TREE_OPERAND (expr2, 0)); TREE_OPERAND (expr2, 0));
@ -1685,9 +1683,7 @@ set_mem_attributes_minus_bitpos (rtx ref, tree t, int objectp,
the size we got from the type? */ the size we got from the type? */
} }
else if (flag_argument_noalias > 1 else if (flag_argument_noalias > 1
&& (TREE_CODE (t2) == INDIRECT_REF && (INDIRECT_REF_P (t2))
|| TREE_CODE (t2) == ALIGN_INDIRECT_REF
|| TREE_CODE (t2) == MISALIGNED_INDIRECT_REF)
&& TREE_CODE (TREE_OPERAND (t2, 0)) == PARM_DECL) && TREE_CODE (TREE_OPERAND (t2, 0)) == PARM_DECL)
{ {
expr = t2; expr = t2;
@ -1698,9 +1694,7 @@ set_mem_attributes_minus_bitpos (rtx ref, tree t, int objectp,
/* If this is a Fortran indirect argument reference, record the /* If this is a Fortran indirect argument reference, record the
parameter decl. */ parameter decl. */
else if (flag_argument_noalias > 1 else if (flag_argument_noalias > 1
&& (TREE_CODE (t) == INDIRECT_REF && (INDIRECT_REF_P (t))
|| TREE_CODE (t) == ALIGN_INDIRECT_REF
|| TREE_CODE (t) == MISALIGNED_INDIRECT_REF)
&& TREE_CODE (TREE_OPERAND (t, 0)) == PARM_DECL) && TREE_CODE (TREE_OPERAND (t, 0)) == PARM_DECL)
{ {
expr = t; expr = t;

View File

@ -170,9 +170,8 @@ is_gimple_addressable (tree t)
return (is_gimple_id (t) || handled_component_p (t) return (is_gimple_id (t) || handled_component_p (t)
|| TREE_CODE (t) == REALPART_EXPR || TREE_CODE (t) == REALPART_EXPR
|| TREE_CODE (t) == IMAGPART_EXPR || TREE_CODE (t) == IMAGPART_EXPR
|| TREE_CODE (t) == INDIRECT_REF || INDIRECT_REF_P (t));
|| TREE_CODE (t) == ALIGN_INDIRECT_REF
|| TREE_CODE (t) == MISALIGNED_INDIRECT_REF);
} }
/* Return true if T is function invariant. Or rather a restricted /* Return true if T is function invariant. Or rather a restricted
@ -412,9 +411,7 @@ get_base_address (tree t)
if (SSA_VAR_P (t) if (SSA_VAR_P (t)
|| TREE_CODE (t) == STRING_CST || TREE_CODE (t) == STRING_CST
|| TREE_CODE (t) == CONSTRUCTOR || TREE_CODE (t) == CONSTRUCTOR
|| TREE_CODE (t) == MISALIGNED_INDIRECT_REF || INDIRECT_REF_P (t))
|| TREE_CODE (t) == ALIGN_INDIRECT_REF
|| TREE_CODE (t) == INDIRECT_REF)
return t; return t;
else else
return NULL_TREE; return NULL_TREE;

View File

@ -503,9 +503,7 @@ find_ptr_dereference (tree *tp, int *walk_subtrees ATTRIBUTE_UNUSED, void *data)
{ {
tree ptr = (tree) data; tree ptr = (tree) data;
if ((TREE_CODE (*tp) == INDIRECT_REF if (INDIRECT_REF_P (*tp)
|| TREE_CODE (*tp) == ALIGN_INDIRECT_REF
|| TREE_CODE (*tp) == MISALIGNED_INDIRECT_REF)
&& TREE_OPERAND (*tp, 0) == ptr) && TREE_OPERAND (*tp, 0) == ptr)
return *tp; return *tp;

View File

@ -425,9 +425,7 @@ mark_stmt_if_obviously_necessary (tree stmt, bool aggressive)
if (is_global_var (lhs)) if (is_global_var (lhs))
mark_stmt_necessary (stmt, true); mark_stmt_necessary (stmt, true);
} }
else if (TREE_CODE (lhs) == INDIRECT_REF else if (INDIRECT_REF_P (lhs))
|| TREE_CODE (lhs) == ALIGN_INDIRECT_REF
|| TREE_CODE (lhs) == MISALIGNED_INDIRECT_REF)
{ {
tree ptr = TREE_OPERAND (lhs, 0); tree ptr = TREE_OPERAND (lhs, 0);
struct ptr_info_def *pi = SSA_NAME_PTR_INFO (ptr); struct ptr_info_def *pi = SSA_NAME_PTR_INFO (ptr);

View File

@ -2435,9 +2435,7 @@ record_equivalences_from_stmt (tree stmt,
t = TREE_OPERAND (t, 0); t = TREE_OPERAND (t, 0);
/* Now see if this is a pointer dereference. */ /* Now see if this is a pointer dereference. */
if (TREE_CODE (t) == INDIRECT_REF if (INDIRECT_REF_P (t))
|| TREE_CODE (t) == ALIGN_INDIRECT_REF
|| TREE_CODE (t) == MISALIGNED_INDIRECT_REF)
{ {
tree op = TREE_OPERAND (t, 0); tree op = TREE_OPERAND (t, 0);

View File

@ -1114,9 +1114,7 @@ is_call_clobbered_ref (tree ref)
if (DECL_P (base)) if (DECL_P (base))
return is_call_clobbered (base); return is_call_clobbered (base);
if (TREE_CODE (base) == INDIRECT_REF if (INDIRECT_REF_P (base))
|| TREE_CODE (base) == ALIGN_INDIRECT_REF
|| TREE_CODE (base) == MISALIGNED_INDIRECT_REF)
{ {
/* Check whether the alias tags associated with the pointer /* Check whether the alias tags associated with the pointer
are call clobbered. */ are call clobbered. */

View File

@ -96,6 +96,12 @@ extern const enum tree_code_class tree_code_type[];
#define DECL_P(CODE)\ #define DECL_P(CODE)\
(TREE_CODE_CLASS (TREE_CODE (CODE)) == tcc_declaration) (TREE_CODE_CLASS (TREE_CODE (CODE)) == tcc_declaration)
/* Nonzero if CODE represents a INDIRECT_REF. */
#define INDIRECT_REF_P(CODE)\
(TREE_CODE (CODE) == INDIRECT_REF \
|| TREE_CODE (CODE) == MISALIGNED_INDIRECT_REF \
|| TREE_CODE (CODE) == ALIGN_INDIRECT_REF)
/* Nonzero if CODE represents a reference. */ /* Nonzero if CODE represents a reference. */
#define REFERENCE_CLASS_P(CODE)\ #define REFERENCE_CLASS_P(CODE)\