Commit 313679b0 by Diego Novillo Committed by Diego Novillo

Move SSA_NAME annotations into tree_ssa_name.

	* tree-dfa.c (create_ssa_name_ann): Remove.
	* tree-flow-inline.h (ssa_name_ann, get_ssa_name_ann): Remove.
	* tree-flow.h (enum tree_ann_type): Remove SSA_NAME_ANN.
	(struct ssa_name_ann_d): Remove.
	(union tree_ann_d): Update.
	(ssa_name_ann_t): Remove.
	* tree-ssa-alias.c: (get_ptr_info): New local function.
	Replace references to ssa_name_ann_t with struct ptr_info_def.
	* tree-ssa-operands.c (get_expr_operands): Likewise.
	* tree.h (SSA_NAME_PTR_INFO): Define.
	(struct ptr_info_def): Declare.
	(struct tree_ssa_name): Add field 'ptr_info'.

From-SVN: r82864
parent 8041d6ab
2004-06-09 Diego Novillo <dnovillo@redhat.com>
Move SSA_NAME annotations into tree_ssa_name.
* tree-dfa.c (create_ssa_name_ann): Remove.
* tree-flow-inline.h (ssa_name_ann, get_ssa_name_ann): Remove.
* tree-flow.h (enum tree_ann_type): Remove SSA_NAME_ANN.
(struct ssa_name_ann_d): Remove.
(union tree_ann_d): Update.
(ssa_name_ann_t): Remove.
* tree-ssa-alias.c: (get_ptr_info): New local function.
Replace references to ssa_name_ann_t with struct ptr_info_def.
* tree-ssa-operands.c (get_expr_operands): Likewise.
* tree.h (SSA_NAME_PTR_INFO): Define.
(struct ptr_info_def): Declare.
(struct tree_ssa_name): Add field 'ptr_info'.
2004-06-09 Danny Smith <dannysmith@users.sourceforge.net>
* config/i386/winnt.c (i386_pe_output_labelref): Correct
......
......@@ -462,30 +462,6 @@ create_stmt_ann (tree t)
}
/* Create a new annotation for an SSA name T. */
ssa_name_ann_t
create_ssa_name_ann (tree t)
{
ssa_name_ann_t ann;
#if defined ENABLE_CHECKING
if (t == NULL_TREE
|| (t->common.ann
&& t->common.ann->common.type != SSA_NAME_ANN))
abort ();
#endif
ann = ggc_alloc (sizeof (*ann));
memset ((void *) ann, 0, sizeof (*ann));
ann->common.type = SSA_NAME_ANN;
t->common.ann = (tree_ann) ann;
return ann;
}
/* Build a temporary. Make sure and register it to be renamed. */
tree
......
......@@ -64,27 +64,6 @@ get_stmt_ann (tree stmt)
return (ann) ? ann : create_stmt_ann (stmt);
}
static inline ssa_name_ann_t
ssa_name_ann (tree t)
{
#if defined ENABLE_CHECKING
if (t == NULL_TREE
|| TREE_CODE (t) != SSA_NAME
|| (t->common.ann
&& t->common.ann->common.type != SSA_NAME_ANN))
abort ();
#endif
return (ssa_name_ann_t) t->common.ann;
}
static inline ssa_name_ann_t
get_ssa_name_ann (tree var)
{
ssa_name_ann_t ann = ssa_name_ann (var);
return (ann) ? ann : create_ssa_name_ann (var);
}
static inline enum tree_ann_type
ann_type (tree_ann ann)
......
......@@ -40,7 +40,7 @@ typedef struct basic_block_def *basic_block;
/*---------------------------------------------------------------------------
Tree annotations stored in tree_common.ann
---------------------------------------------------------------------------*/
enum tree_ann_type { TREE_ANN_COMMON, VAR_ANN, STMT_ANN, SSA_NAME_ANN };
enum tree_ann_type { TREE_ANN_COMMON, VAR_ANN, STMT_ANN };
struct tree_ann_common_d GTY(())
{
......@@ -255,50 +255,21 @@ struct stmt_ann_d GTY(())
};
struct ssa_name_ann_d GTY(())
{
struct tree_ann_common_d common;
/* Nonzero if points-to analysis couldn't determine where this pointer
is pointing to. */
unsigned int pt_anything : 1;
/* Nonzero if this pointer is the result of a call to malloc. */
unsigned int pt_malloc : 1;
/* Nonzero if the value of this pointer escapes the current function. */
unsigned int value_escapes_p : 1;
/* Set of variables that this pointer may point to. */
bitmap pt_vars;
/* If this pointer has been dereferenced, and points-to information is
more precise than type-based aliasing, indirect references to this
pointer will be represented by this memory tag, instead of the type
tag computed by TBAA. */
tree name_mem_tag;
};
union tree_ann_d GTY((desc ("ann_type ((tree_ann)&%h)")))
{
struct tree_ann_common_d GTY((tag ("TREE_ANN_COMMON"))) common;
struct var_ann_d GTY((tag ("VAR_ANN"))) decl;
struct stmt_ann_d GTY((tag ("STMT_ANN"))) stmt;
struct ssa_name_ann_d GTY((tag ("SSA_NAME_ANN"))) ssa_name;
};
typedef union tree_ann_d *tree_ann;
typedef struct var_ann_d *var_ann_t;
typedef struct stmt_ann_d *stmt_ann_t;
typedef struct ssa_name_ann_d *ssa_name_ann_t;
static inline var_ann_t var_ann (tree);
static inline var_ann_t get_var_ann (tree);
static inline stmt_ann_t stmt_ann (tree);
static inline stmt_ann_t get_stmt_ann (tree);
static inline ssa_name_ann_t ssa_name_ann (tree);
static inline ssa_name_ann_t get_ssa_name_ann (tree);
static inline enum tree_ann_type ann_type (tree_ann);
static inline basic_block bb_for_stmt (tree);
extern void set_bb_for_stmt (tree, basic_block);
......@@ -487,7 +458,6 @@ extern void dump_generic_bb (FILE *, basic_block, int, int);
/* In tree-dfa.c */
extern var_ann_t create_var_ann (tree);
extern stmt_ann_t create_stmt_ann (tree);
extern ssa_name_ann_t create_ssa_name_ann (tree);
extern tree create_phi_node (tree, basic_block);
extern void add_phi_arg (tree *, tree, edge);
extern void remove_phi_arg (tree, basic_block);
......
......@@ -886,16 +886,16 @@ get_expr_operands (tree stmt, tree *expr_p, int flags, voperands_t prev_vops)
}
else
{
ssa_name_ann_t ptr_ann = NULL;
struct ptr_info_def *pi = NULL;
/* If we have computed aliasing already, check if PTR has
flow-sensitive points-to information. */
if (TREE_CODE (ptr) == SSA_NAME
&& (ptr_ann = ssa_name_ann (ptr)) != NULL
&& ptr_ann->name_mem_tag)
&& (pi = SSA_NAME_PTR_INFO (ptr)) != NULL
&& pi->name_mem_tag)
{
/* PTR has its own memory tag. Use it. */
add_stmt_operand (&ptr_ann->name_mem_tag, stmt, flags,
add_stmt_operand (&pi->name_mem_tag, stmt, flags,
prev_vops);
}
else
......@@ -910,7 +910,7 @@ get_expr_operands (tree stmt, tree *expr_p, int flags, voperands_t prev_vops)
aliasing again. */
if (dump_file
&& TREE_CODE (ptr) == SSA_NAME
&& ptr_ann == NULL)
&& pi == NULL)
{
fprintf (dump_file,
"NOTE: no flow-sensitive alias info for ");
......
......@@ -1174,12 +1174,43 @@ struct tree_exp GTY(())
#define SSA_NAME_OCCURS_IN_ABNORMAL_PHI(NODE) \
SSA_NAME_CHECK (NODE)->common.asm_written_flag
/* Nonzero if this SSA_NAME expression is currently on the freelist of
/* Nonzero if this SSA_NAME expression is currently on the free list of
SSA_NAMES. Using NOTHROW_FLAG seems reasonably safe since throwing
has no meaning for an SSA_NAME. */
#define SSA_NAME_IN_FREE_LIST(NODE) \
SSA_NAME_CHECK (NODE)->common.nothrow_flag
/* Attributes for SSA_NAMEs for pointer-type variables. */
#define SSA_NAME_PTR_INFO(N) \
SSA_NAME_CHECK (N)->ssa_name.ptr_info
#ifndef GCC_BITMAP_H
struct bitmap_head_def;
#endif
/* Aliasing information for SSA_NAMEs representing pointer variables. */
struct ptr_info_def GTY(())
{
/* Nonzero if points-to analysis couldn't determine where this pointer
is pointing to. */
unsigned int pt_anything : 1;
/* Nonzero if this pointer is the result of a call to malloc. */
unsigned int pt_malloc : 1;
/* Nonzero if the value of this pointer escapes the current function. */
unsigned int value_escapes_p : 1;
/* Set of variables that this pointer may point to. */
struct bitmap_head_def *pt_vars;
/* If this pointer has been dereferenced, and points-to information is
more precise than type-based aliasing, indirect references to this
pointer will be represented by this memory tag, instead of the type
tag computed by TBAA. */
tree name_mem_tag;
};
struct tree_ssa_name GTY(())
{
struct tree_common common;
......@@ -1189,6 +1220,9 @@ struct tree_ssa_name GTY(())
/* SSA version number. */
unsigned int version;
/* Pointer attributes used for alias analysis. */
struct ptr_info_def *ptr_info;
};
/* In a PHI_NODE node. */
......
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