Commit 1b096a0a by Daniel Berlin Committed by Daniel Berlin

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
parent 2a7cd686
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>
* tree-flow.h (struct bb_ann_d): Remove num_preds member.
......
......@@ -450,9 +450,7 @@ get_alias_set (tree t)
}
/* Check for accesses through restrict-qualified pointers. */
if (TREE_CODE (inner) == INDIRECT_REF
|| TREE_CODE (inner) == ALIGN_INDIRECT_REF
|| TREE_CODE (inner) == MISALIGNED_INDIRECT_REF)
if (INDIRECT_REF_P (inner))
{
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);
exprx = t;
}
else if (TREE_CODE (exprx) == INDIRECT_REF
|| TREE_CODE (exprx) == ALIGN_INDIRECT_REF
|| TREE_CODE (exprx) == MISALIGNED_INDIRECT_REF)
else if (INDIRECT_REF_P (exprx))
{
exprx = TREE_OPERAND (exprx, 0);
if (flag_argument_noalias < 2
......@@ -2027,9 +2023,7 @@ nonoverlapping_memrefs_p (rtx x, rtx y)
moffsety = adjust_offset_for_component_ref (expry, moffsety);
expry = t;
}
else if (TREE_CODE (expry) == INDIRECT_REF
|| TREE_CODE (expry) == ALIGN_INDIRECT_REF
|| TREE_CODE (expry) == MISALIGNED_INDIRECT_REF)
else if (INDIRECT_REF_P (expry))
{
expry = TREE_OPERAND (expry, 0);
if (flag_argument_noalias < 2
......
......@@ -1485,9 +1485,7 @@ mem_expr_equal_p (tree expr1, tree expr2)
&& mem_expr_equal_p (TREE_OPERAND (expr1, 1), /* field decl */
TREE_OPERAND (expr2, 1));
if (TREE_CODE (expr1) == INDIRECT_REF
|| TREE_CODE (expr1) == ALIGN_INDIRECT_REF
|| TREE_CODE (expr1) == MISALIGNED_INDIRECT_REF)
if (INDIRECT_REF_P (expr1))
return mem_expr_equal_p (TREE_OPERAND (expr1, 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? */
}
else if (flag_argument_noalias > 1
&& (TREE_CODE (t2) == INDIRECT_REF
|| TREE_CODE (t2) == ALIGN_INDIRECT_REF
|| TREE_CODE (t2) == MISALIGNED_INDIRECT_REF)
&& (INDIRECT_REF_P (t2))
&& TREE_CODE (TREE_OPERAND (t2, 0)) == PARM_DECL)
{
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
parameter decl. */
else if (flag_argument_noalias > 1
&& (TREE_CODE (t) == INDIRECT_REF
|| TREE_CODE (t) == ALIGN_INDIRECT_REF
|| TREE_CODE (t) == MISALIGNED_INDIRECT_REF)
&& (INDIRECT_REF_P (t))
&& TREE_CODE (TREE_OPERAND (t, 0)) == PARM_DECL)
{
expr = t;
......
......@@ -170,9 +170,8 @@ is_gimple_addressable (tree t)
return (is_gimple_id (t) || handled_component_p (t)
|| TREE_CODE (t) == REALPART_EXPR
|| TREE_CODE (t) == IMAGPART_EXPR
|| TREE_CODE (t) == INDIRECT_REF
|| TREE_CODE (t) == ALIGN_INDIRECT_REF
|| TREE_CODE (t) == MISALIGNED_INDIRECT_REF);
|| INDIRECT_REF_P (t));
}
/* 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)
|| TREE_CODE (t) == STRING_CST
|| TREE_CODE (t) == CONSTRUCTOR
|| TREE_CODE (t) == MISALIGNED_INDIRECT_REF
|| TREE_CODE (t) == ALIGN_INDIRECT_REF
|| TREE_CODE (t) == INDIRECT_REF)
|| INDIRECT_REF_P (t))
return t;
else
return NULL_TREE;
......
......@@ -503,9 +503,7 @@ find_ptr_dereference (tree *tp, int *walk_subtrees ATTRIBUTE_UNUSED, void *data)
{
tree ptr = (tree) data;
if ((TREE_CODE (*tp) == INDIRECT_REF
|| TREE_CODE (*tp) == ALIGN_INDIRECT_REF
|| TREE_CODE (*tp) == MISALIGNED_INDIRECT_REF)
if (INDIRECT_REF_P (*tp)
&& TREE_OPERAND (*tp, 0) == ptr)
return *tp;
......
......@@ -425,9 +425,7 @@ mark_stmt_if_obviously_necessary (tree stmt, bool aggressive)
if (is_global_var (lhs))
mark_stmt_necessary (stmt, true);
}
else if (TREE_CODE (lhs) == INDIRECT_REF
|| TREE_CODE (lhs) == ALIGN_INDIRECT_REF
|| TREE_CODE (lhs) == MISALIGNED_INDIRECT_REF)
else if (INDIRECT_REF_P (lhs))
{
tree ptr = TREE_OPERAND (lhs, 0);
struct ptr_info_def *pi = SSA_NAME_PTR_INFO (ptr);
......
......@@ -2435,9 +2435,7 @@ record_equivalences_from_stmt (tree stmt,
t = TREE_OPERAND (t, 0);
/* Now see if this is a pointer dereference. */
if (TREE_CODE (t) == INDIRECT_REF
|| TREE_CODE (t) == ALIGN_INDIRECT_REF
|| TREE_CODE (t) == MISALIGNED_INDIRECT_REF)
if (INDIRECT_REF_P (t))
{
tree op = TREE_OPERAND (t, 0);
......
......@@ -1114,9 +1114,7 @@ is_call_clobbered_ref (tree ref)
if (DECL_P (base))
return is_call_clobbered (base);
if (TREE_CODE (base) == INDIRECT_REF
|| TREE_CODE (base) == ALIGN_INDIRECT_REF
|| TREE_CODE (base) == MISALIGNED_INDIRECT_REF)
if (INDIRECT_REF_P (base))
{
/* Check whether the alias tags associated with the pointer
are call clobbered. */
......
......@@ -96,6 +96,12 @@ extern const enum tree_code_class tree_code_type[];
#define DECL_P(CODE)\
(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. */
#define REFERENCE_CLASS_P(CODE)\
......
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