GCC Middle and Back End API Reference
|
#include "config.h"
#include "system.h"
#include "coretypes.h"
#include "backend.h"
#include "rtl.h"
#include "tree.h"
#include "gimple.h"
#include "tree-pass.h"
#include "ssa.h"
#include "cgraph.h"
#include "pretty-print.h"
#include "fold-const.h"
#include "gimplify.h"
#include "gimple-iterator.h"
#include "gimple-walk.h"
#include "tree-inline.h"
#include "langhooks.h"
#include "omp-general.h"
#include "omp-low.h"
#include "gimple-pretty-print.h"
#include "cfghooks.h"
#include "insn-config.h"
#include "recog.h"
#include "internal-fn.h"
#include "bitmap.h"
#include "tree-nested.h"
#include "stor-layout.h"
#include "tree-ssa-threadupdate.h"
#include "tree-into-ssa.h"
#include "splay-tree.h"
#include "target.h"
#include "cfgloop.h"
#include "tree-cfg.h"
#include "omp-offload.h"
#include "attribs.h"
#include "targhooks.h"
#include "diagnostic-core.h"
Data Structures | |
struct | parallel_g |
class | addr_range |
Macros | |
#define | GOMP_DIM_SEQ GOMP_DIM_MAX |
Typedefs | |
typedef hash_map< basic_block, gimple * > | bb_stmt_map_t |
typedef hash_map< tree, tree > | field_map_t |
typedef hash_map< tree, field_map_t > | record_field_map_t |
typedef hash_set< tree > | propagation_set |
typedef hash_map< basic_block, std::pair< unsigned HOST_WIDE_INT, bool > > | blk_offset_map_t |
typedef std::pair< int, tree > | idx_decl_pair_t |
typedef auto_vec< splay_tree > | used_range_vec_t |
#define GOMP_DIM_SEQ GOMP_DIM_MAX |
Map of basic blocks to gimple stmts.
typedef hash_map<basic_block, std::pair<unsigned HOST_WIDE_INT, bool> > blk_offset_map_t |
A map from SSA names or var decls to record fields.
typedef std::pair<int, tree> idx_decl_pair_t |
Sets of SSA_NAMES or VAR_DECLs to propagate.
For each propagation record type, this is a map from SSA names or var decls to propagate, to the field in the record type that should be used for transmission and reception.
|
static |
References build_simple_mem_ref, fields, omp_build_component_ref(), and TREE_THIS_NOTRAP.
Referenced by worker_single_copy().
|
static |
References build_simple_mem_ref, fields, omp_build_component_ref(), POINTER_TYPE_P, and TREE_TYPE.
Referenced by worker_single_copy().
|
static |
References basic_block_def::aux, BB_VISITED, bitmap_set_bit, dfs_broadcast_reachable_1(), basic_block_def::flags, FOR_EACH_EDGE, ggc_alloc(), basic_block_def::index, and basic_block_def::succs.
Referenced by dfs_broadcast_reachable_1(), and oacc_do_neutering().
|
static |
References cfun, current_function_decl, DECL_ALIGN_UNIT, FOR_ALL_BB_FN, gcc_assert, ggc_alloc(), gimple_call_arg(), gimple_call_internal_fn(), gimple_call_internal_p(), gimple_call_num_args(), gsi_end_p(), gsi_next(), gsi_start_bb(), gsi_stmt(), i, integer_minus_onep(), is_gimple_call(), MAX, oacc_do_neutering(), oacc_get_fn_dim_size(), offset, targetm, TREE_CODE, TREE_INT_CST_LOW, TREE_OPERAND, tree_to_uhwi(), TREE_TYPE, and TYPE_SIZE_UNIT.
Gang-private variables (typically placed in a GPU's shared memory) do not need to be processed by the worker-propagation mechanism. Populate the GANG_PRIVATE_VARS set with any such variables found in the current function.
References cfun, FOR_EACH_BB_FN, gcc_assert, ggc_alloc(), gimple_call_arg(), gimple_call_internal_p(), gimple_call_num_args(), gsi_end_p(), gsi_next(), gsi_start_bb(), gsi_stmt(), i, TREE_CODE, TREE_INT_CST_LOW, and TREE_OPERAND.
Referenced by oacc_do_neutering().
|
static |
References AGGREGATE_TYPE_P, bitmap_set_bit, cfun, dump_file, find_local_vars_to_propagate(), FOR_EACH_LOCAL_DECL, ggc_alloc(), gsi_end_p(), gsi_next(), gsi_start_bb(), gsi_stmt(), i, basic_block_def::index, is_global_var(), mask_name(), print_generic_expr(), stmt_may_clobber_ref_p(), TDF_SLIM, TREE_TYPE, and VAR_P.
Referenced by find_local_vars_to_propagate(), and oacc_do_neutering().
|
static |
References find_partitioned_var_uses(), find_partitioned_var_uses_1(), ggc_alloc(), gsi_end_p(), gsi_next(), gsi_start_bb(), NULL, and walk_gimple_stmt().
Referenced by find_partitioned_var_uses(), and oacc_do_neutering().
Callback for walk_gimple_stmt to find RHS VAR_DECLs (uses) in a statement.
References ggc_alloc(), NULL_TREE, and VAR_P.
Referenced by find_partitioned_var_uses().
|
static |
References bitmap_bit_p, find_ssa_names_to_propagate(), FOR_EACH_PHI_ARG, FOR_EACH_SSA_USE_OPERAND, ggc_alloc(), gimple_bb(), gimple_nop_p(), gsi_end_p(), gsi_next(), gsi_start_bb(), gsi_start_phis(), gsi_stmt(), SSA_NAME_DEF_STMT, SSA_OP_USE, TREE_CODE, and USE_FROM_PTR.
Referenced by find_ssa_names_to_propagate(), and oacc_do_neutering().
|
static |
References ggc_alloc().
Referenced by oacc_do_neutering().
|
static |
References build_decl(), build_qualified_type(), BUILTINS_LOCATION, DECL_ALIGN, DECL_NAME, DECL_UID, DECL_USER_ALIGN, fields, gcc_assert, gcc_unreachable, get_identifier(), ggc_alloc(), insert_field_into_struct(), POINTER_TYPE_P, record_type(), SET_DECL_ALIGN, SSA_NAME_IDENTIFIER, SSA_NAME_VERSION, TREE_CODE, TREE_THIS_VOLATILE, TREE_TYPE, TYPE_ALIGN, TYPE_QUAL_RESTRICT, TYPE_QUALS, TYPE_RESTRICT, and VAR_P.
Referenced by oacc_do_neutering().
References ggc_alloc(), is_global_var(), local_var_based_p(), TREE_CODE, and TREE_OPERAND.
Referenced by local_var_based_p(), and omp_sese_split_blocks().
gimple_opt_pass * make_pass_omp_oacc_neuter_broadcast | ( | gcc::context * | ctxt | ) |
References ggc_alloc().
Referenced by find_local_vars_to_propagate(), and omp_sese_dump_pars().
|
static |
References ggc_alloc(), and merge_ranges_1().
Referenced by oacc_do_neutering().
|
static |
References ggc_alloc(), MAX, MIN, and splay_tree_node< T >::value().
Referenced by merge_ranges().
|
static |
References basic_block_def::aux, bitmap_bit_p, builtin_decl_explicit(), cfun, FOR_EACH_IMM_USE_STMT, FOR_EACH_SSA_NAME, gcc_assert, ggc_alloc(), gimple_bb(), gimple_build_call(), gimple_call_arg(), gimple_call_internal_p(), gimple_nop_p(), gsi_end_p(), gsi_insert_after(), gsi_insert_before(), GSI_NEW_STMT, gsi_next(), GSI_SAME_STMT, gsi_start_bb(), gsi_stmt(), i, basic_block_def::index, neuter_worker_single(), offset, omp_sese_active_worker_call(), phi_nodes(), record_type(), SSA_NAME_DEF_STMT, SSA_NAME_IS_VIRTUAL_OPERAND, TREE_CODE, TREE_INT_CST_LOW, worker_single_copy(), and worker_single_simple().
Referenced by neuter_worker_single(), and oacc_do_neutering().
|
static |
References abort, basic_block_def::aux, BASIC_BLOCK_FOR_FN, bitmap_ior(), bitmap_set_bit, bitmap_vector_clear(), build_decl(), CDI_DOMINATORS, CDI_POST_DOMINATORS, cfun, conflicts, create_tmp_var_name(), current_function_decl, DECL_ARTIFICIAL, DECL_NAMELESS, dfs_broadcast_reachable_1(), dump_file, dump_flags, dump_function_to_file(), error_at(), EXECUTE_IF_SET_IN_BITMAP, fields, find_gang_private_vars(), find_local_vars_to_propagate(), find_partitioned_var_uses(), find_ssa_names_to_propagate(), first_fit_range(), FOR_ALL_BB_FN, free_dominance_info(), gcc_checking_assert, ggc_alloc(), i, basic_block_def::index, install_var_field(), integer_zerop(), last_basic_block_for_fn, layout_type(), LOOP_CLOSED_SSA, loops_state_clear(), lang_hooks_for_types::make_type, merge_ranges(), neuter_worker_single(), NULL, oacc_get_fn_attrib(), omp_sese_discover_pars(), omp_sese_split_blocks(), populate_single_mode_bitmaps(), record_type(), sbitmap_vector_alloc(), sbitmap_vector_free(), sort_by_size_then_ssa_version_or_uid(), sort_size_descending(), splay_tree_compare_addr_range(), splay_tree_free_key(), TREE_CHAIN, TREE_PURPOSE, tree_to_uhwi(), TREE_VALUE, TYPE_ALIGN_UNIT, TYPE_ARTIFICIAL, TYPE_NAME, TYPE_SIZE_UNIT, lang_hooks::types, UNKNOWN_LOCATION, and vNULL.
Referenced by execute_omp_oacc_neuter_broadcast().
Calls to OpenACC routines are made by all workers/wavefronts/warps, since the routine likely contains partitioned loops (else will do its own neutering and variable propagation). Return TRUE if a function call CALL should be made in (worker) single mode instead, rather than redundant mode.
References gimple_call_fndecl(), GOMP_DIM_SEQ, oacc_fn_attrib_level(), and oacc_get_fn_attrib().
Referenced by neuter_worker_single(), and omp_sese_split_blocks().
|
static |
DFS walk the CFG looking for fork & join markers. Construct loop structures as we go. MAP is a mapping of basic blocks to head & tail markers, discovered when splitting blocks. This speeds up the discovery. We rely on the BB visited flag having been cleared when splitting blocks.
Adapted from 'gcc/config/nvptx/nvptx.cc:nvptx_discover_pars'.
References BB_VISITED, cfun, dump_file, ENTRY_BLOCK_PTR_FOR_FN, EXIT_BLOCK_PTR_FOR_FN, basic_block_def::flags, ggc_alloc(), map, omp_sese_dump_pars(), and omp_sese_find_par().
Referenced by oacc_do_neutering().
|
static |
Dump this parallel and all its inner parallels.
Adapted from 'gcc/config/nvptx/nvptx.cc:nvptx_dump_pars'.
References dump_file, ggc_alloc(), basic_block_def::index, mask_name(), and omp_sese_dump_pars().
Referenced by omp_sese_discover_pars(), and omp_sese_dump_pars().
|
static |
If BLOCK contains a fork/join marker, process it to create or terminate a loop structure. Add this block to the current loop, and then walk successor blocks.
Adapted from 'gcc/config/nvptx/nvptx.cc:nvptx_find_par'.
References BB_VISITED, basic_block_def::flags, FOR_EACH_EDGE, gcc_assert, gcc_unreachable, ggc_alloc(), gimple_call_arg(), gimple_call_internal_p(), gimple_nop_p(), gsi_last_bb(), gsi_stmt(), is_gimple_assign(), map, omp_sese_find_par(), single_pred(), basic_block_def::succs, and TREE_INT_CST_LOW.
Referenced by omp_sese_discover_pars(), and omp_sese_find_par().
|
static |
Split basic blocks such that each forked and join unspecs are at the start of their basic blocks. Thus afterwards each block will have a single partitioning mode. We also do the same for return insns, as they are executed by every thread. Return the partitioning mode of the function as a whole. Populate MAP with head and tail blocks. We also clear the BB visited flag, which is used when finding partitions.
Adapted from 'gcc/config/nvptx/nvptx.cc:nvptx_split_blocks'.
References boolean_false_node, boolean_type_node, cfun, basic_block_def::flags, FOR_ALL_BB_FN, gcc_assert, ggc_alloc(), gimple_assign_lhs(), gimple_bb(), gimple_build_assign(), gimple_build_cond(), gimple_build_nop(), gimple_call_arg(), gimple_call_internal_p(), gimple_cond_false_label(), gimple_cond_lhs(), gimple_cond_rhs(), gimple_cond_true_label(), gimple_expr_code(), gsi_end_p(), gsi_for_stmt(), gsi_insert_before(), gsi_next(), gsi_one_before_end_p(), gsi_prev(), gsi_replace(), GSI_SAME_STMT, gsi_start_bb(), gsi_stmt(), is_gimple_assign(), local_var_based_p(), make_ssa_name(), map, omp_sese_active_worker_call(), single_succ(), split_block(), TREE_CODE, TREE_INT_CST_LOW, TREE_OPERAND, and worklist.
Referenced by oacc_do_neutering().
|
static |
References bitmap_set_bit, ggc_alloc(), i, basic_block_def::index, and populate_single_mode_bitmaps().
Referenced by oacc_do_neutering(), and populate_single_mode_bitmaps().
References ggc_alloc(), sort_by_ssa_version_or_uid(), tree_to_uhwi(), TREE_TYPE, and TYPE_SIZE.
Referenced by oacc_do_neutering().
References DECL_UID, ggc_alloc(), SSA_NAME_VERSION, and TREE_CODE.
Referenced by sort_by_size_then_ssa_version_or_uid(), and worker_single_copy().
References a, b, ggc_alloc(), tree_to_uhwi(), and TYPE_SIZE_UNIT.
Referenced by oacc_do_neutering().
|
static |
References a, b, and ggc_alloc().
Referenced by oacc_do_neutering().
References ggc_alloc().
Referenced by oacc_do_neutering().
|
static |
References add_phi_arg(), build_fold_addr_expr, build_int_cst(), build_receiver_ref(), build_sender_ref(), build_zero_cst(), builtin_decl_explicit(), char_type_node, create_new_def_for(), create_phi_node(), create_tmp_var, EDGE_COUNT, fields, fold_convert, gcc_assert, gcc_unreachable, ggc_alloc(), gimple_build_assign(), gimple_build_call(), gimple_build_cond(), gimple_call_set_lhs(), gimple_nop_p(), gimple_phi_result_ptr(), gimple_seq_add_stmt(), gsi_after_labels(), GSI_CONTINUE_LINKING, gsi_insert_after(), gsi_insert_before(), gsi_insert_seq_after(), gsi_last_bb(), GSI_NEW_STMT, gsi_prev(), GSI_SAME_STMT, gsi_start_bb(), gsi_stmt(), i, last, profile_probability::likely(), make_edge(), make_ssa_name(), NULL, NULL_TREE, POINTER_TYPE_P, record_type(), single_succ_edge(), sort_by_ssa_version_or_uid(), split_block(), split_edge(), SSA_NAME_DEF_STMT, SSA_NAME_IS_VIRTUAL_OPERAND, basic_block_def::succs, targetm, TREE_CODE, TREE_TYPE, UNKNOWN_LOCATION, profile_probability::unlikely(), update_stmt(), and VAR_P.
Referenced by neuter_worker_single().
|
static |
Transform basic blocks FROM, TO (which may be the same block) into: if (GOACC_single_start ()) BLOCK; GOACC_barrier (); \ | / +----+ | | (new) predicate block +----+-- \ | / \ | / |t \ +----+ +----+ +----+ | | | | | ===> | | | f (old) from block +----+ +----+ +----+ | | t/ \f | / +----+/ (split (split before | | skip block at end) condition) +----+ t/ \f
References add_phi_arg(), boolean_true_node, build_zero_cst(), builtin_decl_explicit(), copy_ssa_name(), create_new_def_for(), create_phi_node(), create_tmp_var, EDGE_COUNT, fold_convert_loc(), FOR_EACH_SSA_TREE_OPERAND, gcc_assert, ggc_alloc(), gimple_build_assign(), gimple_build_call(), gimple_build_cond(), gimple_call_set_lhs(), gimple_phi_result_ptr(), gsi_after_labels(), GSI_CONTINUE_LINKING, gsi_end_p(), gsi_insert_after(), gsi_insert_before(), gsi_last_bb(), GSI_NEW_STMT, gsi_next(), gsi_prev(), gsi_start_bb(), gsi_stmt(), profile_probability::likely(), make_edge(), NULL, NULL_TREE, single_succ_edge(), split_block(), split_edge(), SSA_OP_DEF, basic_block_def::succs, TREE_TYPE, UNKNOWN_LOCATION, and update_stmt().
Referenced by neuter_worker_single().