gcc/gcc/omp-low.h

38 lines
1.3 KiB
C
Raw Normal View History

/* Header file for openMP lowering directives.
Copyright (C) 2013-2015 Free Software Foundation, Inc.
This file is part of GCC.
GCC is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free
Software Foundation; either version 3, or (at your option) any later
version.
GCC is distributed in the hope that it will be useful, but WITHOUT ANY
WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with GCC; see the file COPYING3. If not see
<http://www.gnu.org/licenses/>. */
#ifndef GCC_OMP_LOW_H
#define GCC_OMP_LOW_H
struct omp_region;
extern tree find_omp_clause (tree, enum omp_clause_code);
extern void omp_expand_local (basic_block);
extern void free_omp_regions (void);
extern tree omp_reduction_init_op (location_t, enum tree_code, tree);
extern tree omp_reduction_init (tree, tree);
re PR middle-end/59917 (ICE in calc_dfs_tree, at dominance.c:401) PR middle-end/59917 PR tree-optimization/59920 * tree.c (build_common_builtin_nodes): Remove __builtin_setjmp_dispatcher initialization. * omp-low.h (make_gimple_omp_edges): Add a new int * argument. * profile.c (branch_prob): Use gsi_start_nondebug_after_labels_bb instead of gsi_after_labels + manually skipping debug stmts. Don't ignore bbs with BUILT_IN_SETJMP_DISPATCHER, instead ignore bbs with IFN_ABNORMAL_DISPATCHER. * tree-inline.c (copy_edges_for_bb): Remove can_make_abnormal_goto argument, instead add abnormal_goto_dest argument. Ignore computed_goto_p stmts. Don't call make_abnormal_goto_edges. If a call might need abnormal edges for non-local gotos, see if it already has an edge to IFN_ABNORMAL_DISPATCHER or if it is IFN_ABNORMAL_DISPATCHER with true argument, don't do anything then, otherwise add EDGE_ABNORMAL from the call's bb to abnormal_goto_dest. (copy_cfg_body): Compute abnormal_goto_dest, adjust copy_edges_for_bb caller. * gimple-low.c (struct lower_data): Remove calls_builtin_setjmp. (lower_function_body): Don't emit __builtin_setjmp_dispatcher. (lower_stmt): Don't set data->calls_builtin_setjmp. (lower_builtin_setjmp): Adjust comment. * builtins.def (BUILT_IN_SETJMP_DISPATCHER): Remove. * tree-cfg.c (found_computed_goto): Remove. (factor_computed_gotos): Remove. (make_goto_expr_edges): Return bool, true for computed gotos. Don't call make_abnormal_goto_edges. (build_gimple_cfg): Don't set found_computed_goto, don't call factor_computed_gotos. (computed_goto_p): No longer static. (make_blocks): Don't set found_computed_goto. (get_abnormal_succ_dispatcher, handle_abnormal_edges): New functions. (make_edges): If make_goto_expr_edges returns true, push bb into ab_edge_goto vector, for stmt_can_make_abnormal_goto calls instead of calling make_abnormal_goto_edges push bb into ab_edge_call vector. Record mapping between bbs and OpenMP regions if there are any, adjust make_gimple_omp_edges caller. Call handle_abnormal_edges. (make_abnormal_goto_edges): Remove. * tree-cfg.h (make_abnormal_goto_edges): Remove. (computed_goto_p, get_abnormal_succ_dispatcher): New prototypes. * internal-fn.c (expand_ABNORMAL_DISPATCHER): New function. * builtins.c (expand_builtin): Don't handle BUILT_IN_SETJMP_DISPATCHER. * internal-fn.def (ABNORMAL_DISPATCHER): New. * omp-low.c (make_gimple_omp_edges): Add region_idx argument, when filling *region also set *region_idx to (*region)->entry->index. * gcc.dg/pr59920-1.c: New test. * gcc.dg/pr59920-2.c: New test. * gcc.dg/pr59920-3.c: New test. * c-c++-common/gomp/pr59917-1.c: New test. * c-c++-common/gomp/pr59917-2.c: New test. From-SVN: r207231
2014-01-29 12:02:46 +01:00
extern bool make_gimple_omp_edges (basic_block, struct omp_region **, int *);
[PATCH 3/7] OpenMP 4.0 offloading infrastructure: Offload tables. gcc/ * Makefile.in (GTFILES): Add omp-low.h to list of GC files. * cgraphunit.c: Include omp-low.h. * doc/tm.texi: Regenerate. * doc/tm.texi.in (TARGET_RECORD_OFFLOAD_SYMBOL): Document. * gengtype.c (open_base_files): Add omp-low.h to ifiles. * lto-cgraph.c (output_offload_tables): New function. (input_offload_tables): Likewise. * lto-section-in.c (lto_section_name): Add "offload_table". * lto-section-names.h (OFFLOAD_VAR_TABLE_SECTION_NAME): Define. (OFFLOAD_FUNC_TABLE_SECTION_NAME): Likewise. * lto-streamer-out.c (lto_output): Call output_offload_tables. * lto-streamer.h (lto_section_type): Add LTO_section_offload_table. (output_offload_tables, input_offload_tables): Declare. * omp-low.c: Include common/common-target.h and lto-section-names.h. (offload_funcs, offload_vars): New global <tree, va_gc> vectors. (expand_omp_target): Add child_fn into offload_funcs vector. (add_decls_addresses_to_decl_constructor): New function. (omp_finish_file): Likewise. * omp-low.h (omp_finish_file, offload_funcs, offload_vars): Declare. * target.def (record_offload_symbol): New DEFHOOK. * toplev.c: Include omp-low.h. (compile_file): Call omp_finish_file. * varpool.c: Include omp-low.h. (varpool_node::get_create): Add decl into offload_vars vector. gcc/lto/ * lto/lto.c (read_cgraph_and_symbols): Call input_offload_tables. Co-Authored-By: Andrey Turetskiy <andrey.turetskiy@intel.com> Co-Authored-By: Bernd Schmidt <bernds@codesourcery.com> Co-Authored-By: Ilya Tocar <ilya.tocar@intel.com> Co-Authored-By: Michael Zolotukhin <michael.v.zolotukhin@intel.com> From-SVN: r217489
2014-11-13 14:44:04 +01:00
extern void omp_finish_file (void);
gomp-constants.h (GOMP_VERSION_NVIDIA_PTX): Increment. inlude/ * gomp-constants.h (GOMP_VERSION_NVIDIA_PTX): Increment. (GOMP_DIM_GANG, GOMP_DIM_WORKER, GOMP_DIM_VECTOR, GOMP_DIM_MAX, GOMP_DIM_MASK): New. (GOMP_LAUNCH_DIM, GOMP_LAUNCH_ASYNC, GOMP_LAUNCH_WAIT): New. (GOMP_LAUNCH_CODE_SHIFT, GOMP_LAUNCH_DEVICE_SHIFT, GOMP_LAUNCH_OP_SHIFT): New. (GOMP_LAUNCH_PACK, GOMP_LAUNCH_CODE, GOMP_LAUNCH_DEVICE, GOMP_LAUNCH_OP): New. (GOMP_LAUNCH_OP_MAX): New. libgomp/ * libgomp.h (acc_dispatch_t): Replace separate geometry args with array. * libgomp.map (GOACC_parallel_keyed): New. * oacc-parallel.c (goacc_wait): Take pointer to va_list. Adjust all callers. (GOACC_parallel_keyed): New interface. Lose geometry arguments and take keyed varargs list. Adjust call to exec_func. (GOACC_parallel): Force host fallback. * libgomp_g.h (GOACC_parallel): Remove. (GOACC_parallel_keyed): Declare. * plugin/plugin-nvptx.c (struct targ_fn_launch): New struct. (stuct targ_gn_descriptor): Replace name field with launch field. (nvptx_exec): Lose separate geometry args, take array. Process dynamic dimensions and adjust. (struct nvptx_tdata): Replace fn_names field with fn_descs. (GOMP_OFFLOAD_load_image): Adjust for change in function table data. (GOMP_OFFLOAD_openacc_parallel): Adjust for change in dimension passing. * oacc-host.c (host_openacc_exec): Adjust for change in dimension passing. gcc/ * config/nvptx/nvptx.c: Include omp-low.h and gomp-constants.h. (nvptx_record_offload_symbol): Record function execution geometry. * config/nvptx/mkoffload.c (process): Include launch geometry in function data. * omp-low.c (oacc_launch_pack): New. (replace_oacc_fn_attrib): New. (set_oacc_fn_attrib): New. (get_oacc_fn_attrib): New. (expand_omp_target): Create keyed varargs for GOACC_parallel call generation. * omp-low.h (get_oacc_fn_attrib): Declare. * builtin-types.def (DEF_FUNCTION_TyPE_VAR_6): New. (DEF_FUNCTION_TYPE_VAR_11): Delete. * tree.h (OMP_CLAUSE_EXPR): New. * omp-builtins.def (BUILT_IN_GOACC_PARALLEL): Change target fn name. gcc/lto/ * lto-lang.c (DEF_FUNCTION_TYPE_VAR_6): New. (DEF_FUNCTION_TYPE_VAR_11): Delete. gcc/c-family/ * c-common.c (DEF_FUNCTION_TYPE_VAR_6): New. (DEF_FUNCTION_TYPE_VAR_11): Delete. gcc/fortran/ * f95-lang.c (DEF_FUNCTION_TYPE_VAR_6): New. (DEF_FUNCTION_TYPE_VAR_11): Delete. * types.def (DEF_FUNCTION_TYPE_VAR_6): New. (DEF_FUNCTION_TYPE_VAR_11): Delete. gcc/ada/ * gcc-interface/utils.c (DEF_FUNCTION_TYPE_VAR_6): Define From-SVN: r228220
2015-09-28 21:37:33 +02:00
extern tree get_oacc_fn_attrib (tree);
[PATCH 3/7] OpenMP 4.0 offloading infrastructure: Offload tables. gcc/ * Makefile.in (GTFILES): Add omp-low.h to list of GC files. * cgraphunit.c: Include omp-low.h. * doc/tm.texi: Regenerate. * doc/tm.texi.in (TARGET_RECORD_OFFLOAD_SYMBOL): Document. * gengtype.c (open_base_files): Add omp-low.h to ifiles. * lto-cgraph.c (output_offload_tables): New function. (input_offload_tables): Likewise. * lto-section-in.c (lto_section_name): Add "offload_table". * lto-section-names.h (OFFLOAD_VAR_TABLE_SECTION_NAME): Define. (OFFLOAD_FUNC_TABLE_SECTION_NAME): Likewise. * lto-streamer-out.c (lto_output): Call output_offload_tables. * lto-streamer.h (lto_section_type): Add LTO_section_offload_table. (output_offload_tables, input_offload_tables): Declare. * omp-low.c: Include common/common-target.h and lto-section-names.h. (offload_funcs, offload_vars): New global <tree, va_gc> vectors. (expand_omp_target): Add child_fn into offload_funcs vector. (add_decls_addresses_to_decl_constructor): New function. (omp_finish_file): Likewise. * omp-low.h (omp_finish_file, offload_funcs, offload_vars): Declare. * target.def (record_offload_symbol): New DEFHOOK. * toplev.c: Include omp-low.h. (compile_file): Call omp_finish_file. * varpool.c: Include omp-low.h. (varpool_node::get_create): Add decl into offload_vars vector. gcc/lto/ * lto/lto.c (read_cgraph_and_symbols): Call input_offload_tables. Co-Authored-By: Andrey Turetskiy <andrey.turetskiy@intel.com> Co-Authored-By: Bernd Schmidt <bernds@codesourcery.com> Co-Authored-By: Ilya Tocar <ilya.tocar@intel.com> Co-Authored-By: Michael Zolotukhin <michael.v.zolotukhin@intel.com> From-SVN: r217489
2014-11-13 14:44:04 +01:00
extern GTY(()) vec<tree, va_gc> *offload_funcs;
extern GTY(()) vec<tree, va_gc> *offload_vars;
#endif /* GCC_OMP_LOW_H */