===================================================================
@@ -183,18 +183,6 @@ init_dom_info (struct dom_info *di, enum
#undef init_ar
-/* Map dominance calculation type to array index used for various
- dominance information arrays. This version is simple -- it will need
- to be modified, obviously, if additional values are added to
- cdi_direction. */
-
-static unsigned int
-dom_convert_dir_to_idx (enum cdi_direction dir)
-{
- gcc_assert (dir == CDI_DOMINATORS || dir == CDI_POST_DOMINATORS);
- return dir - 1;
-}
-
/* Free all allocated memory in DI, but not DI itself. */
static void
@@ -695,21 +683,6 @@ free_dominance_info (enum cdi_direction
dom_computed[dir_index] = DOM_NONE;
}
-/* Return the immediate dominator of basic block BB. */
-basic_block
-get_immediate_dominator (enum cdi_direction dir, basic_block bb)
-{
- unsigned int dir_index = dom_convert_dir_to_idx (dir);
- struct et_node *node = bb->dom[dir_index];
-
- gcc_assert (dom_computed[dir_index]);
-
- if (!node->father)
- return NULL;
-
- return (basic_block) node->father->data;
-}
-
/* Set the immediate dominator of the block possibly removing
existing edge. NULL can be used to remove any edge. */
void
@@ -948,22 +921,6 @@ nearest_common_dominator_for_set (enum c
&& DFS_Number_Out (A) <= DFS_Number_Out(B);
} */
-/* Return TRUE in case BB1 is dominated by BB2. */
-bool
-dominated_by_p (enum cdi_direction dir, const_basic_block bb1, const_basic_block bb2)
-{
- unsigned int dir_index = dom_convert_dir_to_idx (dir);
- struct et_node *n1 = bb1->dom[dir_index], *n2 = bb2->dom[dir_index];
-
- gcc_assert (dom_computed[dir_index]);
-
- if (dom_computed[dir_index] == DOM_OK)
- return (n1->dfs_num_in >= n2->dfs_num_in
- && n1->dfs_num_out <= n2->dfs_num_out);
-
- return et_below (n1, n2);
-}
-
/* Returns the entry dfs number for basic block BB, in the direction DIR. */
unsigned
===================================================================
@@ -24,6 +24,7 @@ along with GCC; see the file COPYING3.
#include "predict.h"
#include "vec.h"
#include "function.h"
+#include "et-forest.h"
/* Type we use to hold basic block counters. Should be at least
64bit. Although a counter cannot be negative, we use a signed
@@ -837,6 +838,50 @@ enum cdi_direction
CDI_POST_DOMINATORS = 2
};
+/* Map dominance calculation type to array index used for various
+ dominance information arrays. This version is simple -- it will need
+ to be modified, obviously, if additional values are added to
+ cdi_direction. */
+
+static inline unsigned int
+dom_convert_dir_to_idx (enum cdi_direction dir)
+{
+ gcc_checking_assert (dir == CDI_DOMINATORS || dir == CDI_POST_DOMINATORS);
+ return dir - 1;
+}
+
+/* Return TRUE in case BB1 is dominated by BB2. */
+static inline bool
+dominated_by_p (enum cdi_direction dir, const_basic_block bb1, const_basic_block bb2)
+{
+ unsigned int dir_index = dom_convert_dir_to_idx (dir);
+ struct et_node *n1 = bb1->dom[dir_index], *n2 = bb2->dom[dir_index];
+
+ gcc_checking_assert (dom_computed[dir_index]);
+
+ if (dom_computed[dir_index] == DOM_OK)
+ return (n1->dfs_num_in >= n2->dfs_num_in
+ && n1->dfs_num_out <= n2->dfs_num_out);
+
+ return et_below (n1, n2);
+}
+
+
+/* Return the immediate dominator of basic block BB. */
+static inline basic_block
+get_immediate_dominator (enum cdi_direction dir, basic_block bb)
+{
+ unsigned int dir_index = dom_convert_dir_to_idx (dir);
+ struct et_node *node = bb->dom[dir_index];
+
+ gcc_checking_assert (dom_computed[dir_index]);
+
+ if (!node->father)
+ return NULL;
+
+ return (basic_block) node->father->data;
+}
+
extern enum dom_state dom_info_state (enum cdi_direction);
extern void set_dom_info_availability (enum cdi_direction, enum dom_state);
extern bool dom_info_available_p (enum cdi_direction);