diff options
author | dnovillo <dnovillo@138bc75d-0d04-0410-961f-82ee72b054a4> | 2006-12-11 17:50:53 +0000 |
---|---|---|
committer | dnovillo <dnovillo@138bc75d-0d04-0410-961f-82ee72b054a4> | 2006-12-11 17:50:53 +0000 |
commit | 17889f9dfc42f96a098ba28020fbe427b1686000 (patch) | |
tree | c10c3e1e438be55ec7fabae41f6449845ab479fc /gcc/tree-phinodes.c | |
parent | c69b8abd763922046e43393b2d7f02fd8ed269fe (diff) | |
download | gcc-17889f9dfc42f96a098ba28020fbe427b1686000.tar.gz |
* tree-scalar-evolution.c (scev_const_prop):
* tree-phinodes.c (remove_phi_node): Add argument
RELEASE_LHS_P. If given, release the SSA name on the LHS of
the PHI node.
Update all users.
* tree-ssa-dce.c: Remove forward declarations for static
functions. Re-arrange functions bodies as needed.
(find_obviously_necessary_stmts): Never mark PHI nodes as
obviously necessary.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@119740 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree-phinodes.c')
-rw-r--r-- | gcc/tree-phinodes.c | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/gcc/tree-phinodes.c b/gcc/tree-phinodes.c index 98b011f89e6..344770e700a 100644 --- a/gcc/tree-phinodes.c +++ b/gcc/tree-phinodes.c @@ -233,6 +233,7 @@ make_phi_node (tree var, int len) imm->next = NULL; imm->stmt = phi; } + return phi; } @@ -301,7 +302,6 @@ resize_phi_node (tree *phi, int len) imm->stmt = new_phi; } - *phi = new_phi; } @@ -343,6 +343,7 @@ reserve_phi_args_for_new_edge (basic_block bb) } } + /* Create a new PHI node for variable VAR at basic block BB. */ tree @@ -362,6 +363,7 @@ create_phi_node (tree var, basic_block bb) return phi; } + /* Add a new argument to PHI node PHI. DEF is the incoming reaching definition and E is the edge through which DEF reaches PHI. The new argument is added at the end of the argument list. @@ -394,6 +396,7 @@ add_phi_arg (tree phi, tree def, edge e) SET_PHI_ARG_DEF (phi, e->dest_idx, def); } + /* Remove the Ith argument from PHI's argument list. This routine implements removal by swapping the last alternative with the alternative we want to delete and then shrinking the vector, which @@ -406,7 +409,6 @@ remove_phi_arg_num (tree phi, int i) gcc_assert (i < num_elem); - /* Delink the item which is being removed. */ delink_imm_use (&(PHI_ARG_IMM_USE_NODE (phi, i))); @@ -428,6 +430,7 @@ remove_phi_arg_num (tree phi, int i) PHI_NUM_ARGS (phi)--; } + /* Remove all PHI arguments associated with edge E. */ void @@ -439,11 +442,14 @@ remove_phi_args (edge e) remove_phi_arg_num (phi, e->dest_idx); } + /* Remove PHI node PHI from basic block BB. If PREV is non-NULL, it is - used as the node immediately before PHI in the linked list. */ + used as the node immediately before PHI in the linked list. If + RELEASE_LHS_P is true, the LHS of this PHI node is released into + the free pool of SSA names. */ void -remove_phi_node (tree phi, tree prev) +remove_phi_node (tree phi, tree prev, bool release_lhs_p) { tree *loc; @@ -465,7 +471,8 @@ remove_phi_node (tree phi, tree prev) /* If we are deleting the PHI node, then we should release the SSA_NAME node so that it can be reused. */ release_phi_node (phi); - release_ssa_name (PHI_RESULT (phi)); + if (release_lhs_p) + release_ssa_name (PHI_RESULT (phi)); } |