This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[gomp4, committed] Remove misc oacc kernels functions
- From: Tom de Vries <Tom_deVries at mentor dot com>
- To: "gcc-patches at gnu dot org" <gcc-patches at gnu dot org>
- Cc: Jakub Jelinek <jakub at redhat dot com>
- Date: Thu, 5 Nov 2015 15:50:28 +0100
- Subject: [gomp4, committed] Remove misc oacc kernels functions
- Authentication-results: sourceware.org; auth=none
Hi,
this patch removes a number of unused function related to the oacc
kernels region.
Committed to gomp-4_0-branch.
Thanks,
- Tom
Remove misc oacc kernels functions
2015-11-05 Tom de Vries <tom@codesourcery.com>
* omp-low.c (get_bbs_in_oacc_kernels_region):
(loop_get_oacc_kernels_region_entry, get_oacc_kernels_region_exit)
(oacc_kernels_region_entry_p): Remove.
* omp-low.h: Same.
---
gcc/omp-low.c | 134 ----------------------------------------------------------
gcc/omp-low.h | 5 ---
2 files changed, 139 deletions(-)
diff --git a/gcc/omp-low.c b/gcc/omp-low.c
index b3731e3..debedb1 100644
--- a/gcc/omp-low.c
+++ b/gcc/omp-low.c
@@ -12295,115 +12295,6 @@ mark_loops_in_oacc_kernels_region (basic_block region_entry,
loop->in_oacc_kernels_region = true;
}
-/* Return blocks in oacc kernels region delimited by REGION_ENTRY and
- REGION_EXIT. */
-
-vec<basic_block>
-get_bbs_in_oacc_kernels_region (basic_block region_entry,
- basic_block region_exit)
-{
- bitmap excludes_bitmap = BITMAP_GGC_ALLOC ();
- unsigned di;
- basic_block bb;
-
- bitmap_clear (excludes_bitmap);
-
- /* Get all the blocks dominated by the region entry. That will include the
- entire region. */
- vec<basic_block> dominated
- = get_all_dominated_blocks (CDI_DOMINATORS, region_entry);
-
- bitmap_set_bit (excludes_bitmap, region_entry->index);
-
- /* Exclude all the blocks which are not in the region: the blocks dominated by
- the region exit. */
- if (region_exit != NULL)
- {
- vec<basic_block> excludes
- = get_all_dominated_blocks (CDI_DOMINATORS, region_exit);
- FOR_EACH_VEC_ELT (excludes, di, bb)
- bitmap_set_bit (excludes_bitmap, bb->index);
- bitmap_clear_bit (excludes_bitmap, region_exit->index);
- }
-
- vec<basic_block> bbs = vNULL;
-
- FOR_EACH_VEC_ELT (dominated, di, bb)
- if (!bitmap_bit_p (excludes_bitmap, bb->index))
- bbs.safe_push (bb);
-
- return bbs;
-}
-
-/* Return the entry basic block of the oacc kernels region containing LOOP. */
-
-basic_block
-loop_get_oacc_kernels_region_entry (struct loop *loop)
-{
- if (!loop->in_oacc_kernels_region)
- return NULL;
-
- basic_block bb = loop->header;
- while (true)
- {
- bb = get_immediate_dominator (CDI_DOMINATORS, bb);
- gcc_assert (bb != NULL);
-
- gimple *last = last_stmt (bb);
- if (last != NULL
- && gimple_code (last) == GIMPLE_OMP_TARGET
- && gimple_omp_target_kind (last) == GF_OMP_TARGET_KIND_OACC_KERNELS)
- return bb;
- }
-}
-
-/* Return the oacc kernels region exit corresponding to REGION_ENTRY. */
-
-basic_block
-get_oacc_kernels_region_exit (basic_block region_entry)
-{
- gcc_checking_assert (oacc_kernels_region_entry_p (region_entry, NULL));
-
- bitmap to_visit = BITMAP_ALLOC (NULL);
- bitmap visited = BITMAP_ALLOC (NULL);
- bitmap_clear (to_visit);
- bitmap_clear (visited);
-
- bitmap_set_bit (to_visit, region_entry->index);
-
- basic_block bb;
- while (true)
- {
- if (bitmap_empty_p (to_visit))
- {
- bb = NULL;
- break;
- }
-
- unsigned int index = bitmap_first_set_bit (to_visit);
- bitmap_clear_bit (to_visit, index);
- bitmap_set_bit (visited, index);
- bb = BASIC_BLOCK_FOR_FN (cfun, index);
-
- gimple *last = last_stmt (bb);
- if (last != NULL
- && gimple_code (last) == GIMPLE_OMP_RETURN)
- break;
-
- edge_iterator ei;
- for (ei = ei_start (bb->succs); !ei_end_p (ei); ei_next (&ei))
- {
- edge e = ei_edge (ei);
- unsigned int dest_index = e->dest->index;
- if (!bitmap_bit_p (visited, dest_index))
- bitmap_set_bit (to_visit, dest_index);
- }
- }
-
- BITMAP_FREE (to_visit);
- return bb;
-}
-
/* Encode an oacc launch argument. This matches the GOMP_LAUNCH_PACK
macro on gomp-constants.h. We do not check for overflow. */
@@ -18656,31 +18547,6 @@ omp_finish_file (void)
}
}
-/* Return true if BB is an oacc kernels region entry. If DIRECTIVE is non-null,
- return the corresponding kernels directive in *DIRECTIVE. */
-
-bool
-oacc_kernels_region_entry_p (basic_block bb, gomp_target **directive)
-{
- /* Check that the last statement in the preceding bb is an oacc kernels
- stmt. */
- if (!single_pred_p (bb))
- return false;
- gimple *last = last_stmt (single_pred (bb));
- if (last == NULL
- || gimple_code (last) != GIMPLE_OMP_TARGET)
- return false;
- gomp_target *kernels = as_a <gomp_target *> (last);
-
- bool res = (gimple_omp_target_kind (kernels)
- == GF_OMP_TARGET_KIND_OACC_KERNELS);
-
- if (res && directive)
- *directive = kernels;
-
- return res;
-}
-
namespace {
const pass_data pass_data_late_lower_omp =
diff --git a/gcc/omp-low.h b/gcc/omp-low.h
index d1755a8..e4c81b2 100644
--- a/gcc/omp-low.h
+++ b/gcc/omp-low.h
@@ -30,11 +30,6 @@ extern tree omp_reduction_init (tree, tree);
extern bool make_gimple_omp_edges (basic_block, struct omp_region **, int *);
extern void omp_finish_file (void);
extern tree omp_member_access_dummy_var (tree);
-extern bool oacc_kernels_region_entry_p (basic_block, gomp_target **);
-extern basic_block get_oacc_kernels_region_exit (basic_block);
-extern basic_block loop_get_oacc_kernels_region_entry (struct loop *);
-extern vec<basic_block> get_bbs_in_oacc_kernels_region (basic_block,
- basic_block);
extern void replace_oacc_fn_attrib (tree, tree);
extern tree build_oacc_routine_dims (tree);
extern tree get_oacc_fn_attrib (tree);
--
1.9.1