@@ -372,25 +372,6 @@ control_dependences::clear_control_dependence_bitmap (basic_block bb)
bitmap_clear (&control_dependence_map[bb->index]);
}
-/* Find the immediate postdominator PDOM of the specified basic block BLOCK.
- This function is necessary because some blocks have negative numbers. */
-
-static inline basic_block
-find_pdom (basic_block block)
-{
- gcc_assert (block != ENTRY_BLOCK_PTR_FOR_FN (cfun));
-
- if (block == EXIT_BLOCK_PTR_FOR_FN (cfun))
- return EXIT_BLOCK_PTR_FOR_FN (cfun);
- else
- {
- basic_block bb = get_immediate_dominator (CDI_POST_DOMINATORS, block);
- if (! bb)
- return EXIT_BLOCK_PTR_FOR_FN (cfun);
- return bb;
- }
-}
-
/* Determine all blocks' control dependences on the given edge with edge_list
EL index EDGE_INDEX, ala Morgan, Section 3.6. */
@@ -402,15 +383,14 @@ control_dependences::find_control_dependence (int edge_index)
gcc_assert (get_edge_src (edge_index) != EXIT_BLOCK_PTR_FOR_FN (cfun));
- if (get_edge_src (edge_index) == ENTRY_BLOCK_PTR_FOR_FN (cfun))
- ending_block = single_succ (ENTRY_BLOCK_PTR_FOR_FN (cfun));
- else
- ending_block = find_pdom (get_edge_src (edge_index));
+ ending_block = get_immediate_dominator (CDI_POST_DOMINATORS,
+ get_edge_src (edge_index));
for (current_block = get_edge_dest (edge_index);
current_block != ending_block
&& current_block != EXIT_BLOCK_PTR_FOR_FN (cfun);
- current_block = find_pdom (current_block))
+ current_block = get_immediate_dominator (CDI_POST_DOMINATORS,
+ current_block))
set_control_dependence_map_bit (current_block, edge_index);
}
@@ -45,36 +45,6 @@
#define DEBUG_PREDICATE_ANALYZER 1
-/* Find the immediate postdominator of the specified basic block BB. */
-
-static inline basic_block
-find_pdom (basic_block bb)
-{
- basic_block exit_bb = EXIT_BLOCK_PTR_FOR_FN (cfun);
- if (bb == exit_bb)
- return exit_bb;
-
- if (basic_block pdom = get_immediate_dominator (CDI_POST_DOMINATORS, bb))
- return pdom;
-
- return exit_bb;
-}
-
-/* Find the immediate dominator of the specified basic block BB. */
-
-static inline basic_block
-find_dom (basic_block bb)
-{
- basic_block entry_bb = ENTRY_BLOCK_PTR_FOR_FN (cfun);
- if (bb == entry_bb)
- return entry_bb;
-
- if (basic_block dom = get_immediate_dominator (CDI_DOMINATORS, bb))
- return dom;
-
- return entry_bb;
-}
-
/* Return true if BB1 is postdominating BB2 and BB1 is not a loop exit
bb. The loop exit bb check is simple and does not cover all cases. */
@@ -96,7 +66,7 @@ is_non_loop_exit_postdominating (basic_block bb1, basic_block bb2)
static inline basic_block
find_control_equiv_block (basic_block bb)
{
- basic_block pdom = find_pdom (bb);
+ basic_block pdom = get_immediate_dominator (CDI_POST_DOMINATORS, bb);
/* Skip the postdominating bb that is also a loop exit. */
if (!is_non_loop_exit_postdominating (pdom, bb))
@@ -1167,7 +1137,7 @@ compute_control_dep_chain (basic_block dom_bb, const_basic_block dep_bb,
break;
}
- cd_bb = find_pdom (cd_bb);
+ cd_bb = get_immediate_dominator (CDI_POST_DOMINATORS, cd_bb);
post_dom_check++;
if (cd_bb == EXIT_BLOCK_PTR_FOR_FN (cfun)
|| post_dom_check > MAX_POSTDOM_CHECK)
@@ -1788,7 +1758,7 @@ predicate::init_from_phi_def (gphi *phi)
basic_block phi_bb = gimple_bb (phi);
/* Find the closest dominating bb to be the control dependence root. */
- basic_block cd_root = find_dom (phi_bb);
+ basic_block cd_root = get_immediate_dominator (CDI_DOMINATORS, phi_bb);
if (!cd_root)
return false;