tree-flow-inline.h (get_def_ops, [...]): Add operand structure reference.

2004-08-11  Andrew MacLeod  <amacleod@redhat.com>

	* tree-flow-inline.h (get_def_ops, get_use_ops, get_v_may_def_ops,
	get_vuse_ops,get_v_must_def_ops): Add operand structure reference.
	(get_v_may_def_result_ptr, get_v_may_def_op_ptr): New access struct.
	(start_ssa_stmt_operands): Delete.
	* tree-flow.h (struct stmt_ann_d): Replace operand vectors with new
	struct stmt_operands_d.
	(build_ssa_operands): New extern entry point.
	* tree-ssa-dom.c (record_equivalences_from_stmt): Remove operand
	building code, replace with create_ssa_artficial_load_stmt().
	* tree-ssa-operands.c (struct voperands_d): Delete.
	(allocate_v_may_def_optype): Allocate v_may_def_operand_type_t vector.
	(allocate_v_must_def_optype): Use sizeof (tree), not sizeof (tree *).
	(free_uses, free_defs, free_vuses, free_v_may_defs,
	free_v_must_defs): Remove dealloc parameter.
	(remove_vuses, remove_v_may_def, remove_v_must_defs): Delete.
	(finalize_ssa_defs, finalize_ssa_uses, finalize_ssa_v_may_defs,
	finalize_ssa_vuses, finalize_ssa_v_must_defs): Perform all operand
	vector comparisons, ssa_name reuse, and allocations here.
	(verify_start_operands): Delete.
	(finalize_ssa_stmt_operands): Set new operands by calling finalize
	routines.
	(start_ssa_stmt_operands): Move from tree-flow-inline.h.
	(append_def, append_usei): Simplify to simple accumulation.
	(append_v_may_def, append_vuse, append_v_must_def): Simplify to avoiding
	duplicates and simple accumulation.
	(free_ssa_operands): Free vectors in a stmt_operand structure.
	(build_ssa_operands): New. Create a new stmt_operand structure from
	a stmt and an old set of stmt_operands.
	(get_stmt_operands): Simplify and call build_ssa_operands.
	(get_expr_operands, get_asm_expr_operands, get_indirect_ref_operands,
	get_call_expr_operands, add_stmt_operand, add_call_clobber_ops,
	add_call_read_ops): Don't pass prev_vops around anymore.
	(note_addressable): Return if no stmt annotation.
	(copy_virtual_operands): Access v_may_def operands through a struct.
	(create_ssa_artficial_load_stmt): New.  Create a load stmt for DOM's
	hash tables without treating the stmt as a real stmt.
	* tree-ssa-operands.h (struct v_may_def_operand_type): New.  Access
	v_may_def def and use through a struct instead of 2 array elements.
	(struct v_may_def_optype_d): Use v_may_def_operand_type.
	(struct stmt_operands_d): New.  Struct for storing all operand vectors.

From-SVN: r85807
This commit is contained in:
Andrew MacLeod 2004-08-11 17:50:47 +00:00 committed by Andrew Macleod
parent 3ec0f30209
commit 1a24f92f6a
6 changed files with 771 additions and 578 deletions

View File

@ -1,3 +1,46 @@
2004-08-11 Andrew MacLeod <amacleod@redhat.com>
* tree-flow-inline.h (get_def_ops, get_use_ops, get_v_may_def_ops,
get_vuse_ops,get_v_must_def_ops): Add operand structure reference.
(get_v_may_def_result_ptr, get_v_may_def_op_ptr): New access struct.
(start_ssa_stmt_operands): Delete.
* tree-flow.h (struct stmt_ann_d): Replace operand vectors with new
struct stmt_operands_d.
(build_ssa_operands): New extern entry point.
* tree-ssa-dom.c (record_equivalences_from_stmt): Remove operand
building code, replace with create_ssa_artficial_load_stmt().
* tree-ssa-operands.c (struct voperands_d): Delete.
(allocate_v_may_def_optype): Allocate v_may_def_operand_type_t vector.
(allocate_v_must_def_optype): Use sizeof (tree), not sizeof (tree *).
(free_uses, free_defs, free_vuses, free_v_may_defs,
free_v_must_defs): Remove dealloc parameter.
(remove_vuses, remove_v_may_def, remove_v_must_defs): Delete.
(finalize_ssa_defs, finalize_ssa_uses, finalize_ssa_v_may_defs,
finalize_ssa_vuses, finalize_ssa_v_must_defs): Perform all operand
vector comparisons, ssa_name reuse, and allocations here.
(verify_start_operands): Delete.
(finalize_ssa_stmt_operands): Set new operands by calling finalize
routines.
(start_ssa_stmt_operands): Move from tree-flow-inline.h.
(append_def, append_usei): Simplify to simple accumulation.
(append_v_may_def, append_vuse, append_v_must_def): Simplify to avoiding
duplicates and simple accumulation.
(free_ssa_operands): Free vectors in a stmt_operand structure.
(build_ssa_operands): New. Create a new stmt_operand structure from
a stmt and an old set of stmt_operands.
(get_stmt_operands): Simplify and call build_ssa_operands.
(get_expr_operands, get_asm_expr_operands, get_indirect_ref_operands,
get_call_expr_operands, add_stmt_operand, add_call_clobber_ops,
add_call_read_ops): Don't pass prev_vops around anymore.
(note_addressable): Return if no stmt annotation.
(copy_virtual_operands): Access v_may_def operands through a struct.
(create_ssa_artficial_load_stmt): New. Create a load stmt for DOM's
hash tables without treating the stmt as a real stmt.
* tree-ssa-operands.h (struct v_may_def_operand_type): New. Access
v_may_def def and use through a struct instead of 2 array elements.
(struct v_may_def_optype_d): Use v_may_def_operand_type.
(struct stmt_operands_d): New. Struct for storing all operand vectors.
2004-08-11 Nick Clifton <nickc@redhat.com>
* config/arm/arm.c (arm_is_longcall_p): Update comment describing

