This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[patch] tree-ssa-operands.c: Remove realloc_*.
- From: Kazu Hirata <kazu at codesourcery dot com>
- To: gcc-patches at gcc dot gnu dot org
- Cc: amacleod at redhat dot com
- Date: Sat, 7 Jul 2007 07:09:14 -0700
- Subject: [patch] tree-ssa-operands.c: Remove realloc_*.
Hi,
Attached is a patch to remove realloc_vop, realloc_vdef and
realloc_vuse as they are unused.
Built cc1. OK to apply?
Kazu Hirata
2007-07-07 Kazu Hirata <kazu@codesourcery.com>
* tree-ssa-operands.c (realloc_vop, realloc_vdef,
realloc_vuse): Remove.
* tree-ssa-operands.h: Remove the prototype for realloc_vdef
and realloc_vuse.
Index: tree-ssa-operands.c
===================================================================
--- tree-ssa-operands.c (revision 126440)
+++ tree-ssa-operands.c (working copy)
@@ -669,99 +669,6 @@ add_vdef_op (tree stmt, tree op, int num
}
-/* Reallocate the virtual operand PTR so that it has NUM_ELEM use slots. ROOT
- is the head of the operand list it belongs to. */
-
-static inline struct voptype_d *
-realloc_vop (struct voptype_d *ptr, unsigned int num_elem,
- struct voptype_d **root)
-{
- unsigned int x, lim;
- tree stmt, val;
- struct voptype_d *ret, *tmp;
-
- if (VUSE_VECT_NUM_ELEM (ptr->usev) == num_elem)
- return ptr;
-
- val = VUSE_OP (ptr, 0);
- if (TREE_CODE (val) == SSA_NAME)
- val = SSA_NAME_VAR (val);
-
- stmt = USE_STMT (VUSE_OP_PTR (ptr, 0));
-
- /* Delink all the existing uses. */
- for (x = 0; x < VUSE_VECT_NUM_ELEM (ptr->usev); x++)
- {
- use_operand_p use_p = VUSE_OP_PTR (ptr, x);
- delink_imm_use (use_p);
- }
-
- /* If we want less space, simply use this one, and shrink the size. */
- if (VUSE_VECT_NUM_ELEM (ptr->usev) > num_elem)
- {
- VUSE_VECT_NUM_ELEM (ptr->usev) = num_elem;
- return ptr;
- }
-
- /* It is growing. Allocate a new one and replace the old one. */
- ret = add_vuse_op (stmt, val, num_elem, ptr);
-
- /* Clear PTR and add its memory to the free list. */
- lim = VUSE_VECT_NUM_ELEM (ptr->usev);
- memset (ptr, 0,
- sizeof (struct voptype_d) + sizeof (vuse_element_t) * (lim- 1));
- add_vop_to_freelist (ptr);
-
- /* Now simply remove the old one. */
- if (*root == ptr)
- {
- *root = ret;
- return ret;
- }
- else
- for (tmp = *root;
- tmp != NULL && tmp->next != ptr;
- tmp = tmp->next)
- {
- tmp->next = ret;
- return ret;
- }
-
- /* The pointer passed in isn't in STMT's VDEF lists. */
- gcc_unreachable ();
-}
-
-
-/* Reallocate the PTR vdef so that it has NUM_ELEM use slots. */
-
-struct voptype_d *
-realloc_vdef (struct voptype_d *ptr, unsigned int num_elem)
-{
- tree val, stmt;
- struct voptype_d *ret;
-
- val = VDEF_RESULT (ptr);
- stmt = USE_STMT (VDEF_OP_PTR (ptr, 0));
- ret = realloc_vop (ptr, num_elem, &(VDEF_OPS (stmt)));
- VDEF_RESULT (ret) = val;
- return ret;
-}
-
-
-/* Reallocate the PTR vuse so that it has NUM_ELEM use slots. */
-
-struct voptype_d *
-realloc_vuse (struct voptype_d *ptr, unsigned int num_elem)
-{
- tree stmt;
- struct voptype_d *ret;
-
- stmt = USE_STMT (VUSE_OP_PTR (ptr, 0));
- ret = realloc_vop (ptr, num_elem, &(VUSE_OPS (stmt)));
- return ret;
-}
-
-
/* Takes elements from build_defs and turns them into def operands of STMT.
TODO -- Make build_defs VEC of tree *. */
Index: tree-ssa-operands.h
===================================================================
--- tree-ssa-operands.h (revision 126440)
+++ tree-ssa-operands.h (working copy)
@@ -203,9 +203,6 @@ typedef struct stmt_operands_d *stmt_ope
#define PHI_ARG_INDEX_FROM_USE(USE) phi_arg_index_from_use (USE)
-extern struct voptype_d *realloc_vdef (struct voptype_d *, unsigned int);
-extern struct voptype_d *realloc_vuse (struct voptype_d *, unsigned int);
-
extern void init_ssa_operands (void);
extern void fini_ssa_operands (void);
extern void free_ssa_operands (stmt_operands_p);