From 77ae8b0f8f27f3337b5c96ae039fa46f08aba19c Mon Sep 17 00:00:00 2001 From: kazu Date: Mon, 24 Jan 2005 20:47:43 +0000 Subject: [PATCH] * tree-flow-inline.h (phi_arg_from_edge): Remove. * tree-flow.h: Remove the corresponding prototype. * tree-ssa-operands.h, tree-ssa-threadupdate.c, tree-ssa.c, tree-vectorizer.c: Use dest_idx instead of phi_arg_from_edge. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@94183 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/ChangeLog | 7 +++++++ gcc/tree-flow-inline.h | 9 --------- gcc/tree-flow.h | 1 - gcc/tree-ssa-operands.h | 6 ++---- gcc/tree-ssa-threadupdate.c | 2 +- gcc/tree-ssa.c | 6 ++---- gcc/tree-vectorizer.c | 7 +++---- 7 files changed, 15 insertions(+), 23 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index d0ecd6e57c3..b701448bb24 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,10 @@ +2005-01-24 Kazu Hirata + + * tree-flow-inline.h (phi_arg_from_edge): Remove. + * tree-flow.h: Remove the corresponding prototype. + * tree-ssa-operands.h, tree-ssa-threadupdate.c, tree-ssa.c, + tree-vectorizer.c: Use dest_idx instead of phi_arg_from_edge. + 2005-01-24 Jakub Jelinek PR target/17751 diff --git a/gcc/tree-flow-inline.h b/gcc/tree-flow-inline.h index b6bcb6528d9..e2204d52439 100644 --- a/gcc/tree-flow-inline.h +++ b/gcc/tree-flow-inline.h @@ -389,15 +389,6 @@ set_phi_nodes (basic_block bb, tree l) set_bb_for_stmt (phi, bb); } -/* Return the phi index number for an edge. */ -static inline int -phi_arg_from_edge (tree phi, edge e) -{ - gcc_assert (phi); - gcc_assert (TREE_CODE (phi) == PHI_NODE); - return e->dest_idx; -} - /* Mark VAR as used, so that it'll be preserved during rtl expansion. */ static inline void diff --git a/gcc/tree-flow.h b/gcc/tree-flow.h index f97435af975..55ff2e7404b 100644 --- a/gcc/tree-flow.h +++ b/gcc/tree-flow.h @@ -698,7 +698,6 @@ enum move_pos extern enum move_pos movement_possibility (tree); /* In tree-flow-inline.h */ -static inline int phi_arg_from_edge (tree, edge); static inline bool is_call_clobbered (tree); static inline void mark_call_clobbered (tree); static inline void set_is_used (tree); diff --git a/gcc/tree-ssa-operands.h b/gcc/tree-ssa-operands.h index c5e6220a20c..aa369430ca9 100644 --- a/gcc/tree-ssa-operands.h +++ b/gcc/tree-ssa-operands.h @@ -175,11 +175,9 @@ typedef stmt_operands_t *stmt_operands_p; #define SET_PHI_ARG_DEF(PHI, I, V) \ SET_USE (PHI_ARG_DEF_PTR ((PHI), (I)), (V)) #define PHI_ARG_DEF_FROM_EDGE(PHI, E) \ - PHI_ARG_DEF ((PHI), \ - phi_arg_from_edge ((PHI),(E))) + PHI_ARG_DEF ((PHI), (E)->dest_idx) #define PHI_ARG_DEF_PTR_FROM_EDGE(PHI, E) \ - PHI_ARG_DEF_PTR ((PHI), \ - phi_arg_from_edge ((PHI),(E))) + PHI_ARG_DEF_PTR ((PHI), (E)->dest_idx) extern void init_ssa_operands (void); diff --git a/gcc/tree-ssa-threadupdate.c b/gcc/tree-ssa-threadupdate.c index d5272d53374..92436a92ff7 100644 --- a/gcc/tree-ssa-threadupdate.c +++ b/gcc/tree-ssa-threadupdate.c @@ -298,7 +298,7 @@ create_edge_and_update_destination_phis (struct redirection_data *rd) associated with the outgoing edge stored in RD. */ for (phi = phi_nodes (e->dest); phi; phi = PHI_CHAIN (phi)) { - int indx = phi_arg_from_edge (phi, rd->outgoing_edge); + int indx = rd->outgoing_edge->dest_idx; add_phi_arg (phi, PHI_ARG_DEF_TREE (phi, indx), e); } } diff --git a/gcc/tree-ssa.c b/gcc/tree-ssa.c index aa6f5239eb9..d7fa593dc29 100644 --- a/gcc/tree-ssa.c +++ b/gcc/tree-ssa.c @@ -56,18 +56,16 @@ ssa_redirect_edge (edge e, basic_block dest) tree phi, next; tree list = NULL, *last = &list; tree src, dst, node; - int i; /* Remove the appropriate PHI arguments in E's destination block. */ for (phi = phi_nodes (e->dest); phi; phi = next) { next = PHI_CHAIN (phi); - i = phi_arg_from_edge (phi, e); - if (PHI_ARG_DEF (phi, i) == NULL_TREE) + if (PHI_ARG_DEF (phi, e->dest_idx) == NULL_TREE) continue; - src = PHI_ARG_DEF (phi, i); + src = PHI_ARG_DEF (phi, e->dest_idx); dst = PHI_RESULT (phi); node = build_tree_list (dst, src); *last = node; diff --git a/gcc/tree-vectorizer.c b/gcc/tree-vectorizer.c index 7b0e3f3a7ae..d0892bc3a4c 100644 --- a/gcc/tree-vectorizer.c +++ b/gcc/tree-vectorizer.c @@ -523,7 +523,7 @@ slpeel_update_phis_for_duplicate_loop (struct loop *orig_loop, { gcc_assert (new_loop_exit_e == orig_entry_e); SET_PHI_ARG_DEF (phi_orig, - phi_arg_from_edge (phi_orig, new_loop_exit_e), + new_loop_exit_e->dest_idx, new_ssa_name); } } @@ -639,8 +639,7 @@ slpeel_update_phi_nodes_for_guard (edge guard_edge, /* 3. Update phi in successor block. */ gcc_assert (PHI_ARG_DEF_FROM_EDGE (update_phi, e) == loop_arg || PHI_ARG_DEF_FROM_EDGE (update_phi, e) == guard_arg); - SET_PHI_ARG_DEF (update_phi, phi_arg_from_edge (update_phi, e), - PHI_RESULT (new_phi)); + SET_PHI_ARG_DEF (update_phi, e->dest_idx, PHI_RESULT (new_phi)); } set_phi_nodes (new_merge_bb, phi_reverse (phi_nodes (new_merge_bb))); @@ -3188,7 +3187,7 @@ vect_update_ivs_after_vectorizer (struct loop *loop, tree niters, edge update_e) /* Fix phi expressions in the successor bb. */ gcc_assert (PHI_ARG_DEF_FROM_EDGE (phi1, update_e) == PHI_ARG_DEF_FROM_EDGE (phi, EDGE_SUCC (loop->latch, 0))); - SET_PHI_ARG_DEF (phi1, phi_arg_from_edge (phi1, update_e), ni_name); + SET_PHI_ARG_DEF (phi1, update_e->dest_idx, ni_name); } } -- 2.11.4.GIT