View File

@ -169,7 +169,7 @@ stmt_modified_p (tree t)
static inline def_optype
get_def_ops (stmt_ann_t ann)
{
return ann ? ann->def_ops : NULL;
return ann ? ann->operands.def_ops : NULL;
}
/* Return the uses present in ANN, a statement annotation.
@ -177,7 +177,7 @@ get_def_ops (stmt_ann_t ann)
static inline use_optype
get_use_ops (stmt_ann_t ann)
{
return ann ? ann->use_ops : NULL;
return ann ? ann->operands.use_ops : NULL;
}
/* Return the virtual may-defs present in ANN, a statement
@ -186,7 +186,7 @@ get_use_ops (stmt_ann_t ann)
static inline v_may_def_optype
get_v_may_def_ops (stmt_ann_t ann)
{
return ann ? ann->v_may_def_ops : NULL;
return ann ? ann->operands.v_may_def_ops : NULL;
}
/* Return the virtual uses present in ANN, a statement annotation.
@ -194,7 +194,7 @@ get_v_may_def_ops (stmt_ann_t ann)
static inline vuse_optype
get_vuse_ops (stmt_ann_t ann)
{
return ann ? ann->vuse_ops : NULL;
return ann ? ann->operands.vuse_ops : NULL;
}
/* Return the virtual must-defs present in ANN, a statement
@ -202,7 +202,7 @@ get_vuse_ops (stmt_ann_t ann)
static inline v_must_def_optype
get_v_must_def_ops (stmt_ann_t ann)
{
return ann ? ann->v_must_def_ops : NULL;
return ann ? ann->operands.v_must_def_ops : NULL;
}
/* Return the tree pointer to by USE. */
@ -252,7 +252,7 @@ get_v_may_def_result_ptr(v_may_def_optype v_may_defs, unsigned int index)
if (index >= v_may_defs->num_v_may_defs)
abort();
#endif
op.def = &(v_may_defs->v_may_defs[index * 2]);
op.def = &(v_may_defs->v_may_defs[index].def);
return op;
}
@ -266,7 +266,7 @@ get_v_may_def_op_ptr(v_may_def_optype v_may_defs, unsigned int index)
if (index >= v_may_defs->num_v_may_defs)
abort();
#endif
op.use = &(v_may_defs->v_may_defs[index * 2 + 1]);
op.use = &(v_may_defs->v_may_defs[index].use);
return op;
}
@ -315,15 +315,6 @@ get_phi_arg_def_ptr (tree phi, int i)
return op;
}
/* Mark the beginning of changes to the SSA operands for STMT. */
static inline void
start_ssa_stmt_operands (tree stmt ATTRIBUTE_UNUSED)
{
#ifdef ENABLE_CHECKING
verify_start_operands (stmt);
#endif
}
/* Return the bitmap of addresses taken by STMT, or NULL if it takes
no addresses. */
static inline bitmap

View File

@ -266,14 +266,7 @@ struct stmt_ann_d GTY(())
/* Basic block that contains this statement. */
basic_block GTY ((skip (""))) bb;
/* Statement operands. */
struct def_optype_d * GTY (()) def_ops;
struct use_optype_d * GTY (()) use_ops;
/* Virtual operands (V_MAY_DEF, VUSE, and V_MUST_DEF). */
struct v_may_def_optype_d * GTY (()) v_may_def_ops;
struct vuse_optype_d * GTY (()) vuse_ops;
struct v_must_def_optype_d * GTY (()) v_must_def_ops;
struct stmt_operands_d operands;
/* Dataflow information. */
dataflow_t df;
@ -690,6 +683,10 @@ void vn_delete (void);
/* In tree-sra.c */
void insert_edge_copies (tree stmt, basic_block bb);
/* In tree-ssa-operands.c */
extern void build_ssa_operands (tree, stmt_ann_t, stmt_operands_p,
stmt_operands_p);
#include "tree-flow-inline.h"
#endif /* _TREE_FLOW_H */

