diff options
author | Kazu Hirata <kazu@cs.umass.edu> | 2005-04-26 16:53:53 +0000 |
---|---|---|
committer | Kazu Hirata <kazu@gcc.gnu.org> | 2005-04-26 16:53:53 +0000 |
commit | d0e12fc607b600a8d547e2027011dc287c019bbd (patch) | |
tree | 2b0545c5bdedb28e31c5f7b81a273a5f4530c917 /gcc | |
parent | 70a390bbb670c358e1f933ef8e75a3a3d7ca8fa5 (diff) | |
download | gcc-d0e12fc607b600a8d547e2027011dc287c019bbd.zip gcc-d0e12fc607b600a8d547e2027011dc287c019bbd.tar.gz gcc-d0e12fc607b600a8d547e2027011dc287c019bbd.tar.bz2 |
tree-cfg.c (lv_adjust_loop_header_phi): Speed up moving a call to find_edge outside a loop to go through a PHI chain.
* tree-cfg.c (lv_adjust_loop_header_phi): Speed up moving a
call to find_edge outside a loop to go through a PHI chain.
From-SVN: r98776
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/tree-cfg.c | 14 |
2 files changed, 12 insertions, 7 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 2d57e1f..4cf31bc 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2005-04-26 Kazu Hirata <kazu@cs.umass.edu> + + * tree-cfg.c (lv_adjust_loop_header_phi): Speed up moving a + call to find_edge outside a loop to go through a PHI chain. + 2004-04-26 Richard Guenther <rguenth@gcc.gnu.org> PR tree-optimization/17598 diff --git a/gcc/tree-cfg.c b/gcc/tree-cfg.c index a9098cd..93714d7 100644 --- a/gcc/tree-cfg.c +++ b/gcc/tree-cfg.c @@ -5398,6 +5398,11 @@ tree_lv_adjust_loop_header_phi (basic_block first, basic_block second, basic_block new_head, edge e) { tree phi1, phi2; + edge e2 = find_edge (new_head, second); + + /* Because NEW_HEAD has been created by splitting SECOND's incoming + edge, we should always have an edge from NEW_HEAD to SECOND. */ + gcc_assert (e2 != NULL); /* Browse all 'second' basic block phi nodes and add phi args to edge 'e' for 'first' head. PHI args are always in correct order. */ @@ -5406,13 +5411,8 @@ tree_lv_adjust_loop_header_phi (basic_block first, basic_block second, phi2 && phi1; phi2 = PHI_CHAIN (phi2), phi1 = PHI_CHAIN (phi1)) { - edge e2 = find_edge (new_head, second); - - if (e2) - { - tree def = PHI_ARG_DEF (phi2, e2->dest_idx); - add_phi_arg (phi1, def, e); - } + tree def = PHI_ARG_DEF (phi2, e2->dest_idx); + add_phi_arg (phi1, def, e); } } |