diff options
author | Kazu Hirata <kazu@cs.umass.edu> | 2005-05-02 16:57:53 +0000 |
---|---|---|
committer | Kazu Hirata <kazu@gcc.gnu.org> | 2005-05-02 16:57:53 +0000 |
commit | 000b62dcb872823d91cbab17d089122fbc8bbd8f (patch) | |
tree | 12e7611ab866dff0663a67068c1f598cb5547c16 /gcc | |
parent | 075a0d547539e2229af09e58ee3917544dcf1bcc (diff) | |
download | gcc-000b62dcb872823d91cbab17d089122fbc8bbd8f.zip gcc-000b62dcb872823d91cbab17d089122fbc8bbd8f.tar.gz gcc-000b62dcb872823d91cbab17d089122fbc8bbd8f.tar.bz2 |
tree-ssa-sink.c (nearest_common_dominator_of_uses): Factor out common code.
* tree-ssa-sink.c (nearest_common_dominator_of_uses): Factor
out common code.
From-SVN: r99105
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 3 | ||||
-rw-r--r-- | gcc/tree-ssa-sink.c | 22 |
2 files changed, 11 insertions, 14 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 4a3b56e..641754b 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -5,6 +5,9 @@ Use VEC instead of VARRAY. (equiv_free): New. + * tree-ssa-sink.c (nearest_common_dominator_of_uses): Factor + out common code. + 2005-05-02 Paolo Bonzini <bonzini@gnu.org> * c-common.c (resolve_overloaded_builtin): Forward to target diff --git a/gcc/tree-ssa-sink.c b/gcc/tree-ssa-sink.c index 7751c4a..8041686 100644 --- a/gcc/tree-ssa-sink.c +++ b/gcc/tree-ssa-sink.c @@ -238,31 +238,25 @@ nearest_common_dominator_of_uses (tree stmt) { tree usestmt = USE_STMT (use_p); basic_block useblock; + if (TREE_CODE (usestmt) == PHI_NODE) { int idx = PHI_ARG_INDEX_FROM_USE (use_p); useblock = PHI_ARG_EDGE (usestmt, idx)->src; - /* Short circuit. Nothing dominates the entry block. */ - if (useblock == ENTRY_BLOCK_PTR) - { - BITMAP_FREE (blocks); - return NULL; - } - bitmap_set_bit (blocks, useblock->index); } else { useblock = bb_for_stmt (usestmt); + } - /* Short circuit. Nothing dominates the entry block. */ - if (useblock == ENTRY_BLOCK_PTR) - { - BITMAP_FREE (blocks); - return NULL; - } - bitmap_set_bit (blocks, useblock->index); + /* Short circuit. Nothing dominates the entry block. */ + if (useblock == ENTRY_BLOCK_PTR) + { + BITMAP_FREE (blocks); + return NULL; } + bitmap_set_bit (blocks, useblock->index); } } commondom = BASIC_BLOCK (bitmap_first_set_bit (blocks)); |