View File

@ -2564,7 +2564,6 @@ record_equivalences_from_stmt (tree stmt,
{
tree rhs = TREE_OPERAND (stmt, 1);
tree new;
size_t j;
/* FIXME: If the LHS of the assignment is a bitfield and the RHS
is a constant, we need to adjust the constant to fit into the
@ -2589,39 +2588,10 @@ record_equivalences_from_stmt (tree stmt,
if (rhs)
{
v_may_def_optype v_may_defs = V_MAY_DEF_OPS (ann);
v_must_def_optype v_must_defs = V_MUST_DEF_OPS (ann);
/* Build a new statement with the RHS and LHS exchanged. */
new = build (MODIFY_EXPR, TREE_TYPE (stmt), rhs, lhs);
/* Get an annotation and set up the real operands. */
get_stmt_ann (new);
get_stmt_operands (new);
/* Clear out the virtual operands on the new statement, we are
going to set them explicitly below. */
remove_vuses (new);
remove_v_may_defs (new);
remove_v_must_defs (new);
start_ssa_stmt_operands (new);
/* For each VDEF on the original statement, we want to create a
VUSE of the V_MAY_DEF result or V_MUST_DEF op on the new
statement. */
for (j = 0; j < NUM_V_MAY_DEFS (v_may_defs); j++)
{
tree op = V_MAY_DEF_RESULT (v_may_defs, j);
add_vuse (op, new);
}
for (j = 0; j < NUM_V_MUST_DEFS (v_must_defs); j++)
{
tree op = V_MUST_DEF_OP (v_must_defs, j);
add_vuse (op, new);
}
finalize_ssa_stmt_operands (new);
create_ssa_artficial_load_stmt (&(ann->operands), new);
/* Finally enter the statement into the available expression
table. */

File diff suppressed because it is too large Load Diff

View File

@ -55,11 +55,19 @@ typedef struct use_optype_d GTY(())
typedef use_optype_t *use_optype;
/* Operand type which stores a def and a use tree. */
typedef struct v_may_def_operand_type GTY(())
{
tree def;
tree use;
} v_may_def_operand_type_t;
/* This represents the MAY_DEFS for a stmt. */
typedef struct v_may_def_optype_d GTY(())
{
unsigned num_v_may_defs;
tree GTY((length ("%h.num_v_may_defs * 2"))) v_may_defs[1];
struct v_may_def_operand_type GTY((length ("%h.num_v_may_defs")))
v_may_defs[1];
} v_may_def_optype_t;
typedef v_may_def_optype_t *v_may_def_optype;
@ -82,6 +90,21 @@ typedef struct v_must_def_optype_d GTY(())
typedef v_must_def_optype_t *v_must_def_optype;
/* This represents the operand cache fora stmt. */
typedef struct stmt_operands_d GTY(())
{
/* Statement operands. */
struct def_optype_d * GTY (()) def_ops;
struct use_optype_d * GTY (()) use_ops;
/* Virtual operands (V_MAY_DEF, VUSE, and V_MUST_DEF). */
struct v_may_def_optype_d * GTY (()) v_may_def_ops;
struct vuse_optype_d * GTY (()) vuse_ops;
struct v_must_def_optype_d * GTY (()) v_must_def_ops;
} stmt_operands_t;
typedef stmt_operands_t *stmt_operands_p;
#define USE_FROM_PTR(OP) get_use_from_ptr (OP)
#define DEF_FROM_PTR(OP) get_def_from_ptr (OP)
#define SET_USE(OP, V) ((*((OP).use)) = (V))
@ -157,13 +180,8 @@ typedef v_must_def_optype_t *v_must_def_optype;
extern void init_ssa_operands (void);
extern void fini_ssa_operands (void);
extern void verify_start_operands (tree);
extern void finalize_ssa_stmt_operands (tree);
void add_vuse (tree, tree);
extern void get_stmt_operands (tree);
extern void remove_vuses (tree);
extern void remove_v_may_defs (tree);
extern void remove_v_must_defs (tree);
extern void copy_virtual_operands (tree, tree);
extern void create_ssa_artficial_load_stmt (stmt_operands_p, tree);
#endif /* GCC_TREE_SSA_OPERANDS_H */