Commit 000b62dc by Kazu Hirata Committed by Kazu Hirata

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
parent 075a0d54
...@@ -5,6 +5,9 @@ ...@@ -5,6 +5,9 @@
Use VEC instead of VARRAY. Use VEC instead of VARRAY.
(equiv_free): New. (equiv_free): New.
* tree-ssa-sink.c (nearest_common_dominator_of_uses): Factor
out common code.
2005-05-02 Paolo Bonzini <bonzini@gnu.org> 2005-05-02 Paolo Bonzini <bonzini@gnu.org>
* c-common.c (resolve_overloaded_builtin): Forward to target * c-common.c (resolve_overloaded_builtin): Forward to target
......
...@@ -238,31 +238,25 @@ nearest_common_dominator_of_uses (tree stmt) ...@@ -238,31 +238,25 @@ nearest_common_dominator_of_uses (tree stmt)
{ {
tree usestmt = USE_STMT (use_p); tree usestmt = USE_STMT (use_p);
basic_block useblock; basic_block useblock;
if (TREE_CODE (usestmt) == PHI_NODE) if (TREE_CODE (usestmt) == PHI_NODE)
{ {
int idx = PHI_ARG_INDEX_FROM_USE (use_p); int idx = PHI_ARG_INDEX_FROM_USE (use_p);
useblock = PHI_ARG_EDGE (usestmt, idx)->src; 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 else
{ {
useblock = bb_for_stmt (usestmt); useblock = bb_for_stmt (usestmt);
}
/* Short circuit. Nothing dominates the entry block. */ /* Short circuit. Nothing dominates the entry block. */
if (useblock == ENTRY_BLOCK_PTR) if (useblock == ENTRY_BLOCK_PTR)
{ {
BITMAP_FREE (blocks); BITMAP_FREE (blocks);
return NULL; return NULL;
}
bitmap_set_bit (blocks, useblock->index);
} }
bitmap_set_bit (blocks, useblock->index);
} }
} }
commondom = BASIC_BLOCK (bitmap_first_set_bit (blocks)); commondom = BASIC_BLOCK (bitmap_first_set_bit (blocks));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment