GCC Middle and Back End API Reference
|
#include "config.h"
#include "system.h"
#include "coretypes.h"
#include "backend.h"
#include "target.h"
#include "rtl.h"
#include "tree.h"
#include "memmodel.h"
#include "tm_p.h"
#include "gimple.h"
#include "gimple-predict.h"
#include "tree-pass.h"
#include "ssa.h"
#include "cgraph.h"
#include "tree-pretty-print.h"
#include "diagnostic-core.h"
#include "diagnostic.h"
#include "alias.h"
#include "fold-const.h"
#include "calls.h"
#include "varasm.h"
#include "stmt.h"
#include "expr.h"
#include "gimple-iterator.h"
#include "gimple-fold.h"
#include "tree-eh.h"
#include "gimplify.h"
#include "stor-layout.h"
#include "print-tree.h"
#include "tree-iterator.h"
#include "tree-inline.h"
#include "langhooks.h"
#include "tree-cfg.h"
#include "tree-ssa.h"
#include "tree-hash-traits.h"
#include "omp-general.h"
#include "omp-low.h"
#include "gimple-low.h"
#include "gomp-constants.h"
#include "splay-tree.h"
#include "gimple-walk.h"
#include "langhooks-def.h"
#include "builtins.h"
#include "stringpool.h"
#include "attribs.h"
#include "asan.h"
#include "dbgcnt.h"
#include "omp-offload.h"
#include "context.h"
#include "tree-nested.h"
#include "gcc-urlifier.h"
Data Structures | |
struct | gimplify_hasher |
struct | gimplify_ctx |
struct | gimplify_omp_ctx |
struct | label_entry |
struct | gimplify_init_ctor_preeval_data |
struct | tree_operand_hash_no_se |
struct | omp_mapping_group |
struct | gimplify_adjust_omp_clauses_data |
Typedefs | |
typedef char * | char_p |
Variables | |
static unsigned | nextconduid = 1 |
static hash_map< tree, unsigned > * | cond_uids |
static hash_set< tree > * | asan_poisoned_variables = NULL |
static struct gimplify_ctx * | gimplify_ctxp |
static struct gimplify_omp_ctx * | gimplify_omp_ctxp |
static bool | in_omp_construct |
static hash_map< tree, tree > * | oacc_declare_returns |
static struct gimplify_ctx * | ctx_pool = NULL |
typedef char* char_p |
enum omp_region_type |
enum omp_tsort_mark |
Used for topological sorting of mapping groups. UNVISITED means we haven't started processing the group yet. The TEMPORARY mark is used when we first encounter a group on a depth-first traversal, and the PERMANENT mark is used when we have processed all the group's children (i.e. all the base pointers referred to by the group's mapping nodes, recursively).
Enumerator | |
---|---|
UNVISITED | |
TEMPORARY | |
PERMANENT |
|
static |
Generate IFN_ASAN_MARK internal call that depending on POISON flag either poisons or unpoisons a DECL. Created statement is appended to SEQ_P gimple sequence.
References asan_poison_variable(), gsi_end_p(), and gsi_last().
|
static |
Generate IFN_ASAN_MARK call that would poison or unpoison, depending on POISON flag, shadow memory of a DECL variable. The call will be put on location identified by IT iterator, where BEFORE flag drives position where the stmt will be put.
References ASAN_SHADOW_GRANULARITY, build_fold_addr_expr, build_int_cst(), DECL_ALIGN_UNIT, DECL_SIZE_UNIT, g, gcc_assert, gimple_build_call_internal(), gsi_insert_after(), gsi_insert_before(), GSI_NEW_STMT, hwasan_sanitize_p(), hwasan_sanitize_stack_p(), HWASAN_TAG_GRANULE_SIZE, integer_type_node, SET_DECL_ALIGN, and zerop().
Referenced by asan_poison_variable(), asan_poison_variables(), gimplify_bind_expr(), gimplify_decl_expr(), and gimplify_target_expr().
|
static |
Generate IFN_ASAN_MARK internal call for all VARIABLES depending on POISON flag. Created statement is appended to SEQ_P gimple sequence.
References asan_poison_variable(), ASAN_USE_AFTER_SCOPE_ATTRIBUTE, DECL_ATTRIBUTES, FOR_EACH_VEC_ELT, get_identifier(), i, integer_one_node, lookup_attribute(), sort_by_decl_uid(), tree_cons(), and variables.
Referenced by gimplify_expr().
Build a GOTO to the LABEL_DECL pointed to by LABEL_P, building it first if necessary.
References build1(), create_artificial_label(), NULL, NULL_TREE, UNKNOWN_LOCATION, and void_type_node.
Referenced by gimplify_exit_expr(), gimplify_omp_affinity(), gimplify_omp_depend(), lower_omp_master(), lower_omp_single_copy(), shortcut_cond_expr(), and shortcut_cond_r().
Generate IFN_ASAN_MARK call that poisons shadow of a for DECL variable.
References build_call_expr_internal_loc(), build_fold_addr_expr, build_int_cst(), DECL_SIZE_UNIT, integer_type_node, NULL_TREE, UNKNOWN_LOCATION, void_type_node, and zerop().
Referenced by gimplify_target_expr().
|
static |
Build a call to the instrumentation function FNCODE and add it to SEQ. If COND_VAR is not NULL, it is a boolean variable guarding the call to the instrumentation function. IF STMT is not NULL, it is a statement to be executed just before the call to the instrumentation function.
References boolean_false_node, build_fold_addr_expr, builtin_decl_implicit(), create_artificial_label(), create_tmp_var, current_function_decl, gimple_build_call(), gimple_build_cond(), gimple_build_label(), gimple_build_predict(), gimple_call_set_lhs(), gimplify_seq_add_stmt(), integer_zero_node, NOT_TAKEN, ptr_type_node, TREE_NO_TRAMPOLINE, and UNKNOWN_LOCATION.
Referenced by gimplify_function_tree().
|
static |
For a set of mappings describing an array section pointed to by a struct (or derived type, etc.) component, create an "alloc" or "release" node to insert into a list following a GOMP_MAP_STRUCT node. For some types of mapping (e.g. Fortran arrays with descriptors), an additional mapping may be created that is inserted into the list of mapping nodes attached to the directive being processed -- not part of the sorted list of nodes after GOMP_MAP_STRUCT. CODE is the code of the directive being processed. GRP_START and GRP_END are the first and last of two or three nodes representing this array section mapping (e.g. a data movement node like GOMP_MAP_{TO,FROM}, optionally a GOMP_MAP_TO_PSET, and finally a GOMP_MAP_ALWAYS_POINTER). EXTRA_NODE is filled with the additional node described above, if needed. This function does not add the new nodes to any lists itself. It is the responsibility of the caller to do that.
References build_omp_clause(), gimplify_omp_ctx::code, gcc_assert, NULL_TREE, OMP_CLAUSE_CHAIN, OMP_CLAUSE_CODE, OMP_CLAUSE_DECL, OMP_CLAUSE_LOCATION, OMP_CLAUSE_MAP, OMP_CLAUSE_MAP_KIND, OMP_CLAUSE_SET_MAP_KIND, OMP_CLAUSE_SIZE, omp_map_clause_descriptor_p(), ptr_type_node, TYPE_SIZE_UNIT, and unshare_expr().
Referenced by omp_accumulate_sibling_list().
Prepare calls to builtins to SAVE and RESTORE the stack as well as a temporary through which they communicate.
References builtin_decl_implicit(), create_tmp_var, gimple_build_call(), gimple_call_set_lhs(), and ptr_type_node.
Referenced by gimplify_bind_expr().
|
static |
If a NOP conversion is changing a pointer to array of foo to a pointer to foo, embed that change in the ADDR_EXPR by converting T array[U]; (T *)&array ==> &array[L] where L is the lower bound. For simplicity, only do this for constant lower bound. The constraint is that the type of &array[L] is trivially convertible to T *.
References build1(), build4(), build_pointer_type(), fold_convert, NULL_TREE, POINTER_TYPE_P, TREE_CODE, TREE_OPERAND, TREE_TYPE, TYPE_DOMAIN, TYPE_MAIN_VARIANT, TYPE_MIN_VALUE, TYPE_SIZE_UNIT, and useless_type_conversion_p().
Referenced by gimplify_conversion().
|
static |
*EXPR_P is a COMPONENT_REF being used as an rvalue. If its type is different from its canonical type, wrap the whole thing inside a NOP_EXPR and force the type of the COMPONENT_REF to be the canonical type. The canonical type of a COMPONENT_REF is the type of the field being referenced--unless the field is a bit-field which can be read directly in a smaller mode, in which case the canonical type is the sign-appropriate type corresponding to that mode.
References build_qualified_type(), gcc_assert, get_unwidened(), INTEGRAL_TYPE_P, NULL_TREE, TREE_CODE, TREE_OPERAND, TREE_TYPE, type(), TYPE_MAIN_VARIANT, TYPE_QUALS, and useless_type_conversion_p().
Referenced by gimplify_compound_lval(), and gimplify_conversion().
Return true if LABEL, a LABEL_DECL, represents a case label in a vector of labels CASES.
References CASE_LABEL, FOR_EACH_VEC_ELT, i, and label_entry::label.
Referenced by should_warn_for_implicit_fallthrough().
|
static |
Collect labels that may fall through into LABELS and return the statement preceding another case label, or a user-defined label. Store a location useful to give warnings at *PREVLOC (usually the location of the returned statement or of its surrounding scope).
References as_a(), DECL_ARTIFICIAL, find_label_entry(), gimple_bind_body(), gimple_call_internal_p(), gimple_cond_false_label(), gimple_goto_dest(), gimple_has_location(), gimple_label_label(), gimple_location(), gimple_seq_first_stmt(), gimple_seq_last_stmt(), gsi_end_p(), gsi_next(), gsi_prev(), gsi_stmt(), is_gimple_debug(), label_entry::label, last, last_stmt_in_scope(), NULL, SWITCH_BREAK_LABEL_P, UNKNOWN_LOCATION, and UNUSED_LABEL_P.
Referenced by warn_implicit_fallthrough_r().
Helper function of optimize_target_teams, determine if the expression can be computed safely before the target construct on the host.
References CASE_CONVERT, COMPARISON_CLASS_P, computable_teams_clause(), current_function_decl, DECL_ATTRIBUTES, decl_function_context(), DECL_HAS_VALUE_EXPR_P, DECL_SEEN_IN_BIND_EXPR_P, DECL_THREAD_LOCAL_P, gimplify_omp_ctx::defaultmap, error_operand_p(), GDMK_SCALAR, gimplify_omp_ctxp, GOVD_FIRSTPRIVATE, GOVD_LOCAL, GOVD_MAP, GOVD_MAP_ALWAYS_TO, INTEGRAL_TYPE_P, is_global_var(), lookup_attribute(), NULL, NULL_TREE, TARGET_EXPR_INITIAL, TARGET_EXPR_SLOT, TREE_CODE, TREE_SIDE_EFFECTS, TREE_THIS_VOLATILE, TREE_TYPE, TYPE_P, splay_tree_node< T >::value(), VAR_P, and gimplify_omp_ctx::variables.
Referenced by computable_teams_clause(), and optimize_target_teams().
void copy_if_shared | ( | tree * | tp, |
void * | data ) |
Unshare most of the shared trees rooted at *TP. DATA is passed to the copy_if_shared_r callback unmodified.
References copy_if_shared_r(), NULL, and walk_tree.
Referenced by unshare_body().
Callback for walk_tree to unshare most of the shared trees rooted at *TP. If *TP has been visited already, then *TP is deeply copied by calling mostly_copy_tree_r. DATA is passed to mostly_copy_tree_r unmodified.
References gimplify_omp_ctx::code, mostly_copy_tree_r(), NULL, NULL_TREE, tcc_constant, tcc_declaration, tcc_type, TREE_CODE, TREE_CODE_CLASS, TREE_VISITED, and walk_tree.
Referenced by copy_if_shared().
Create a temporary with a name derived from VAL. Subroutine of lookup_tmp_var; nobody else should call this function.
References create_tmp_var, get_name(), TREE_TYPE, and TYPE_MAIN_VARIANT.
Referenced by lookup_tmp_var().
|
inlinestatic |
Return a gimplify context struct from the pool.
References ctx_pool, and gimplify_ctx::prev_context.
Referenced by push_gimplify_context().
|
inlinestatic |
Put gimplify context C back into the pool.
References ctx_pool, and gimplify_ctx::prev_context.
Referenced by pop_gimplify_context().
DEBUG_FUNCTION void debug_mapping_group | ( | omp_mapping_group * | grp | ) |
References debug_generic_expr(), omp_mapping_group::grp_end, omp_mapping_group::grp_start, NULL, and OMP_CLAUSE_CHAIN.
Referenced by omp_tsort_mapping_groups_1().
Declare all the variables in VARS in SCOPE. If DEBUG_INFO is true, generate debug info for them; otherwise don't.
References as_a(), BLOCK_VARS, chainon(), DECL_CHAIN, gcc_assert, gimple_bind_block(), gimple_bind_set_vars(), gimple_bind_vars(), last, nreverse(), and TREE_CODE.
Referenced by convert_local_reference_stmt(), convert_nonlocal_omp_clauses(), convert_nonlocal_reference_stmt(), convert_tramp_reference_stmt(), finalize_nesting_tree_1(), gimple_add_tmp_var(), and pop_gimplify_context().
|
static |
Destroy an omp construct that deals with variable remapping.
References gimplify_omp_ctx::loop_iter_var, gimplify_omp_ctx::privatized_types, and gimplify_omp_ctx::variables.
Referenced by gimplify_adjust_omp_clauses(), gimplify_body(), and gimplify_omp_dispatch().
Return true if global var DECL is device resident.
References DECL_ATTRIBUTES, lookup_attribute(), OMP_CLAUSE_MAP_KIND, TREE_PURPOSE, and TREE_VALUE.
Referenced by oacc_default_clause().
Return a dummy expression of type TYPE in order to keep going after an error.
References build2(), build_int_cst(), and build_pointer_type().
Referenced by gimplify_va_arg_expr().
Emit warning for the unreachable statment STMT if needed. Return the gimple itself when the warning is emitted, otherwise return NULL.
References AUTO_INIT_UNINITIALIZED, DECL_ARTIFICIAL, gimple_assign_rhs1(), gimple_assign_single_p(), gimple_call_arg(), gimple_call_builtin_p(), gimple_call_internal_p(), gimple_goto_dest(), gimple_location(), is_gimple_assign(), NULL, SSA_NAME_DEF_STMT, TREE_CODE, TREE_INT_CST_LOW, and warning_at().
Referenced by warn_switch_unreachable_and_auto_init_r().
|
static |
Expand all FALLTHROUGH () calls in SEQ.
References expand_FALLTHROUGH_r(), NULL, pedwarn(), UNKNOWN_LOCATION, and walk_gimple_seq_mod().
Referenced by gimplify_switch_expr().
|
static |
Callback for walk_gimple_seq.
References as_a(), BUILTINS_LOCATION, DECL_ARTIFICIAL, GF_CALL_NOTHROW, gimple_call_internal_p(), gimple_goto_dest(), gimple_has_location(), gimple_label_label(), gimple_location(), gsi_end_p(), gsi_next(), gsi_remove(), gsi_stmt(), is_gimple_debug(), NULL_TREE, pedwarn(), walk_stmt_info::stmt, gimple::subcode, and UNKNOWN_LOCATION.
Referenced by expand_FALLTHROUGH().
|
static |
Strip ARRAY_REFS or an indirect ref off BASE, find the containing object, and set *BITPOSP and *POFFSETP to the bit offset of the access. If BASE_REF is non-NULL and the containing object is a reference, set *BASE_REF to that reference before dereferencing the object. If BASE_REF is NULL, check that the containing object is a COMPONENT_REF or has array type, else return NULL.
References bits_to_bytes_round_down, get_inner_reference(), NULL_TREE, offset, poly_int_tree_p(), STRIP_NOPS, and wi::to_poly_offset().
Referenced by omp_accumulate_sibling_list().
Callback for walk_tree to find a DECL_EXPR for the given DECL.
References DECL_EXPR_DECL, IS_TYPE_OR_DECL_P, NULL_TREE, and TREE_CODE.
Referenced by gimplify_scan_omp_clauses().
If EXPR is a GOTO_EXPR, return it. If it is a STATEMENT_LIST, skip any of its leading DEBUG_BEGIN_STMTS and recurse on the subsequent statement, if it is the last one. Otherwise, return NULL.
References expr, find_goto(), i, NULL_TREE, TREE_CODE, tsi_end_p(), tsi_next(), tsi_one_before_end_p(), tsi_start(), and tsi_stmt().
Referenced by find_goto(), and find_goto_label().
Same as find_goto, except that it returns NULL if the destination is not a LABEL_DECL.
References find_goto(), GOTO_DESTINATION, NULL_TREE, and TREE_CODE.
Referenced by gimplify_cond_expr(), and shortcut_cond_expr().
Callback for walk_tree to find an IFN_GOMP_DISPATCH.
References CALL_EXPR_ARG, CALL_EXPR_IFN, modify, NULL_TREE, and TREE_CODE.
Referenced by gimplify_omp_dispatch().
|
static |
Find LABEL in vector of label entries VEC.
References FOR_EACH_VEC_ELT, i, label_entry::label, and NULL.
Referenced by collect_fallthrough_labels(), and warn_implicit_fallthrough_r().
Helper function of optimize_target_teams, find OMP_TEAMS inside of OMP_TARGET's body.
References NULL_TREE, and TREE_CODE.
Referenced by optimize_target_teams().
Helper function of gimplify_omp_for, find OMP_ORDERED with null OMP_ORDERED_BODY inside of OMP_FOR's body.
References NULL_TREE, OMP_ORDERED_BODY, and TREE_CODE.
Referenced by gimplify_omp_for().
Return whether we should exclude FNDECL from instrumentation.
References lang_hooks::decl_printable_name, DECL_SOURCE_FILE, FOR_EACH_VEC_ELT, i, and NULL.
Referenced by gimplify_function_tree().
|
static |
For VAR a VAR_DECL of variable size, try to find a constant upper bound for the size and adjust DECL_SIZE/DECL_SIZE_UNIT accordingly. Abort if no such upper bound can be obtained.
References build_int_cst(), DECL_SIZE, DECL_SIZE_UNIT, gcc_assert, max_int_size_in_bytes(), TREE_TYPE, and VAR_P.
Referenced by gimple_add_tmp_var(), and gimple_add_tmp_var_fn().
A helper function to be called via walk_tree. Mark all labels under *TP as being forced. To be called for DECL_INITIAL of static variables.
References cfun, FORCED_LABEL, NULL_TREE, TREE_CODE, and TYPE_P.
Referenced by gimplify_decl_expr(), and gimplify_init_constructor().
void free_gimplify_stack | ( | void | ) |
Free allocated ctx stack memory.
References ctx_pool, free(), and gimplify_ctx::prev_context.
Referenced by expand_all_functions().
Return true if evaluating EXPR could trap. EXPR is GENERIC, while tree_could_trap_p can be called only on GIMPLE.
References EXPR_P, generic_expr_could_trap_p(), i, is_gimple_val(), tree_could_trap_p(), TREE_OPERAND, and TREE_OPERAND_LENGTH.
Referenced by expr_no_side_effects_p(), expression_expensive_p(), generic_expr_could_trap_p(), gimplify_cond_expr(), maybe_resimplify_conditional_op(), and simple_condition_p().
tree get_formal_tmp_var | ( | tree | val, |
gimple_seq * | pre_p ) |
Return a formal temporary variable initialized with VAL. PRE_P is as in gimplify_expr. Only use this function if: 1) The value of the unfactored expression represented by VAL will not change between the initialization and use of the temporary, and 2) The temporary will not be otherwise modified. For instance, #1 means that this is inappropriate for SAVE_EXPR temps, and #2 means it is inappropriate for && temps. For other cases, use get_initialized_tmp_var instead.
References internal_get_tmp_var(), and NULL.
Referenced by gimplify_expr(), gimplify_init_constructor(), gimplify_init_ctor_preeval(), gimplify_modify_expr_complex_part(), and lower_omp_for().
tree get_initialized_tmp_var | ( | tree | val, |
gimple_seq * | pre_p, | ||
gimple_seq * | post_p, | ||
bool | allow_ssa ) |
Return a temporary variable initialized with VAL. PRE_P and POST_P are as in gimplify_expr.
References internal_get_tmp_var().
Referenced by gimplify_adjust_omp_clauses(), gimplify_expr(), gimplify_expr(), gimplify_modify_expr(), gimplify_omp_atomic(), gimplify_omp_taskloop_expr(), gimplify_one_sizepos(), gimplify_save_expr(), gimplify_scan_omp_clauses(), gimplify_self_mod_expr(), and std_gimplify_va_arg_expr().
|
static |
Generate an initialization to automatic variable DECL based on INIT_TYPE. Build a call to internal const function DEFERRED_INIT: 1st argument: SIZE of the DECL; 2nd argument: INIT_TYPE; 3rd argument: NAME of the DECL; as LHS = DEFERRED_INIT (SIZE of the DECL, INIT_TYPE, NAME of the DECL).
References AUTO_INIT_UNINITIALIZED, auto_var_p(), build_call_expr_internal_loc(), build_int_cst(), build_string_literal(), DECL_NAME, DECL_SOURCE_LOCATION, DECL_UID, gcc_assert, gimplify_assign(), HOST_BITS_PER_INT, integer_type_node, TREE_TYPE, and TYPE_SIZE_UNIT.
Referenced by gimplify_decl_expr().
|
static |
Generate padding initialization for automatic variable DECL. C guarantees that brace-init with fewer initializers than members aggregate will initialize the rest of the aggregate as-if it were static initialization. In turn static initialization guarantees that padding is initialized to zero. So, we always initialize paddings to zeroes regardless INIT_TYPE. To do the padding initialization, we insert a call to __builtin_clear_padding (&decl, 0, for_auto_init = true). Note, we add an additional dummy argument for __builtin_clear_padding, 'for_auto_init' to distinguish whether this call is for automatic variable initialization or not.
References build_fold_addr_expr, build_one_cst(), builtin_decl_explicit(), DECL_HAS_VALUE_EXPR_P, DECL_VALUE_EXPR, gcc_assert, gimple_build_call(), gimplify_seq_add_stmt(), INDIRECT_REF_P, mark_addressable(), NULL_TREE, TREE_OPERAND, and TREE_TYPE.
Referenced by gimplify_decl_expr(), and gimplify_init_constructor().
void gimple_add_tmp_var | ( | tree | tmp | ) |
Push the temporary variable TMP into the current binding.
References gimplify_omp_ctx::add_safelen1, cfun, current_function_decl, DECL_CHAIN, DECL_CONTEXT, DECL_SEEN_IN_BIND_EXPR_P, DECL_SIZE_UNIT, declare_vars(), force_constant_size(), gcc_assert, gimple_body(), gimple_seq_first_stmt(), gimplify_ctxp, gimplify_omp_ctxp, GOVD_LOCAL, GOVD_PRIVATE, GOVD_SEEN, gimplify_omp_ctx::in_for_exprs, omp_add_variable(), ORT_ACC, ORT_SIMD, ORT_TASKGROUP, ORT_WORKSHARE, gimplify_omp_ctx::outer_context, record_vars(), gimplify_omp_ctx::region_type, gimplify_ctx::temps, TREE_ADDRESSABLE, TREE_CODE, tree_fits_poly_uint64_p(), and TREE_STATIC.
Referenced by create_asan_shadow_var(), create_new_iv(), create_tmp_simd_array(), create_tmp_var(), gimplify_adjust_omp_clauses_1(), gimplify_compound_literal_expr(), gimplify_decl_expr(), gimplify_expr(), gimplify_omp_depend(), gimplify_target_expr(), handle_simd_reference(), lower_omp_for_scan(), lower_omp_target(), lower_omp_task_reductions(), lower_rec_input_clauses(), lower_rec_simd_input_clauses(), and simd_clone_adjust().
Push the temporary variable TMP into the current binding.
References function::decl, DECL_CHAIN, DECL_CONTEXT, DECL_SEEN_IN_BIND_EXPR_P, DECL_SIZE_UNIT, force_constant_size(), gcc_assert, record_vars_into(), and tree_fits_poly_uint64_p().
Referenced by create_tmp_reg_fn().
|
static |
Associate the condition STMT with the discriminator UID. STMTs that are broken down with ANDIF/ORIF from the same Boolean expression should be given the same UID; 'if (a && b && c) { if (d || e) ... } ...' should yield the { a: 1, b: 1, c: 1, d: 2, e: 2 } when gimplification is done. This is used for condition coverage.
References function::cond_uids, and hash_map< KeyId, Value, Traits >::put().
Referenced by gimplify_cond_expr().
Return the stack of bindings created during gimplification.
References gimplify_ctx::bind_expr_stack, and gimplify_ctxp.
EXPR is used in a boolean context; make sure it has BOOLEAN_TYPE.
References annot_expr_ivdep_kind, annot_expr_maybe_infinite_kind, annot_expr_no_vector_kind, annot_expr_parallel_kind, annot_expr_unroll_kind, annot_expr_vector_kind, boolean_type_node, CALL_EXPR_ARG, call_expr_nargs, COMPARISON_CLASS_P, expr, EXPR_LOCATION, fndecl_built_in_p(), fold_convert_loc(), gcc_unreachable, get_callee_fndecl(), gimple_boolify(), integer_zerop(), TREE_CODE, TREE_INT_CST_LOW, TREE_OPERAND, TREE_TYPE, and truth_value_p().
Referenced by expand_omp_target(), expand_parallel_call(), expand_task_call(), gimple_boolify(), gimplify_call_expr(), gimplify_cond_expr(), gimplify_expr(), gimplify_pure_cond_expr(), and gimplify_scan_omp_clauses().
|
static |
Return true iff there is a COND_EXPR between us and the innermost CLEANUP_POINT_EXPR. This info is used by gimple_push_cleanup.
References gimplify_ctx::conditions, and gimplify_ctxp.
Referenced by gimple_push_cleanup(), and maybe_add_early_return_predict_stmt().
gbind * gimple_current_bind_expr | ( | void | ) |
Return the first element of the stack of bindings.
References gimplify_ctx::bind_expr_stack, and gimplify_ctxp.
Given a pointer value OP0, return a simplified version of an indirection through OP0, or NULL_TREE if no simplification is possible. This may only be applied to a rhs of an expression. Note that the resulting type may be different from the type pointed to in the sense that it is still compatible from the langhooks point of view.
References gimple_fold_indirect_ref().
Referenced by gimplify_modify_expr_rhs().
|
static |
Pop the first element off the stack of bindings.
References gimplify_ctx::bind_expr_stack, and gimplify_ctxp.
Referenced by gimplify_bind_expr().
|
static |
Note that we've left a COND_EXPR. If we're back at unconditional scope now, add any conditional cleanups we've seen to the prequeue.
References gimplify_ctx::conditional_cleanups, gimplify_ctx::conditions, gcc_assert, gimplify_ctxp, gimplify_seq_add_seq(), and NULL.
Referenced by gimplify_cond_expr().
|
static |
Push a GIMPLE_BIND tuple onto the stack of bindings.
References gimplify_ctx::bind_expr_stack, and gimplify_ctxp.
Referenced by gimplify_bind_expr().
|
static |
Insert a cleanup marker for gimplify_cleanup_point_expr. CLEANUP is the cleanup action required. EH_ONLY is true if the cleanup should only be executed if an exception is thrown, not on normal exit. If FORCE_UNCOND is true perform the cleanup unconditionally; this is only valid for clobbers.
References boolean_false_node, boolean_true_node, boolean_type_node, build3(), gimplify_ctx::conditional_cleanups, create_tmp_var, gimple_build_assign(), gimple_build_wce(), gimple_conditional_context(), gimple_wce_set_cleanup_eh_only(), gimplify_ctxp, gimplify_seq_add_stmt(), gimplify_stmt(), NULL, seen_error(), suppress_warning(), and void_type_node.
Referenced by gimplify_target_expr().
|
static |
Note that we've entered a COND_EXPR.
References gimplify_ctx::conditional_cleanups, gimplify_ctx::conditions, gcc_assert, gimple_seq_empty_p(), and gimplify_ctxp.
Referenced by gimplify_cond_expr().
|
static |
Rewrite the ADDR_EXPR node pointed to by EXPR_P unary_expr : ... | '&' varname ... PRE_P points to the list where side effects that must happen before *EXPR_P should be stored. POST_P points to the list where side effects that must happen after *EXPR_P should be stored.
References build_fold_addr_expr, build_fold_addr_expr_loc(), BUILT_IN_NORMAL, builtin_decl_declared_p(), DECL_FUNCTION_CODE(), EXPR_LOCATION, fb_either, fndecl_built_in_p(), fold_convert, fold_convert_loc(), gimplify_expr(), GS_ERROR, GS_OK, INDIRECT_REF_P, integer_zerop(), is_gimple_addressable(), mark_addressable(), prepare_gimple_addressable(), recompute_tree_invariant_for_addr_expr(), set_builtin_decl_implicit_p(), TREE_CODE, TREE_OPERAND, tree_ssa_useless_type_conversion(), TREE_TYPE, types_compatible_p(), and useless_type_conversion_p().
Referenced by gimplify_expr().
|
static |
References gimplify_omp_ctx::add_safelen1, build_omp_clause(), build_simple_mem_ref, gimplify_omp_ctx::clauses, gimplify_omp_ctx::code, copy_node(), DECL_ATTRIBUTES, DECL_HAS_VALUE_EXPR_P, DECL_NAME, DECL_P, DECL_SIZE, DECL_SIZE_UNIT, DECL_VALUE_EXPR, lang_hooks::decls, gimplify_omp_ctx::default_kind, delete_omp_context(), error_at(), fb_lvalue, fb_rvalue, gcc_assert, gcc_checking_assert, gcc_unreachable, get_initialized_tmp_var(), gimplify_adjust_omp_clauses_1(), gimplify_expr(), gimplify_omp_ctxp, GOVD_DATA_SHARE_CLASS, GOVD_DEBUG_PRIVATE, GOVD_FIRSTPRIVATE, GOVD_LASTPRIVATE, GOVD_LASTPRIVATE_CONDITIONAL, GOVD_LINEAR, GOVD_LOCAL, GOVD_MAP, GOVD_PRIVATE, GOVD_REDUCTION, GOVD_REDUCTION_INSCAN, GOVD_SEEN, GOVD_SHARED, GOVD_WRITTEN, GS_ERROR, gimplify_omp_ctx::has_depend, INDIRECT_REF_P, integer_one_node, is_gimple_lvalue(), is_gimple_val(), is_global_var(), gimplify_adjust_omp_clauses_data::list_p, lookup_attribute(), NULL, NULL_TREE, oacc_resolve_clause_dependencies(), omp_add_variable(), omp_build_struct_sibling_lists(), OMP_CLAUSE__CACHE_, OMP_CLAUSE_ALIGNED, OMP_CLAUSE_ALLOCATE, OMP_CLAUSE_ALLOCATE_ALLOCATOR, OMP_CLAUSE_ASYNC, OMP_CLAUSE_AUTO, OMP_CLAUSE_BIND, OMP_CLAUSE_CHAIN, OMP_CLAUSE_CODE, OMP_CLAUSE_COLLAPSE, OMP_CLAUSE_COPYIN, OMP_CLAUSE_COPYPRIVATE, OMP_CLAUSE_DECL, OMP_CLAUSE_DEFAULT, OMP_CLAUSE_DEFAULT_FIRSTPRIVATE, OMP_CLAUSE_DEFAULTMAP, OMP_CLAUSE_DEPEND, OMP_CLAUSE_DETACH, OMP_CLAUSE_DEVICE, OMP_CLAUSE_DIST_SCHEDULE, OMP_CLAUSE_DOACROSS, OMP_CLAUSE_EXCLUSIVE, OMP_CLAUSE_FILTER, OMP_CLAUSE_FINAL, OMP_CLAUSE_FINALIZE, OMP_CLAUSE_FIRSTPRIVATE, OMP_CLAUSE_FIRSTPRIVATE_IMPLICIT, OMP_CLAUSE_FIRSTPRIVATE_IMPLICIT_TARGET, OMP_CLAUSE_FROM, OMP_CLAUSE_GANG, OMP_CLAUSE_GRAINSIZE, OMP_CLAUSE_HAS_DEVICE_ADDR, OMP_CLAUSE_HINT, OMP_CLAUSE_IF, OMP_CLAUSE_IF_PRESENT, OMP_CLAUSE_IN_REDUCTION, OMP_CLAUSE_INCLUSIVE, OMP_CLAUSE_INDEPENDENT, OMP_CLAUSE_IS_DEVICE_PTR, OMP_CLAUSE_LASTPRIVATE, OMP_CLAUSE_LASTPRIVATE_CONDITIONAL, OMP_CLAUSE_LASTPRIVATE_FIRSTPRIVATE, OMP_CLAUSE_LINEAR, OMP_CLAUSE_LINEAR_NO_COPYIN, OMP_CLAUSE_LINEAR_NO_COPYOUT, OMP_CLAUSE_LOCATION, OMP_CLAUSE_MAP, OMP_CLAUSE_MAP_IN_REDUCTION, OMP_CLAUSE_MAP_KIND, OMP_CLAUSE_MERGEABLE, OMP_CLAUSE_NOGROUP, OMP_CLAUSE_NOHOST, OMP_CLAUSE_NONTEMPORAL, OMP_CLAUSE_NOWAIT, OMP_CLAUSE_NUM_GANGS, OMP_CLAUSE_NUM_TASKS, OMP_CLAUSE_NUM_TEAMS, OMP_CLAUSE_NUM_THREADS, OMP_CLAUSE_NUM_WORKERS, OMP_CLAUSE_ORDER, OMP_CLAUSE_ORDERED, OMP_CLAUSE_PRIORITY, OMP_CLAUSE_PRIVATE, OMP_CLAUSE_PRIVATE_DEBUG, OMP_CLAUSE_PROC_BIND, OMP_CLAUSE_REDUCTION, OMP_CLAUSE_REDUCTION_INSCAN, OMP_CLAUSE_SAFELEN, OMP_CLAUSE_SAFELEN_EXPR, OMP_CLAUSE_SCHEDULE, OMP_CLAUSE_SELF, OMP_CLAUSE_SEQ, OMP_CLAUSE_SET_CODE, OMP_CLAUSE_SET_MAP_KIND, OMP_CLAUSE_SHARED, OMP_CLAUSE_SHARED_READONLY, OMP_CLAUSE_SIMD, OMP_CLAUSE_SIMDLEN, OMP_CLAUSE_SIZE, OMP_CLAUSE_TASK_REDUCTION, OMP_CLAUSE_THREAD_LIMIT, OMP_CLAUSE_THREADS, OMP_CLAUSE_TILE, OMP_CLAUSE_TO, OMP_CLAUSE_UNTIED, OMP_CLAUSE_USE_DEVICE_ADDR, OMP_CLAUSE_USE_DEVICE_PTR, OMP_CLAUSE_VECTOR, OMP_CLAUSE_VECTOR_LENGTH, OMP_CLAUSE_WAIT, OMP_CLAUSE_WORKER, omp_find_stores_op(), omp_find_stores_stmt(), lang_hooks_for_decls::omp_finish_clause, omp_gather_mapping_groups(), omp_group_last(), omp_index_mapping_groups(), omp_mark_stores(), omp_notice_variable(), lang_hooks_for_decls::omp_private_debug_clause, omp_reorder_mapping_groups(), omp_resolve_clause_dependencies(), omp_segregate_mapping_groups(), omp_shared_to_firstprivate_optimizable_decl_p(), omp_tsort_mapping_groups(), ORT_ACC, ORT_ACC_PARALLEL, ORT_ACC_SERIAL, ORT_COMBINED_PARALLEL, ORT_HOST_TEAMS, ORT_PARALLEL, ORT_SIMD, ORT_TARGET, ORT_TASK, ORT_TASKLOOP, ORT_TEAMS, ORT_WORKSHARE, gimplify_omp_ctx::outer_context, poly_int_tree_p(), gimplify_adjust_omp_clauses_data::pre_p, gimplify_omp_ctx::region_type, size_zero_node, strip_array_types(), gimplify_omp_ctx::target_firstprivatize_array_bases, TREE_CODE, TREE_OPERAND, tree_to_shwi(), TREE_TYPE, TYPE_ATOMIC, TYPE_SIZE_UNIT, UNKNOWN_LOCATION, splay_tree_node< T >::value(), gimplify_omp_ctx::variables, walk_gimple_seq(), and warning_at().
Referenced by gimplify_expr(), gimplify_oacc_cache(), gimplify_oacc_declare(), gimplify_omp_for(), gimplify_omp_parallel(), gimplify_omp_target_update(), gimplify_omp_task(), and gimplify_omp_workshare().
|
static |
For all variables that were not actually used within the context, remove PRIVATE, SHARED, and FIRSTPRIVATE clauses.
References build2(), build_fold_indirect_ref_loc(), build_int_cst(), build_omp_clause(), build_pointer_type(), build_simple_mem_ref, char_type_node, gimplify_omp_ctx::code, DECL_ATTRIBUTES, DECL_IN_CONSTANT_POOL, DECL_P, DECL_SIZE, DECL_SIZE_UNIT, DECL_VALUE_EXPR, lang_hooks::decls, error(), fb_rvalue, g, gcc_assert, gcc_unreachable, varpool_node::get(), get_identifier(), gimple_add_tmp_var(), gimplify_expr(), gimplify_omp_ctxp, GOVD_ALIGNED, GOVD_CONDTEMP, GOVD_DATA_SHARE_CLASS, GOVD_DEBUG_PRIVATE, GOVD_EXPLICIT, GOVD_FIRSTPRIVATE, GOVD_LASTPRIVATE, GOVD_LASTPRIVATE_CONDITIONAL, GOVD_LINEAR, GOVD_LOCAL, GOVD_MAP, GOVD_MAP_0LEN_ARRAY, GOVD_MAP_ALLOC_ONLY, GOVD_MAP_FORCE, GOVD_MAP_FORCE_PRESENT, GOVD_MAP_FROM_ONLY, GOVD_MAP_TO_ONLY, GOVD_NONTEMPORAL, GOVD_PRIVATE, GOVD_PRIVATE_OUTER_REF, GOVD_REDUCTION, GOVD_SEEN, GOVD_SHARED, GOVD_WRITTEN, gimplify_omp_ctx::has_depend, gcc::context::have_offload, INDIRECT_REF_P, input_location, is_gimple_val(), is_global_var(), gimplify_adjust_omp_clauses_data::list_p, lookup_attribute(), NULL, NULL_TREE, symtab_node::offloadable, OMP_CLAUSE__CONDTEMP_, OMP_CLAUSE_CHAIN, OMP_CLAUSE_CODE, OMP_CLAUSE_DECL, OMP_CLAUSE_FIRSTPRIVATE, OMP_CLAUSE_FIRSTPRIVATE_IMPLICIT, OMP_CLAUSE_LASTPRIVATE, OMP_CLAUSE_LASTPRIVATE_FIRSTPRIVATE, OMP_CLAUSE_LOCATION, OMP_CLAUSE_MAP, OMP_CLAUSE_MAP_MAYBE_ZERO_LENGTH_ARRAY_SECTION, OMP_CLAUSE_MAP_RUNTIME_IMPLICIT_P, OMP_CLAUSE_PRIVATE, OMP_CLAUSE_PRIVATE_DEBUG, OMP_CLAUSE_PRIVATE_OUTER_REF, OMP_CLAUSE_SET_MAP_KIND, OMP_CLAUSE_SHARED, OMP_CLAUSE_SHARED_READONLY, OMP_CLAUSE_SIZE, lang_hooks_for_decls::omp_finish_clause, omp_mark_stores(), omp_notice_variable(), lang_hooks_for_decls::omp_private_debug_clause, omp_privatize_by_reference(), omp_shared_to_firstprivate_optimizable_decl_p(), ORT_ACC, ORT_COMBINED_PARALLEL, ORT_SIMD, ORT_TARGET, gimplify_omp_ctx::outer_context, gimplify_adjust_omp_clauses_data::pre_p, gimplify_omp_ctx::region_type, size_zero_node, strip_array_types(), gimplify_omp_ctx::target_firstprivatize_array_bases, TREE_CODE, tree_cons(), TREE_OPERAND, TREE_TYPE, TYPE_ATOMIC, TYPE_SIZE_UNIT, unshare_expr(), splay_tree_node< T >::value(), VAR_P, and gimplify_omp_ctx::variables.
Referenced by gimplify_adjust_omp_clauses().
void gimplify_and_add | ( | tree | t, |
gimple_seq * | seq_p ) |
Both gimplify the statement T and append it to *SEQ_P. This function behaves exactly as gimplify_stmt, but you don't have to pass T as a reference.
References gimplify_stmt().
Referenced by expand_ifn_va_arg_1(), force_gimple_operand_1(), gimplify_and_return_first(), gimplify_and_update_call_from_tree(), gimplify_asm_expr(), gimplify_assign(), gimplify_bind_expr(), gimplify_compound_literal_expr(), gimplify_decl_expr(), gimplify_expr(), gimplify_init_ctor_eval(), gimplify_loop_expr(), gimplify_modify_expr_rhs(), gimplify_omp_affinity(), gimplify_omp_atomic(), gimplify_omp_depend(), gimplify_omp_dispatch(), gimplify_omp_for(), gimplify_omp_loop_xform(), gimplify_omp_taskloop_expr(), gimplify_omp_workshare(), gimplify_parameters(), gimplify_return_expr(), gimplify_scan_omp_clauses(), gimplify_target_expr(), gimplify_va_arg_expr(), gimplify_vla_decl(), internal_get_tmp_var(), lower_copyprivate_clauses(), lower_lastprivate_clauses(), lower_omp_critical(), lower_omp_for_scan(), lower_omp_master(), lower_omp_scan(), lower_omp_single_copy(), lower_omp_target(), lower_rec_input_clauses(), lower_reduction_clauses(), simd_clone_init_simd_arrays(), and std_gimplify_va_arg_expr().
|
static |
Gimplify statement T into sequence *SEQ_P, and return the first tuple in the sequence of generated tuples for this statement. Return NULL if gimplifying T produced no tuples.
References gimple_seq_first_stmt(), gimplify_and_add(), gsi_end_p(), gsi_last(), gsi_next(), gsi_stmt(), and last.
Referenced by gimplify_call_expr(), gimplify_omp_for(), gimplify_omp_parallel(), gimplify_omp_task(), gimplify_omp_workshare(), and gimplify_transaction().
enum gimplify_status gimplify_arg | ( | tree * | arg_p, |
gimple_seq * | pre_p, | ||
location_t | call_location, | ||
bool | allow_ssa ) |
Helper for gimplify_call_expr. Gimplify a single argument *ARG_P Store any side-effects in PRE_P. CALL_LOCATION is the location of the CALL_EXPR. If ALLOW_SSA is set the actual parameter may be gimplified to an SSA name.
References bool, fb_either, fb_rvalue, gimplify_expr(), is_gimple_lvalue(), is_gimple_reg_type(), is_gimple_val(), maybe_with_size_expr(), NULL, protected_set_expr_location(), TARGET_EXPR_INITIAL, TREE_CODE, TREE_TYPE, and VOID_TYPE_P.
Referenced by gimplify_call_expr(), gimplify_expr(), gimplify_modify_expr(), gimplify_modify_expr_to_memcpy(), and gimplify_modify_expr_to_memset().
|
static |
Gimplify the operands of an ASM_EXPR. Input operands should be a gimple value; output operands should be a gimple lvalue.
References alloca, ASM_BASIC_P, ASM_CLOBBERS, ASM_INLINE_P, ASM_INPUTS, ASM_LABELS, ASM_OUTPUTS, ASM_STRING, ASM_VOLATILE_P, build2(), build_string(), build_tree_list(), chainon(), COMPLETE_TYPE_P, create_tmp_reg(), end(), error(), error_at(), error_mark_node, expr, EXPR_LOC_OR_LOC, fb_lvalue, fb_mayfail, fb_rvalue, free(), get_base_address(), gimple_asm_set_basic(), gimple_asm_set_inline(), gimple_asm_set_volatile(), gimple_build_asm_vec(), gimplify_and_add(), gimplify_expr(), gimplify_seq_add_stmt(), GS_ALL_DONE, GS_ERROR, GS_OK, handled_component_p(), i, input_location, is_gimple_asm_val(), is_gimple_lvalue(), is_gimple_min_lval(), is_gimple_reg(), is_gimple_reg_type(), is_gimple_val(), list_length(), mark_addressable(), NULL, NULL_TREE, parse_input_constraint(), parse_output_constraint(), prepare_gimple_addressable(), STRIP_NOPS, TREE_ADDRESSABLE, TREE_CHAIN, TREE_CODE, tree_fits_poly_uint64_p(), TREE_OPERAND, TREE_PURPOSE, TREE_STRING_POINTER, TREE_TYPE, TREE_VALUE, TYPE_SIZE_UNIT, unshare_expr(), VAR_P, vec_safe_push(), VOID_TYPE_P, and warning_at().
Referenced by gimplify_expr().
gimple * gimplify_assign | ( | tree | dst, |
tree | src, | ||
gimple_seq * | seq_p ) |
Build a new GIMPLE_ASSIGN tuple and append it to the end of *SEQ_P. DST/SRC are the destination and source respectively. You can pass ungimplified trees in DST or SRC, in which case they will be converted to a gimple operand if necessary. This function returns the newly created GIMPLE_ASSIGN tuple.
References build2(), ggc_free(), gimple_seq_last_stmt(), gimplify_and_add(), and TREE_TYPE.
Referenced by expand_ifn_va_arg_1(), gimple_add_init_for_auto_var(), gimplify_expr(), gimplify_omp_for(), gimplify_parameters(), gimplify_self_mod_expr(), handle_simd_reference(), lower_copyprivate_clauses(), lower_lastprivate_clauses(), lower_oacc_reductions(), lower_omp_for_lastprivate(), lower_omp_for_scan(), lower_omp_ordered(), lower_omp_scan(), lower_omp_single_copy(), lower_omp_target(), lower_omp_task_reductions(), lower_private_allocate(), lower_rec_input_clauses(), lower_reduction_clauses(), lower_send_clauses(), lower_send_shared_vars(), oacc_xform_loop(), and oacc_xform_tile().
|
static |
Gimplify a BIND_EXPR. Just voidify and recurse.
References gimplify_omp_ctx::add_safelen1, asan_poison_variable(), asan_poisoned_variables, BIND_EXPR_BLOCK, BIND_EXPR_BODY, BIND_EXPR_VARS, BLOCK_SOURCE_END_LOCATION, BLOCK_SOURCE_LOCATION, build_call_expr_loc(), build_clobber(), build_fold_indirect_ref, build_int_cst(), build_pointer_type(), build_stack_save_restore(), build_tree_list(), build_zero_cst(), builtin_decl_explicit(), cfun, CLOBBER_STORAGE_END, hash_set< KeyId, Lazy, Traits >::contains(), create_tmp_var, current_function_decl, DECL_ALIGN_UNIT, DECL_ARTIFICIAL, DECL_ATTRIBUTES, DECL_CHAIN, DECL_CONTEXT, DECL_EXTERNAL, DECL_HARD_REGISTER, DECL_HAS_VALUE_EXPR_P, DECL_IGNORED_P, DECL_P, DECL_SEEN_IN_BIND_EXPR_P, DECL_SIZE_UNIT, DECL_SOURCE_LOCATION, DECL_VALUE_EXPR, error_at(), errorcount, EXPR_LOCATION, fold_build2_loc(), fold_convert, g, gcc_assert, cgraph_node::get(), hash_map< KeyId, Value, Traits >::get(), varpool_node::get(), get_identifier(), get_name(), GF_OMP_TARGET_KIND_OACC_DECLARE, gimple_bind_body(), gimple_bind_set_body(), gimple_build_assign(), gimple_build_bind(), gimple_build_omp_target(), gimple_build_try(), gimple_pop_bind_expr(), gimple_push_bind_expr(), gimple_set_location(), GIMPLE_TRY_FINALLY, gimplify_and_add(), gimplify_ctxp, gimplify_omp_ctxp, gimplify_seq_add_stmt(), gimplify_stmt(), GOVD_LOCAL, GOVD_PRIVATE, GOVD_SEEN, GS_ALL_DONE, GS_OK, gsi_insert_seq_before_without_update(), GSI_NEW_STMT, gsi_start(), gcc::context::have_offload, INDIRECT_REF_P, integer_onep(), hash_map< KeyId, Value, Traits >::is_empty(), is_gimple_reg(), is_global_var(), gimplify_ctx::keep_stack, lang_GNU_Fortran(), gimplify_ctx::live_switch_vars, lookup_attribute(), MAX, NULL, NULL_TREE, oacc_declare_returns, offload_vars, symtab_node::offloadable, omp_add_variable(), OMP_CLAUSE_CHAIN, OMP_REQUIRES_DYNAMIC_ALLOCATORS, omp_requires_mask, ORT_NONE, ORT_SIMD, ORT_TARGET, gimplify_omp_ctx::outer_context, POINTER_TYPE_P, ptr_type_node, gimplify_omp_ctx::region_type, hash_map< KeyId, Value, Traits >::remove(), hash_set< KeyId, Lazy, Traits >::remove(), remove_attribute(), gimplify_ctx::save_stack, SET_DECL_VALUE_EXPR, si, size_type_node, sl, SR_NONE, TREE_ADDRESSABLE, TREE_CHAIN, TREE_CODE, tree_cons(), TREE_OPERAND, TREE_PURPOSE, TREE_STATIC, TREE_THIS_NOTRAP, TREE_THIS_VOLATILE, tree_to_uhwi(), TREE_TYPE, TREE_USED, TREE_VALUE, tsi_end_p(), tsi_last(), tsi_link_after(), tsi_link_before(), TSI_SAME_STMT, tsi_start(), TYPE_SIZE_UNIT, unshare_expr(), VAR_P, gimplify_omp_ctx::variables, vec_safe_push(), void_type_node, and voidify_wrapper_expr().
Referenced by gimplify_expr().
Gimplify the body of statements of FNDECL and return a GIMPLE_BIND node containing the sequence of corresponding GIMPLE statements. If DO_PARMS is true, also gimplify the parameters.
References as_a(), cfun, current_function_decl, DECL_ARGUMENTS, DECL_ATTRIBUTES, DECL_CHAIN, DECL_HAS_VALUE_EXPR_P, DECL_IGNORED_P, DECL_SAVED_TREE, DECL_SOURCE_LOCATION, default_rtl_profile(), delete_omp_context(), g, gcc_assert, gimple_bind_body(), gimple_bind_set_body(), gimple_build_bind(), gimple_build_nop(), gimple_build_try(), gimple_seq_add_seq_without_update(), gimple_seq_add_stmt(), gimple_seq_empty_p(), gimple_seq_first_nondebug_stmt(), gimple_seq_first_stmt(), gimple_seq_last_nondebug_stmt(), gimple_seq_last_stmt(), GIMPLE_TRY_FINALLY, gimplify_ctxp, gimplify_omp_ctxp, gimplify_parameters(), gimplify_seq_add_seq(), gimplify_seq_add_stmt(), gimplify_stmt(), gsi_for_stmt(), gsi_remove(), gsi_split_seq_after(), init_tree_ssa(), input_location, lookup_attribute(), new_omp_context(), NULL, NULL_TREE, ORT_IMPLICIT_TARGET, pop_gimplify_context(), push_gimplify_context(), seen_error(), timevar_pop(), timevar_push(), unshare_body(), unvisit_body(), and verify_gimple_in_seq().
Referenced by finalize_task_copyfn(), and gimplify_function_tree().
|
static |
Gimplify the CALL_EXPR node *EXPR_P into the GIMPLE sequence PRE_P. WANT_VALUE is true if the result of the call is desired.
References boolean_type_node, build1(), build2(), build3(), build_call_array_loc(), build_call_expr_loc(), build_empty_stmt(), build_omp_clause(), build_zero_cst(), BUILT_IN_NORMAL, builtin_decl_explicit(), CALL_ALLOCA_FOR_VAR_P, CALL_EXPR_ARG, CALL_EXPR_ARGP, call_expr_flags(), CALL_EXPR_FN, CALL_EXPR_IFN, call_expr_nargs, CALL_EXPR_RETURN_SLOT_OPT, CALL_EXPR_STATIC_CHAIN, CALL_EXPR_TAILCALL, CALL_EXPR_VA_ARG_PACK, CALL_FROM_THUNK_P, CASE_BUILT_IN_ALLOCA, cfun, gimplify_omp_ctx::clauses, gimplify_omp_ctx::code, create_tmp_var, DECL_ARGUMENTS, DECL_ATTRIBUTES, DECL_FUNCTION_CODE(), DECL_NAME, DECL_P, DECL_SOURCE_LOCATION, DECL_STATIC_CHAIN, ECF_CONST, ECF_LOOPING_CONST_OR_PURE, ECF_PURE, ECF_RETURNS_TWICE, wi::eq_p(), error(), error_at(), error_mark_node, EXPR_HAS_LOCATION, EXPR_LOCATION, EXPR_P, fb_rvalue, fndecl_built_in_p(), fold_builtin_next_arg(), fold_call_expr(), g, gcc_assert, gcc_checking_assert, get_callee_fndecl(), gimple_boolify(), gimple_build_assume(), gimple_build_call(), gimple_build_call_from_tree(), gimple_build_call_internal_vec(), gimple_call_return_type(), gimple_call_set_lhs(), gimple_call_set_nothrow(), gimple_set_location(), gimplify_and_return_first(), gimplify_arg(), gimplify_ctxp, gimplify_expr(), gimplify_omp_ctxp, gimplify_seq_add_stmt(), GS_ALL_DONE, GS_ERROR, GS_OK, gsi_last(), i, gimplify_omp_ctx::in_call_args, inform(), input_location, integer_zerop(), is_gimple_call_addr(), gimplify_ctx::keep_stack, gimplify_omp_ctx::location, lookup_attribute(), maybe_fold_stmt(), notice_special_calls(), NULL, NULL_TREE, OMP_CLAUSE_CHAIN, OMP_CLAUSE_CODE, OMP_CLAUSE_DECL, OMP_CLAUSE_DEVICE, OMP_CLAUSE_DEVICE_ID, OMP_CLAUSE_HAS_DEVICE_ADDR, OMP_CLAUSE_INTEROP, OMP_CLAUSE_IS_DEVICE_PTR, OMP_CLAUSE_LOCATION, omp_find_clause(), omp_resolve_declare_variant(), pop_gimplify_context(), PROP_gimple_any, PUSH_ARGS_REVERSED, push_gimplify_context(), gimplify_ctx::save_stack, seen_error(), SET_EXPR_LOCATION, simple_condition_p(), sorry_at(), wi::to_wide(), TREE_CHAIN, TREE_CODE, TREE_NOTHROW, TREE_OPERAND, TREE_PURPOSE, TREE_SIDE_EFFECTS, tree_strip_nop_conversions(), TREE_TYPE, TREE_VALUE, TYPE_ARG_TYPES, VAR_P, void_node, void_type_node, VOID_TYPE_P, and warning_at().
Referenced by gimplify_expr().
|
static |
Gimplify the CASE_LABEL_EXPR pointed to by EXPR_P.
References CASE_LABEL, gimplify_ctx::case_labels, DECL_ATTRIBUTES, EXPR_LOCATION, gimple_build_label(), gimple_build_predict(), gimple_seq_add_stmt(), gimple_set_location(), gimplify_ctxp, gimplify_seq_add_stmt(), GS_ALL_DONE, lookup_attribute(), NOT_TAKEN, gimplify_ctx::prev_context, and TAKEN.
Referenced by gimplify_expr().
|
static |
Gimplify a CLEANUP_POINT_EXPR. Currently this works by adding GIMPLE_WITH_CLEANUP_EXPRs to the prequeue as we encounter cleanups while gimplifying the body, and converting them to TRY_FINALLY_EXPRs when we return to this function. FIXME should we complexify the prequeue handling instead? Or use flags for all the cleanups and let the optimizer tighten them up? The current code seems pretty fragile; it will break on a cleanup within any non-conditional nesting. But any such nesting would be broken, anyway; we can't write a TRY_FINALLY_EXPR that starts inside a nesting construct and continues out of it. We can do that at the RTL level, though, so having an optimizer to tighten up try/finally regions would be a Good Thing.
References gimplify_ctx::conditional_cleanups, gimplify_ctx::conditions, gtry::eval, gimple_build_try(), GIMPLE_TRY_CATCH, GIMPLE_TRY_FINALLY, gimple_wce_cleanup(), gimple_wce_cleanup_eh_only(), gimplify_ctxp, gimplify_seq_add_seq(), gimplify_stmt(), GS_ALL_DONE, GS_OK, gsi_end_p(), gsi_insert_seq_before_without_update(), gsi_next(), gsi_one_before_end_p(), gsi_remove(), GSI_SAME_STMT, gsi_set_stmt(), gsi_split_seq_after(), gsi_start(), gsi_stmt(), gimplify_ctx::in_cleanup_point_expr, NULL, TREE_OPERAND, and voidify_wrapper_expr().
Referenced by gimplify_expr().
|
static |
Forward declaration.
Gimplify an expression sequence. This function gimplifies each expression and rewrites the original expression with the last expression of the sequence in GIMPLE form. PRE_P points to the list where the side effects for all the expressions in the sequence will be emitted. WANT_VALUE is true when the result of the last COMPOUND_EXPR is used.
References gimplify_compound_expr(), gimplify_stmt(), GS_ALL_DONE, GS_OK, TREE_CODE, and TREE_OPERAND.
Referenced by gimplify_compound_expr(), gimplify_cond_expr(), gimplify_expr(), and gimplify_modify_expr_rhs().
|
static |
Gimplify a C99 compound literal expression. This just means adding the DECL_EXPR before the current statement and using its anonymous decl instead.
References COMPOUND_LITERAL_EXPR_DECL_EXPR, DECL_EXPR_DECL, DECL_INITIAL, DECL_NAME, DECL_SEEN_IN_BIND_EXPR_P, fb_lvalue, gimple_add_tmp_var(), gimplify_and_add(), GS_OK, NULL_TREE, TREE_ADDRESSABLE, TREE_READONLY, and TREE_THIS_VOLATILE.
Referenced by gimplify_expr().
|
static |
Gimplify the COMPONENT_REF, ARRAY_REF, REALPART_EXPR or IMAGPART_EXPR node *EXPR_P. compound_lval : min_lval '[' val ']' | min_lval '.' ID | compound_lval '[' val ']' | compound_lval '.' ID This is not part of the original SIMPLE definition, which separates array and member references, but it seems reasonable to handle them together. Also, this way we don't run into problems with union aliasing; gcc requires that for accesses through a union to alias, the union reference must be explicit, which was not always the case when we were splitting up array and member refs. PRE_P points to the sequence where side effects that must happen before *EXPR_P should be stored. POST_P points to the sequence where side effects that must happen after *EXPR_P should be stored.
References array_ref_element_size(), array_ref_low_bound(), canonicalize_component_ref(), component_ref_field_offset(), DECL_OFFSET_ALIGN, error_operand_p(), EXPR_LOCATION, fb_lvalue, fb_rvalue, fold_indirect_ref_loc(), gcc_assert, gimplify_expr(), gimplify_var_or_parm_decl(), GS_ALL_DONE, GS_ERROR, GS_OK, handled_component_p(), i, is_gimple_min_invariant(), is_gimple_min_lval(), is_gimple_reg(), is_gimple_reg_type(), is_gimple_val(), MIN, NULL_TREE, offset, prepare_gimple_addressable(), recalculate_side_effects(), size_binop_loc(), size_int, STRIP_USELESS_TYPE_CONVERSION, TREE_CODE, TREE_OPERAND, TREE_TYPE, TYPE_ALIGN_UNIT, unshare_expr(), and VAR_P.
Referenced by gimplify_expr().
|
static |
Convert the conditional expression pointed to by EXPR_P '(p) ? a : b;' into if (p) if (p) t1 = a; a; else or else t1 = b; b; t1; The second form is used when *EXPR_P is of type void. PRE_P points to the list where side effects that must happen before *EXPR_P should be stored.
References gimplify_ctx::allow_rhs_cond_expr, build2(), build3(), build_fold_addr_expr_loc(), build_pointer_type(), build_simple_mem_ref_loc(), cfun, COND_EXPR_COND, cond_uids, copy_warning(), create_artificial_label(), create_tmp_var, current_function_decl, DECL_CONTEXT, expr, EXPR_HAS_LOCATION, EXPR_LOCATION, fb_lvalue, fb_rvalue, find_goto_label(), g, gcc_assert, generic_expr_could_trap_p(), hash_map< KeyId, Value, Traits >::get(), gimple_associate_condition_with_expr(), gimple_boolify(), gimple_build_cond(), gimple_build_goto(), gimple_build_label(), gimple_cond_get_ops_from_tree(), gimple_pop_condition(), gimple_push_condition(), gimple_seq_add_seq(), gimple_seq_may_fallthru(), gimple_set_do_not_emit_location(), gimple_set_location(), gimplify_compound_expr(), gimplify_ctxp, gimplify_expr(), gimplify_pure_cond_expr(), gimplify_seq_add_stmt(), gimplify_stmt(), GOTO_DESTINATION, GS_ALL_DONE, GS_ERROR, gsi_last(), integer_nonzerop(), integer_zerop(), is_gimple_condexpr_for_cond(), maybe_fold_stmt(), next_cond_uid(), NULL, NULL_TREE, recalculate_side_effects(), rexpr_has_location(), rexpr_location(), shortcut_cond_expr(), STRIP_TYPE_NOPS, TREE_ADDRESSABLE, TREE_CODE, TREE_OPERAND, TREE_SIDE_EFFECTS, TREE_TYPE, UNKNOWN_LOCATION, UNUSED_LABEL_P, void_type_node, and VOID_TYPE_P.
Referenced by gimplify_expr().
|
static |
*EXPR_P is a NOP_EXPR or CONVERT_EXPR. Remove it and/or other conversions underneath as appropriate.
References canonicalize_addr_expr(), canonicalize_component_ref(), CONVERT_EXPR_P, EXPR_LOCATION, fold_build1_loc(), gcc_assert, GS_OK, is_gimple_reg_type(), STRIP_SIGN_NOPS, TREE_CODE, TREE_OPERAND, TREE_SET_CODE, tree_ssa_useless_type_conversion(), and TREE_TYPE.
Referenced by gimplify_expr().
|
static |
Gimplify a DECL_EXPR node *STMT_P by making any necessary allocation and initialization explicit.
References hash_set< KeyId, Lazy, Traits >::add(), asan_poison_variable(), asan_poisoned_variables, AUTO_INIT_PATTERN, build2(), clear_padding_type_may_have_padding_p(), dbg_cnt(), DECL_ALIGN, DECL_ARTIFICIAL, DECL_EXPR_DECL, DECL_EXTERNAL, DECL_HAS_VALUE_EXPR_P, DECL_INITIAL, DECL_NAME, DECL_ORIGINAL_TYPE, DECL_SEEN_IN_BIND_EXPR_P, DECL_SIZE_UNIT, error_mark_node, force_labels_r(), GENERIC_STACK_CHECK, ggc_free(), gimple_add_init_for_auto_var(), gimple_add_padding_init_for_auto_var(), gimple_add_tmp_var(), gimplify_and_add(), gimplify_ctxp, gimplify_omp_ctxp, gimplify_type_sizes(), gimplify_vla_decl(), GS_ALL_DONE, GS_ERROR, is_gimple_reg(), is_var_need_auto_init(), gimplify_ctx::live_switch_vars, MAX_SUPPORTED_STACK_ALIGNMENT, maybe_gt, NULL, NULL_TREE, omp_privatize_by_reference(), poly_int_tree_p(), TREE_ADDRESSABLE, TREE_CODE, TREE_READONLY, TREE_STATIC, TREE_TYPE, TYPE_SIZES_GIMPLIFIED, VAR_P, void_type_node, and walk_tree.
Referenced by gimplify_expr().
|
static |
Gimplify an EXIT_EXPR by converting to a GOTO_EXPR inside a COND_EXPR. This also involves building a label to jump to and communicating it to gimplify_loop_expr through gimplify_ctxp->exit_label.
References build3(), build_and_jump(), gimplify_ctx::exit_label, expr, gimplify_ctxp, GS_OK, NULL_TREE, TREE_OPERAND, and void_type_node.
Referenced by gimplify_expr().
|
static |
Like gimplify_expr but make sure the gimplified result is not itself a SSA name (but a decl if it were). Temporaries required by evaluating *EXPR_P may be still SSA names.
References get_initialized_tmp_var(), gimplify_expr(), NULL, and TREE_CODE.
Referenced by expand_ifn_va_arg_1(), force_gimple_operand_1(), gimple_regimplify_operands(), gimplify_addr_expr(), gimplify_adjust_omp_clauses(), gimplify_adjust_omp_clauses_1(), gimplify_arg(), gimplify_asm_expr(), gimplify_call_expr(), gimplify_compound_lval(), gimplify_cond_expr(), gimplify_expr(), gimplify_expr(), gimplify_init_constructor(), gimplify_init_ctor_eval(), gimplify_init_ctor_eval_range(), gimplify_init_ctor_preeval(), gimplify_modify_expr(), gimplify_modify_expr_rhs(), gimplify_omp_affinity(), gimplify_omp_atomic(), gimplify_omp_depend(), gimplify_omp_dispatch(), gimplify_omp_for(), gimplify_omp_loop(), gimplify_omp_loop_xform(), gimplify_one_sizepos(), gimplify_pure_cond_expr(), gimplify_save_expr(), gimplify_scan_omp_clauses(), gimplify_self_mod_expr(), gimplify_stmt(), gimplify_switch_expr(), gimplify_target_expr(), goa_stabilize_expr(), internal_get_tmp_var(), lower_depend_clauses(), lower_lastprivate_clauses(), lower_omp_target(), lower_omp_teams(), lower_rec_input_clauses(), lower_reduction_clauses(), optimize_target_teams(), and std_gimplify_va_arg_expr().
enum gimplify_status gimplify_expr | ( | tree * | expr_p, |
gimple_seq * | pre_p, | ||
gimple_seq * | post_p, | ||
bool(* | gimple_test_f )(tree), | ||
fallback_t | fallback ) |
Convert the GENERIC expression tree *EXPR_P to GIMPLE. If the expression produces a value to be used as an operand inside a GIMPLE statement, the value will be stored back in *EXPR_P. This value will be a tree of class tcc_declaration, tcc_constant, tcc_reference or an SSA_NAME. The corresponding sequence of GIMPLE statements is emitted in PRE_P and POST_P. Additionally, this process may overwrite parts of the input expression during gimplification. Ideally, it should be possible to do non-destructive gimplification. EXPR_P points to the GENERIC expression to convert to GIMPLE. If the expression needs to evaluate to a value to be used as an operand in a GIMPLE statement, this value will be stored in *EXPR_P on exit. This happens when the caller specifies one of fb_lvalue or fb_rvalue fallback flags. PRE_P will contain the sequence of GIMPLE statements corresponding to the evaluation of EXPR and all the side-effects that must be executed before the main expression. On exit, the last statement of PRE_P is the core statement being gimplified. For instance, when gimplifying 'if (++a)' the last statement in PRE_P will be 'if (t.1)' where t.1 is the result of pre-incrementing 'a'. POST_P will contain the sequence of GIMPLE statements corresponding to the evaluation of all the side-effects that must be executed after the main expression. If this is NULL, the post side-effects are stored at the end of PRE_P. The reason why the output is split in two is to handle post side-effects explicitly. In some cases, an expression may have inner and outer post side-effects which need to be emitted in an order different from the one given by the recursive traversal. For instance, for the expression (*p--)++ the post side-effects of '--' must actually occur *after* the post side-effects of '++'. However, gimplification will first visit the inner expression, so if a separate POST sequence was not used, the resulting sequence would be: 1 t.1 = *p 2 p = p - 1 3 t.2 = t.1 + 1 4 *p = t.2 However, the post-decrement operation in line #2 must not be evaluated until after the store to *p at line #4, so the correct sequence should be: 1 t.1 = *p 2 t.2 = t.1 + 1 3 *p = t.2 4 p = p - 1 So, by specifying a separate post queue, it is possible to emit the post side-effects in the correct order. If POST_P is NULL, an internal queue will be used. Before returning to the caller, the sequence POST_P is appended to the main output sequence PRE_P. GIMPLE_TEST_F points to a function that takes a tree T and returns nonzero if T is in the GIMPLE form requested by the caller. The GIMPLE predicates are in gimple.cc. FALLBACK tells the function what sort of a temporary we want if gimplification cannot produce an expression that complies with GIMPLE_TEST_F. fb_none means that no temporary should be generated fb_rvalue means that an rvalue is OK to generate fb_lvalue means that an lvalue is OK to generate fb_either means that either is OK, but an lvalue is preferable. fb_mayfail means that gimplification may fail (in which case GS_ERROR will be returned) The return value is either GS_ERROR or GS_ALL_DONE, since this function iterates until EXPR is completely gimplified or an error occurs.
References AGGREGATE_TYPE_P, gimplify_ctx::allow_rhs_cond_expr, annotate_all_with_location(), annotate_all_with_location_after(), append_to_statement_list(), asan_poison_variables(), asan_poisoned_variables, asan_used_labels, boolean_false_node, boolean_true_node, build1_loc(), build2(), build2_loc(), build3_loc(), build_aligned_type(), build_fold_addr_expr_loc(), build_int_cst(), build_zero_cst(), builtin_decl_explicit(), CASE_CONVERT, CATCH_BODY, CATCH_TYPES, cfun, gimplify_omp_ctx::code, COMPLETE_TYPE_P, CONSTRUCTOR_ELTS, hash_set< KeyId, Lazy, Traits >::contains(), copy_warning(), create_tmp_var, create_tmp_var_raw(), current_function_decl, debug_tree(), decl_function_context(), DECL_INITIAL, drop_tree_overflow(), EH_FILTER_FAILURE, EH_FILTER_TYPES, error_mark_node, error_operand_p(), EXPR_HAS_LOCATION, EXPR_LOCATION, failure, fb_either, fb_lvalue, fb_mayfail, fb_none, fb_rvalue, fold_binary, fold_build2_loc(), fold_convert_loc(), fold_indirect_ref_loc(), FOR_EACH_CONSTRUCTOR_VALUE, FORCED_LABEL, g, gcc_assert, gcc_unreachable, get_formal_tmp_var(), get_initialized_tmp_var(), get_object_alignment(), gimple_add_tmp_var(), gimple_boolify(), gimple_build_call(), gimple_build_call_internal(), gimple_build_catch(), gimple_build_debug_begin_stmt(), gimple_build_eh_else(), gimple_build_eh_filter(), gimple_build_goto(), gimple_build_omp_critical(), gimple_build_omp_masked(), gimple_build_omp_master(), gimple_build_omp_scan(), gimple_build_omp_section(), gimple_build_omp_structured_block(), gimple_build_omp_taskgroup(), gimple_build_predict(), gimple_build_try(), gimple_call_set_lhs(), gimple_in_ssa_p(), gimple_omp_ordered_standalone(), gimple_seq_add_seq(), gimple_seq_add_stmt(), gimple_seq_empty_p(), gimple_set_location(), GIMPLE_TRY_CATCH, GIMPLE_TRY_FINALLY, gimple_try_set_catch_is_cleanup(), gimplify_addr_expr(), gimplify_adjust_omp_clauses(), gimplify_and_add(), gimplify_arg(), gimplify_asm_expr(), gimplify_assign(), gimplify_bind_expr(), gimplify_call_expr(), gimplify_case_label_expr(), gimplify_cleanup_point_expr(), gimplify_compound_expr(), gimplify_compound_literal_expr(), gimplify_compound_lval(), gimplify_cond_expr(), gimplify_conversion(), gimplify_ctxp, gimplify_decl_expr(), gimplify_exit_expr(), gimplify_expr(), lang_hooks::gimplify_expr, gimplify_label_expr(), gimplify_loop_expr(), gimplify_modify_expr(), gimplify_oacc_cache(), gimplify_oacc_declare(), gimplify_omp_atomic(), gimplify_omp_ctxp, gimplify_omp_dispatch(), gimplify_omp_for(), gimplify_omp_loop(), gimplify_omp_ordered(), gimplify_omp_parallel(), gimplify_omp_target_update(), gimplify_omp_task(), gimplify_omp_workshare(), gimplify_return_expr(), gimplify_save_expr(), gimplify_scalar_mode_aggregate_compare(), gimplify_scan_omp_clauses(), gimplify_self_mod_expr(), gimplify_seq_add_seq(), gimplify_seq_add_stmt(), gimplify_statement_list(), gimplify_switch_expr(), gimplify_target_expr(), gimplify_transaction(), gimplify_va_arg_expr(), gimplify_var_or_parm_decl(), gimplify_variable_sized_compare(), GOTO_DESTINATION, GS_ALL_DONE, GS_ERROR, GS_OK, GS_UNHANDLED, gsi_last(), gimplify_ctx::in_handler_expr, in_omp_construct, input_location, INTEGRAL_TYPE_P, internal_error(), gimplify_ctx::into_ssa, IS_EMPTY_STMT, is_empty_type(), is_gimple_addressable(), is_gimple_asm_val(), is_gimple_call_addr(), is_gimple_condexpr_for_cond(), is_gimple_lvalue(), is_gimple_mem_ref_addr(), is_gimple_mem_rhs(), is_gimple_mem_rhs_or_call(), is_gimple_min_lval(), is_gimple_reg(), is_gimple_reg_rhs(), is_gimple_reg_rhs_or_call(), is_gimple_reg_type(), is_gimple_stmt(), is_gimple_val(), LABEL_EXPR_LABEL, gimplify_ctx::live_switch_vars, LOCATION_LOCUS, mark_addressable(), MIN, NULL, NULL_TREE, OBJ_TYPE_REF_EXPR, OBJ_TYPE_REF_OBJECT, OMP_BODY, OMP_CRITICAL_CLAUSES, OMP_CRITICAL_NAME, OMP_MASKED_CLAUSES, omp_notice_variable(), OMP_SCAN_CLAUSES, OMP_TASKGROUP_CLAUSES, ORT_TASKGROUP, ORT_WORKSHARE, PREDICT_EXPR_OUTCOME, PREDICT_EXPR_PREDICTOR, print_generic_expr(), recalculate_side_effects(), REF_REVERSE_STORAGE_ORDER, reference_alias_ptr_type(), gimplify_ctx::return_temp, save_expr(), SCALAR_INT_MODE_P, sorry_at(), STRIP_USELESS_TYPE_CONVERSION, tcc_binary, tcc_comparison, tcc_constant, tcc_declaration, tcc_unary, TMR_BASE, TMR_INDEX, TMR_INDEX2, TREE_BLOCK, TREE_CODE, TREE_CODE_CLASS, TREE_OPERAND, TREE_OVERFLOW_P, TREE_SET_CODE, TREE_SIDE_EFFECTS, TREE_THIS_NOTRAP, TREE_THIS_VOLATILE, TREE_TYPE, TRY_CATCH_IS_CLEANUP, TYPE_ALIGN, TYPE_MAIN_VARIANT, TYPE_MODE, TYPE_PRECISION, UNKNOWN_LOCATION, useless_type_conversion_p(), and VOID_TYPE_P.
void gimplify_function_tree | ( | tree | fndecl | ) |
Entry point to the gimplification pass. FNDECL is the FUNCTION_DECL node for the function we want to gimplify. Return the sequence of GIMPLE statements corresponding to the body of FNDECL.
References varpool_node::add(), asan_poisoned_variables, asan_sanitize_use_after_scope(), boolean_false_node, boolean_true_node, boolean_type_node, build_decl(), build_instrumentation_call(), cfun, cond_uids, create_tmp_var, create_tmp_var_name(), current_function_decl, DECL_ARTIFICIAL, DECL_DECLARED_INLINE_P, DECL_DISREGARD_INLINE_LIMITS, DECL_EXTERNAL, DECL_IGNORED_P, DECL_INITIAL, DECL_NO_INSTRUMENT_FUNCTION_ENTRY_EXIT, DECL_SAVED_TREE, DECL_SOURCE_LOCATION, DECL_STRUCT_FUNCTION, dump_function(), flag_instrument_functions_exclude_p(), gcc_assert, gimple_body(), gimple_build_assign(), gimple_build_bind(), gimple_build_call_internal(), gimple_build_try(), gimple_seq_add_stmt(), gimple_set_body(), GIMPLE_TRY_FINALLY, gimplify_body(), gimplify_seq_add_stmt(), NULL, NULL_TREE, pop_cfun(), PROP_gimple_any, PROP_gimple_lva, push_cfun(), push_struct_function(), reset_cond_uid(), sanitize_flags_p(), SANITIZE_THREAD, TDI_gimple, TREE_STATIC, TREE_THIS_VOLATILE, and TREE_USED.
Referenced by cgraph_node::analyze(), cgraph_build_static_cdtor_1(), expand_omp_target(), finalize_size_functions(), and gimplify_all_functions().
|
static |
A subroutine of gimplify_modify_expr. Break out elements of a CONSTRUCTOR used as an initializer into separate MODIFY_EXPRs. Note that we still need to clear any elements that don't have explicit initializers, so if not all elements are initialized we keep the original MODIFY_EXPR, we just remove all of the constructor elements. If NOTIFY_TEMP_CREATION is true, do not gimplify, just return GS_ERROR if we would have to create a temporary when gimplifying this constructor. Otherwise, return GS_OK. If NOTIFY_TEMP_CREATION is false, just do the gimplification.
References AGGREGATE_TYPE_P, build1(), build2(), build_complex(), build_vector_from_ctor(), build_zero_cst(), can_move_by_pieces(), categorize_ctor_elements(), cfun, clear_padding_type_may_have_padding_p(), CONSTANT_CLASS_P, CONSTRUCTOR_ELTS, CONSTRUCTOR_NO_CLEARING, create_tmp_var, create_tmp_var_name(), DECL_ALIGN, DECL_INITIAL, DECL_MERGEABLE, DECL_NAME, DECL_NAMELESS, DECL_P, DECL_REGISTER, fb_lvalue, fb_rvalue, FOR_EACH_CONSTRUCTOR_VALUE, FOR_EACH_VEC_SAFE_ELT, force_labels_r(), gcc_assert, gcc_unreachable, get_alias_set(), get_base_address(), get_formal_tmp_var(), gimple_add_padding_init_for_auto_var(), gimple_build_assign(), gimplify_expr(), gimplify_init_ctor_eval(), gimplify_init_ctor_preeval(), gimplify_seq_add_stmt(), gimplify_stmt(), GS_ALL_DONE, GS_ERROR, GS_OK, GS_UNHANDLED, i, initializer_constant_valid_p(), int_size_in_bytes(), is_empty_type(), is_gimple_lvalue(), is_gimple_reg(), is_gimple_val(), is_var_need_auto_init(), lhd_set_decl_assembler_name(), gimplify_init_ctor_preeval_data::lhs_alias_set, gimplify_init_ctor_preeval_data::lhs_base_decl, NULL, NULL_TREE, optimize_compound_literals_in_ctor(), optimize_function_for_speed_p(), r, recompute_constructor_flags(), rhs_predicate_for(), TREE_ADDRESSABLE, TREE_CODE, TREE_CONSTANT, TREE_OPERAND, tree_output_constant_def(), TREE_READONLY, TREE_SIDE_EFFECTS, TREE_STATIC, TREE_THIS_VOLATILE, TREE_TYPE, type(), TYPE_ALIGN, TYPE_MAIN_VARIANT, TYPE_MODE, TYPE_NO_FORCE_BLK, unshare_expr(), useless_type_conversion_p(), constructor_elt::value, VAR_P, vec_safe_is_empty(), vec_safe_length(), void_type_node, and walk_tree.
Referenced by gimplify_modify_expr_rhs().
|
static |
A subroutine of gimplify_init_ctor_eval. Create a loop for a RANGE_EXPR in a CONSTRUCTOR for an array. var = lower; loop_entry: object[var] = value; if (var == upper) goto loop_exit; var = var + 1; goto loop_entry; loop_exit: We increment var _after_ the loop exit check because we might otherwise fail if upper == TYPE_MAX_VALUE (type for upper). Note that we never have to deal with SAVE_EXPRs here, because this has already been taken care of for us, in gimplify_init_ctor_preeval().
A subroutine of gimplify_init_constructor. Generate individual MODIFY_EXPRs for a CONSTRUCTOR. OBJECT is the LHS against which the assignments should happen. ELTS is the CONSTRUCTOR_ELTS of the CONSTRUCTOR. CLEARED is true if the entire LHS object has been zeroed first.
References bitsize_zero_node, build1(), build2(), build3(), build4(), build_array_type_nelts(), build_constructor_single(), build_fold_addr_expr, build_int_cst(), CONSTRUCTOR_ELTS, fb_lvalue, fold_build2, fold_convert, FOR_EACH_CONSTRUCTOR_ELT, gcc_assert, ggc_free(), gimple_build_assign(), gimplify_and_add(), gimplify_expr(), gimplify_init_ctor_eval(), gimplify_init_ctor_eval_range(), gimplify_seq_add_stmt(), GS_ERROR, i, initializer_zerop(), is_empty_type(), is_gimple_lvalue(), lower(), NULL, NULL_TREE, ptr_type_node, RAW_DATA_LENGTH, RAW_DATA_POINTER, RAW_DATA_UCHAR_ELT, simple_cst_equal(), TREE_CODE, TREE_OPERAND, tree_output_constant_def(), TREE_SIDE_EFFECTS, TREE_TYPE, TYPE_DOMAIN, TYPE_MAIN_VARIANT, unshare_expr(), and useless_type_conversion_p().
Referenced by gimplify_init_constructor(), gimplify_init_ctor_eval(), and gimplify_init_ctor_eval_range().
|
static |
References build2(), build4(), CONSTRUCTOR_ELTS, create_artificial_label(), create_tmp_var, fb_rvalue, fold_convert, gimple_build_assign(), gimple_build_cond(), gimple_build_goto(), gimple_build_label(), gimplify_expr(), gimplify_init_ctor_eval(), gimplify_seq_add_stmt(), GS_ERROR, integer_one_node, is_gimple_val(), lower(), NULL, NULL_TREE, TREE_CODE, TREE_TYPE, UNKNOWN_LOCATION, and unshare_expr().
Referenced by gimplify_init_ctor_eval().
|
static |
A subroutine of gimplify_init_constructor. Pre-evaluate EXPR, force values that overlap with the lhs (as described by *DATA) into temporaries.
References CONSTRUCTOR_ELTS, DECL_P, fb_rvalue, FOR_EACH_VEC_SAFE_ELT, gcc_assert, get_formal_tmp_var(), gimplify_expr(), gimplify_init_ctor_preeval(), gimplify_init_ctor_preeval_1(), GS_ERROR, is_gimple_mem_rhs(), maybe_with_size_expr(), NULL, TREE_ADDRESSABLE, TREE_CODE, TREE_CONSTANT, TREE_SIDE_EFFECTS, TREE_TYPE, TYPE_SIZE, constructor_elt::value, and walk_tree.
Referenced by gimplify_init_constructor(), and gimplify_init_ctor_preeval().
References alias_sets_conflict_p(), CALL_EXPR_FN, get_alias_set(), INDIRECT_REF_P, IS_TYPE_OR_DECL_P, NULL, POINTER_TYPE_P, TREE_ADDRESSABLE, TREE_CHAIN, TREE_CODE, TREE_TYPE, TREE_VALUE, type(), and TYPE_ARG_TYPES.
Referenced by gimplify_init_ctor_preeval().
|
static |
Gimplify the LABEL_EXPR pointed to by EXPR_P.
References current_function_decl, DECL_ATTRIBUTES, decl_function_context(), EXPR_LOCATION, gcc_assert, gimple_build_label(), gimple_build_predict(), gimple_seq_add_stmt(), gimple_set_location(), gimplify_seq_add_stmt(), GS_ALL_DONE, LABEL_EXPR_LABEL, lookup_attribute(), NOT_TAKEN, and TAKEN.
Referenced by gimplify_expr().
|
static |
Gimplify a LOOP_EXPR. Normally this just involves gimplifying the body and replacing the LOOP_EXPR with goto, but if the loop contains an EXIT_EXPR, we need to append a label for it to jump to.
References create_artificial_label(), gimplify_ctx::exit_label, gimple_build_goto(), gimple_build_label(), gimplify_and_add(), gimplify_ctxp, gimplify_seq_add_stmt(), GS_ALL_DONE, LOOP_EXPR_BODY, NULL, NULL_TREE, and UNKNOWN_LOCATION.
Referenced by gimplify_expr().
|
static |
Gimplify the MODIFY_EXPR node pointed to by EXPR_P. modify_expr : varname '=' rhs | '*' ID '=' rhs PRE_P points to the list where side effects that must happen before *EXPR_P should be stored. POST_P points to the list where side effects that must happen after *EXPR_P should be stored. WANT_VALUE is nonzero iff we want to use the value of this expression in another expression.
References ADDR_SPACE_GENERIC_P, ap, build_call_expr_internal_loc(), build_fold_addr_expr, build_simple_mem_ref_loc(), CALL_EXPR_ARG, call_expr_flags(), CALL_EXPR_FN, CALL_EXPR_IFN, call_expr_nargs, cfun, COMPARISON_CLASS_P, CONSTRUCTOR_NELTS, copy_warning(), create_tmp_var_name(), current_function_decl, decl_function_context(), DECL_HAS_DEBUG_EXPR_P, DECL_IGNORED_P, DECL_NAME, DECL_P, ECF_RETURNS_TWICE, error_mark_node, error_operand_p(), EXPR_LOCATION, fb_lvalue, fb_rvalue, fndecl_built_in_p(), fold_convert_loc(), gcc_assert, get_callee_fndecl(), get_initialized_tmp_var(), gimple_build_assign(), gimple_build_call_from_tree(), gimple_build_call_internal(), gimple_build_call_internal_vec(), gimple_build_nop(), gimple_call_noreturn_p(), gimple_call_set_lhs(), gimple_call_set_nothrow(), gimple_in_ssa_p(), gimple_set_location(), gimplify_arg(), gimplify_ctxp, gimplify_expr(), gimplify_modify_expr_complex_part(), gimplify_modify_expr_rhs(), gimplify_modify_expr_to_memcpy(), gimplify_modify_expr_to_memset(), gimplify_seq_add_stmt(), gimplify_stmt(), GS_ALL_DONE, GS_ERROR, GS_OK, GS_UNHANDLED, gsi_last(), i, IDENTIFIER_POINTER, initial_rhs_predicate_for(), gimplify_ctx::into_ssa, is_empty_type(), is_gimple_addressable(), is_gimple_lvalue(), is_gimple_reg(), maybe_fold_stmt(), maybe_with_size_expr(), notice_special_calls(), NULL, NULL_TREE, POINTER_TYPE_P, poly_int_tree_p(), rhs_predicate_for(), SET_DECL_DEBUG_EXPR, should_remove_lhs_p(), SSA_NAME_DEF_STMT, STRIP_USELESS_TYPE_CONVERSION, TREE_ADDRESSABLE, TREE_CLOBBER_P, TREE_CODE, TREE_NOTHROW, TREE_OPERAND, TREE_THIS_VOLATILE, TREE_TYPE, TYPE_ADDR_SPACE, TYPE_SIZE_UNIT, unshare_expr(), useless_type_conversion_p(), and VAR_P.
Referenced by gimplify_expr().
|
static |
Promote partial stores to COMPLEX variables to total stores. *EXPR_P is a MODIFY_EXPR with a lhs of a REAL/IMAGPART_EXPR of a gimple register. IMPORTANT NOTE: This promotion is performed by introducing a load of the other, unmodified part of the complex object just before the total store. As a consequence, if the object is still uninitialized, an undefined value will be loaded into a register, which may result in a spurious exception if the register is floating-point and the value happens to be a signaling NaN for example. Then the fully-fledged complex operations lowering pass followed by a DCE pass are necessary in order to fix things up.
References build1(), build2(), build_complex(), get_formal_tmp_var(), gimple_build_assign(), gimplify_seq_add_stmt(), GS_ALL_DONE, NULL_TREE, suppress_warning(), TREE_CODE, TREE_CONSTANT, TREE_OPERAND, and TREE_TYPE.
Referenced by gimplify_modify_expr().
|
static |
Subroutine of gimplify_modify_expr to do simplifications of MODIFY_EXPRs based on the code of the RHS. We loop for as long as something changes.
References AGGREGATE_TYPE_P, aggregate_value_p(), gimplify_ctx::allow_rhs_cond_expr, build2(), build_fold_addr_expr, build_simple_mem_ref_loc(), CALL_EXPR_RETURN_SLOT_OPT, changed, COMPOUND_LITERAL_EXPR_DECL_EXPR, copy_node(), DECL_EXPR_DECL, DECL_INITIAL, DECL_NAME, DECL_P, DECL_REGISTER, EXPR_LOCATION, fb_lvalue, gcc_assert, gimple_fold_indirect_ref_rhs(), gimplify_and_add(), gimplify_compound_expr(), gimplify_ctxp, gimplify_expr(), gimplify_init_constructor(), GS_ERROR, GS_OK, GS_UNHANDLED, is_gimple_lvalue(), is_gimple_min_lval(), is_gimple_reg(), is_gimple_reg_type(), is_gimple_variable(), mark_addressable(), needs_to_live_in_memory(), NULL, NULL_TREE, recalculate_side_effects(), REFERENCE_CLASS_P, rhs_predicate_for(), TARGET_EXPR_INITIAL, TARGET_EXPR_NO_ELIDE, TREE_ADDRESSABLE, TREE_CODE, TREE_OPERAND, TREE_READONLY, tree_ssa_useless_type_conversion(), TREE_THIS_VOLATILE, TREE_TYPE, TYPE_SIZE_UNIT, unshare_expr(), VAR_P, void_type_node, VOID_TYPE_P, and voidify_wrapper_expr().
Referenced by gimplify_modify_expr().
|
static |
A subroutine of gimplify_modify_expr. Replace a MODIFY_EXPR with a call to __builtin_memcpy.
References ADDR_SPACE_GENERIC_P, build_fold_addr_expr_loc(), build_simple_mem_ref, builtin_decl_implicit(), create_tmp_var, EXPR_LOCATION, gcc_assert, gimple_build_call(), gimple_call_set_alloca_for_var(), gimple_call_set_lhs(), gimplify_arg(), gimplify_seq_add_stmt(), GS_ALL_DONE, mark_addressable(), NULL, prepare_gimple_addressable(), TREE_OPERAND, TREE_TYPE, and TYPE_ADDR_SPACE.
Referenced by gimplify_modify_expr().
|
static |
A subroutine of gimplify_modify_expr. Replace a MODIFY_EXPR with a call to __builtin_memset. In this case we know that the RHS is a CONSTRUCTOR with an empty element list.
References ADDR_SPACE_GENERIC_P, build1(), build_fold_addr_expr_loc(), builtin_decl_implicit(), CONSTRUCTOR_ELTS, create_tmp_var, EXPR_LOCATION, gcc_assert, gimple_build_call(), gimple_call_set_lhs(), gimplify_arg(), gimplify_seq_add_stmt(), GS_ALL_DONE, integer_zero_node, NULL, TREE_CODE, TREE_OPERAND, TREE_TYPE, TYPE_ADDR_SPACE, and vec_safe_is_empty().
Referenced by gimplify_modify_expr().
|
static |
Gimplify OACC_CACHE.
References gimplify_adjust_omp_clauses(), gimplify_scan_omp_clauses(), NULL, NULL_TREE, OACC_CACHE_CLAUSES, and ORT_ACC.
Referenced by gimplify_expr().
|
static |
Gimplify OACC_DECLARE.
References gimplify_omp_ctx::clauses, current_function_decl, DECL_ATTRIBUTES, DECL_CONTEXT, get_identifier(), GF_OMP_TARGET_KIND_OACC_DECLARE, gimple_build_omp_target(), gimplify_adjust_omp_clauses(), gimplify_oacc_declare_1(), gimplify_omp_ctxp, gimplify_scan_omp_clauses(), gimplify_seq_add_stmt(), GOVD_SEEN, is_global_var(), is_oacc_declared(), NULL, NULL_TREE, OACC_DECLARE_CLAUSES, oacc_declare_returns, omp_add_variable(), OMP_CLAUSE_CHAIN, OMP_CLAUSE_DECL, ORT_TARGET_DATA, hash_map< KeyId, Value, Traits >::put(), TREE_CODE, tree_cons(), TREE_OPERAND, and VAR_P.
Referenced by gimplify_expr().
Helper function of gimplify_oacc_declare. The helper's purpose is to, if required, translate 'kind' in CLAUSE into an 'entry' kind and 'exit' kind. The entry kind will replace the one in CLAUSE, while the exit kind will be used in a new omp_clause and returned to the caller.
References build_omp_clause(), gcc_unreachable, NULL, OMP_CLAUSE_DECL, OMP_CLAUSE_LOCATION, OMP_CLAUSE_MAP, OMP_CLAUSE_MAP_KIND, and OMP_CLAUSE_SET_MAP_KIND.
Referenced by gimplify_oacc_declare().
|
static |
Gimplify the affinity clause but effectively ignore it. Generate: var = begin; if ((step > 1) ? var <= end : var > end) locatator_var_expr;
References append_to_statement_list(), append_to_statement_list_force(), begin(), BIND_EXPR_BODY, BLOCK_VARS, boolean_type_node, build1(), build2_loc(), build3(), build_and_jump(), build_zero_cst(), create_artificial_label(), DECL_SOURCE_LOCATION, end(), error_operand_p(), fb_lvalue, fb_rvalue, fold_build2_loc(), fold_build3_loc(), gimplify_and_add(), gimplify_expr(), GS_ERROR, is_gimple_lvalue(), is_gimple_val(), NULL, null_pointer_node, NULL_TREE, OMP_CLAUSE_AFFINITY, OMP_CLAUSE_CHAIN, OMP_CLAUSE_CODE, OMP_CLAUSE_DECL, OMP_CLAUSE_LOCATION, TREE_CHAIN, TREE_CODE, TREE_OPERAND, TREE_PURPOSE, TREE_TYPE, TREE_VALUE, TREE_VEC_ELT, void_node, and void_type_node.
Referenced by gimplify_scan_omp_clauses().
|
static |
Gimplify an OMP_ATOMIC statement.
References gimplify_ctx::allow_rhs_cond_expr, bitsize_int, build2_loc(), build3_loc(), create_tmp_reg(), EXPR_LOCATION, fb_rvalue, gcc_assert, get_initialized_tmp_var(), gimple_build_omp_atomic_load(), gimple_build_omp_atomic_store(), gimple_omp_atomic_set_need_value(), gimple_omp_atomic_set_weak(), gimplify_and_add(), gimplify_ctxp, gimplify_expr(), gimplify_seq_add_stmt(), goa_stabilize_expr(), GS_ALL_DONE, GS_ERROR, INTEGRAL_TYPE_P, is_gimple_val(), NULL, NULL_TREE, OMP_ATOMIC_MEMORY_ORDER, OMP_ATOMIC_WEAK, TREE_CODE, TREE_OPERAND, TREE_TYPE, TYPE_MAIN_VARIANT, TYPE_PRECISION, TYPE_SIZE, void_node, and void_type_node.
Referenced by gimplify_expr().
|
static |
If *LIST_P contains any OpenMP depend clauses with iterators, lower all the depend clauses by populating corresponding depend array. Returns 0 if there are no such depend clauses, or 2 if all depend clauses should be removed, 1 otherwise.
References append_to_statement_list(), append_to_statement_list_force(), begin(), BIND_EXPR_BODY, BLOCK_VARS, boolean_false_node, boolean_type_node, build1(), build2(), build2_loc(), build3(), build3_loc(), build4(), build_and_jump(), build_array_type(), build_call_expr_loc(), build_fold_addr_expr, build_fold_addr_expr_with_type, build_index_type(), build_int_cst(), build_omp_clause(), builtin_decl_explicit(), create_artificial_label(), create_tmp_var, create_tmp_var_raw(), DECL_SOURCE_LOCATION, end(), error_operand_p(), fb_rvalue, fold_build1_loc(), fold_build2_loc(), fold_build3_loc(), fold_convert, fold_convert_loc(), g, gcc_unreachable, gimple_add_tmp_var(), gimple_build_assign(), gimple_seq_add_stmt(), gimplify_and_add(), gimplify_expr(), gimplify_omp_ctxp, gimplify_type_sizes(), gimplify_vla_decl(), GOVD_LOCAL, GOVD_SEEN, GS_ERROR, i, is_gimple_val(), NULL, null_pointer_node, NULL_TREE, omp_add_variable(), OMP_CLAUSE_CHAIN, OMP_CLAUSE_CODE, OMP_CLAUSE_DECL, OMP_CLAUSE_DEPEND, OMP_CLAUSE_DEPEND_DEPOBJ, OMP_CLAUSE_DEPEND_IN, OMP_CLAUSE_DEPEND_INOUT, OMP_CLAUSE_DEPEND_INOUTSET, OMP_CLAUSE_DEPEND_KIND, OMP_CLAUSE_DEPEND_LAST, OMP_CLAUSE_DEPEND_MUTEXINOUTSET, OMP_CLAUSE_DEPEND_OUT, OMP_CLAUSE_LOCATION, ORT_ACC, ORT_SIMD, ORT_TASKGROUP, ORT_WORKSHARE, gimplify_omp_ctx::outer_context, POINTER_TYPE_P, poly_int_tree_p(), ptr_type_node, r, gimplify_omp_ctx::region_type, SET_EXPR_LOCATION, size_binop, size_binop_loc(), size_int, size_one_node, size_zero_node, sizetype, TREE_ADDRESSABLE, TREE_CHAIN, TREE_CODE, TREE_OPERAND, TREE_PURPOSE, TREE_SIDE_EFFECTS, TREE_TYPE, TREE_VALUE, TREE_VEC_ELT, TYPE_SIZES_GIMPLIFIED, TYPE_UNSIGNED, UNKNOWN_LOCATION, unshare_expr(), void_node, and void_type_node.
Referenced by gimplify_scan_omp_clauses().
|
static |
Gimplify an OMP_DISPATCH construct.
References BIND_EXPR_BODY, boolean_false_node, boolean_true_node, build2(), builtin_decl_explicit(), gimplify_omp_ctx::code, copy_node(), create_artificial_label(), create_tmp_var, DECL_NAME, DECL_VIRTUAL_P, delete_omp_context(), wi::eq_p(), error_at(), EXPR_LOCATION, fb_rvalue, find_ifn_gomp_dispatch(), gcc_assert, get_callee_fndecl(), gimple_build_bind(), gimple_build_call(), gimple_build_cond_from_tree(), gimple_build_goto(), gimple_build_label(), gimple_build_omp_dispatch(), gimple_call_set_lhs(), gimplify_and_add(), gimplify_expr(), gimplify_omp_ctxp, gimplify_scan_omp_clauses(), gimplify_seq_add_stmt(), GS_ALL_DONE, GS_ERROR, GS_UNHANDLED, integer_type_node, integer_zerop(), is_gimple_val(), modify, NULL, NULL_TREE, OMP_CLAUSE_CHAIN, OMP_CLAUSE_CODE, OMP_CLAUSE_DEPEND, OMP_CLAUSE_DEVICE, OMP_CLAUSE_DEVICE_ID, OMP_CLAUSE_NOCONTEXT, OMP_CLAUSE_NOCONTEXT_EXPR, OMP_CLAUSE_NOVARIANTS, OMP_CLAUSE_NOVARIANTS_EXPR, OMP_CLAUSE_NOWAIT, OMP_DISPATCH_BODY, OMP_DISPATCH_CLAUSES, omp_find_clause(), omp_has_nocontext(), omp_has_novariants(), omp_resolve_declare_variant(), ORT_DISPATCH, gimplify_omp_ctx::outer_context, pop_gimplify_context(), push_gimplify_context(), wi::to_wide(), TREE_CHAIN, TREE_CODE, TREE_OPERAND, TREE_TYPE, TSI_CONTINUE_LINKING, tsi_delink(), tsi_end_p(), tsi_link_before(), tsi_next(), tsi_start(), tsi_stmt(), UNKNOWN_LOCATION, and walk_tree.
Referenced by gimplify_expr().
|
static |
Gimplify the gross structure of an OMP_FOR statement.
References hash_set< KeyId, Lazy, Traits >::add(), append_to_statement_list_force(), BIND_EXPR_BODY, BITMAP_ALLOC, bitmap_bit_p, BITMAP_FREE, bitmap_set_bit, build2(), build3(), build_array_type_nelts(), build_int_cst(), build_omp_clause(), gimplify_omp_ctx::combined_loop, COMPARISON_CLASS_P, hash_set< KeyId, Lazy, Traits >::contains(), copy_node(), create_tmp_var, create_tmp_var_raw(), DECL_EXPR_DECL, DECL_P, DECL_THREAD_LOCAL_P, DECL_UID, lang_hooks::decls, gimplify_omp_ctx::distribute, error_at(), EXPR_LOCATION, fb_rvalue, find_combined_omp_for(), find_standalone_omp_ordered(), fold_build1, fold_convert, g, gcc_assert, gcc_unreachable, get_name(), GF_OMP_FOR_KIND_DISTRIBUTE, GF_OMP_FOR_KIND_FOR, GF_OMP_FOR_KIND_OACC_LOOP, GF_OMP_FOR_KIND_SIMD, GF_OMP_FOR_KIND_TASKLOOP, gimple_build_assign(), gimple_build_bind(), gimple_build_omp_for(), gimple_build_omp_task(), gimple_omp_for_clauses(), gimple_omp_for_clauses_ptr(), gimple_omp_for_collapse(), gimple_omp_for_cond(), gimple_omp_for_final(), gimple_omp_for_incr(), gimple_omp_for_index(), gimple_omp_for_initial(), gimple_omp_for_pre_body(), gimple_omp_for_set_clauses(), gimple_omp_for_set_combined_into_p(), gimple_omp_for_set_combined_p(), gimple_omp_for_set_cond(), gimple_omp_for_set_final(), gimple_omp_for_set_incr(), gimple_omp_for_set_index(), gimple_omp_for_set_initial(), gimple_omp_for_set_pre_body(), gimple_omp_task_set_taskloop_p(), gimple_seq_empty_p(), gimple_set_location(), gimplify_adjust_omp_clauses(), gimplify_and_add(), gimplify_and_return_first(), gimplify_assign(), gimplify_ctxp, gimplify_expr(), gimplify_omp_ctxp, gimplify_omp_loop_xform(), gimplify_omp_taskloop_expr(), gimplify_scan_omp_clauses(), gimplify_seq_add_seq(), gimplify_seq_add_stmt(), GOVD_CONDTEMP, GOVD_DATA_SHARE_CLASS, GOVD_EXPLICIT, GOVD_LASTPRIVATE, GOVD_LASTPRIVATE_CONDITIONAL, GOVD_LINEAR, GOVD_LINEAR_LASTPRIVATE_NO_OUTER, GOVD_LOCAL, GOVD_PRIVATE, GOVD_SEEN, GS_ALL_DONE, GS_ERROR, GS_OK, i, gimplify_omp_ctx::in_for_exprs, input_location, INTEGRAL_TYPE_P, is_gimple_reg(), is_gimple_val(), is_global_var(), omp_for_data::iter_type, lang_GNU_Fortran(), last, omp_for_data::lastprivate_conditional, list_length(), gimplify_omp_ctx::loop_iter_var, make_node(), MIN, NULL, NULL_TREE, omp_add_variable(), OMP_BODY, OMP_CLAUSE__CONDTEMP_, OMP_CLAUSE_ALLOCATE, OMP_CLAUSE_ALLOCATE_ALLOCATOR, OMP_CLAUSE_BIND, OMP_CLAUSE_CHAIN, OMP_CLAUSE_CODE, OMP_CLAUSE_COLLAPSE, OMP_CLAUSE_COLLAPSE_EXPR, OMP_CLAUSE_DECL, OMP_CLAUSE_DEFAULT, OMP_CLAUSE_DIST_SCHEDULE, OMP_CLAUSE_FINAL, OMP_CLAUSE_FIRSTPRIVATE, OMP_CLAUSE_FIRSTPRIVATE_NO_REFERENCE, OMP_CLAUSE_GRAINSIZE, OMP_CLAUSE_IF, OMP_CLAUSE_IN_REDUCTION, OMP_CLAUSE_LASTPRIVATE, OMP_CLAUSE_LASTPRIVATE_CONDITIONAL, OMP_CLAUSE_LASTPRIVATE_FIRSTPRIVATE, OMP_CLAUSE_LASTPRIVATE_GIMPLE_SEQ, OMP_CLAUSE_LASTPRIVATE_LOOP_IV, OMP_CLAUSE_LINEAR, OMP_CLAUSE_LINEAR_GIMPLE_SEQ, OMP_CLAUSE_LINEAR_NO_COPYIN, OMP_CLAUSE_LINEAR_NO_COPYOUT, OMP_CLAUSE_LINEAR_STEP, OMP_CLAUSE_LOCATION, OMP_CLAUSE_MERGEABLE, OMP_CLAUSE_NOGROUP, OMP_CLAUSE_NUM_TASKS, OMP_CLAUSE_ORDERED, OMP_CLAUSE_ORDERED_DOACROSS, OMP_CLAUSE_PRIORITY, OMP_CLAUSE_PRIVATE, OMP_CLAUSE_PRIVATE_TASKLOOP_IV, OMP_CLAUSE_REDUCTION, OMP_CLAUSE_SCHEDULE, OMP_CLAUSE_SHARED, OMP_CLAUSE_SHARED_FIRSTPRIVATE, OMP_CLAUSE_TILE, OMP_CLAUSE_TILE_LIST, OMP_CLAUSE_UNTIED, omp_extract_for_data(), omp_find_clause(), lang_hooks_for_decls::omp_finish_clause, OMP_FOR_BODY, OMP_FOR_CLAUSES, OMP_FOR_COND, OMP_FOR_INCR, OMP_FOR_INIT, OMP_FOR_NON_RECTANGULAR, OMP_FOR_ORIG_DECLS, OMP_FOR_PRE_BODY, omp_is_private(), omp_lastprivate_for_combined_outer_constructs(), omp_maybe_apply_loop_xforms(), omp_notice_variable(), OMP_PARALLEL_CLAUSES, ORT_ACC, ORT_COMBINED_PARALLEL, ORT_NONE, ORT_PARALLEL, ORT_SIMD, ORT_TARGET_DATA, ORT_TASKGROUP, ORT_TASKLOOP, ORT_UNTIED_TASKLOOP, ORT_WORKSHARE, gimplify_omp_ctx::outer_context, POINTER_TYPE_P, pop_gimplify_context(), push_gimplify_context(), gimplify_omp_ctx::region_type, seen_error(), si, sizetype, gimplify_ctx::temps, TREE_CHAIN, TREE_CODE, TREE_OPERAND, TREE_PRIVATE, TREE_PURPOSE, TREE_SIDE_EFFECTS, tree_to_shwi(), TREE_TYPE, TREE_VALUE, TREE_VEC_ELT, TREE_VEC_LENGTH, tsi_end_p(), tsi_next(), tsi_start(), tsi_stmt(), tsi_stmt_ptr(), UNKNOWN_LOCATION, unshare_expr(), unsigned_type_for(), splay_tree_node< T >::value(), VAR_P, gimplify_omp_ctx::variables, void_type_node, walk_tree, walk_tree_without_duplicates, and warning_at().
Referenced by gimplify_expr().
|
static |
Gimplify the gross structure of an OMP_LOOP statement.
References append_to_statement_list(), BIND_EXPR_BODY, build3(), build_omp_clause(), CB_CGE_DUPLICATE, cfun, gimplify_omp_ctx::clauses, copy_decl_no_change(), copy_node(), copy_tree_body_r(), current_function_decl, DECL_CONTEXT, lang_hooks::decls, error_at(), EXPR_LOCATION, fb_none, omp_for_data::for_stmt, gcc_assert, gcc_unreachable, hash_map< KeyId, Value, Traits >::get(), gimplify_expr(), gimplify_omp_ctxp, GS_OK, i, in_omp_construct, is_gimple_stmt(), lang_GNU_Fortran(), last, make_node(), note_no_context_vars(), NULL, NULL_TREE, OMP_CLAUSE_BIND, OMP_CLAUSE_BIND_KIND, OMP_CLAUSE_BIND_PARALLEL, OMP_CLAUSE_BIND_TEAMS, OMP_CLAUSE_BIND_THREAD, OMP_CLAUSE_CHAIN, OMP_CLAUSE_CODE, OMP_CLAUSE_COLLAPSE, OMP_CLAUSE_DECL, OMP_CLAUSE_FIRSTPRIVATE, OMP_CLAUSE_LASTPRIVATE, OMP_CLAUSE_LASTPRIVATE_FIRSTPRIVATE, OMP_CLAUSE_LASTPRIVATE_LOOP_IV, OMP_CLAUSE_LASTPRIVATE_STMT, OMP_CLAUSE_LOCATION, OMP_CLAUSE_ORDER, OMP_CLAUSE_PRIVATE, OMP_CLAUSE_REDUCTION, OMP_CLAUSE_REDUCTION_DECL_PLACEHOLDER, OMP_CLAUSE_REDUCTION_INIT, OMP_CLAUSE_REDUCTION_INSCAN, OMP_CLAUSE_REDUCTION_MERGE, OMP_CLAUSE_REDUCTION_PLACEHOLDER, OMP_CLAUSE_REDUCTION_TASK, omp_find_clause(), lang_hooks_for_decls::omp_finish_clause, OMP_FOR_BODY, OMP_FOR_CLAUSES, OMP_FOR_INIT, OMP_FOR_ORIG_DECLS, omp_maybe_apply_loop_xforms(), OMP_PARALLEL_BODY, OMP_PARALLEL_CLAUSES, OMP_PARALLEL_COMBINED, ORT_ACC, ORT_IMPLICIT_TARGET, ORT_NONE, ORT_PARALLEL, ORT_SIMD, ORT_TEAMS, gimplify_omp_ctx::outer_context, hash_map< KeyId, Value, Traits >::put(), gimplify_omp_ctx::region_type, SET_EXPR_LOCATION, TREE_CODE, TREE_OPERAND, TREE_PURPOSE, TREE_SET_CODE, TREE_TYPE, TREE_VALUE, TREE_VEC_ELT, TREE_VEC_LENGTH, UNKNOWN_LOCATION, unshare_expr(), void_type_node, walk_tree, and walk_tree_without_duplicates.
Referenced by gimplify_expr().
|
static |
Gimplify standalone loop transforming directive which has the transformations applied already. So, all that is needed is gimplify the remaining loops as normal loops.
References annot_expr_unroll_kind, boolean_false_node, boolean_type_node, build2(), build3(), build_int_cst(), create_artificial_label(), DECL_ARTIFICIAL, DECL_P, fb_rvalue, gcc_assert, gimple_build_cond(), gimple_build_goto(), gimple_build_label(), gimplify_and_add(), gimplify_expr(), gimplify_omp_ctxp, gimplify_seq_add_seq(), gimplify_seq_add_stmt(), GOVD_PRIVATE, GS_ALL_DONE, i, integer_type_node, INTEGRAL_TYPE_P, is_gimple_val(), NULL, NULL_TREE, omp_add_variable(), OMP_CLAUSE_FULL, OMP_CLAUSE_PARTIAL, omp_find_clause(), OMP_FOR_BODY, OMP_FOR_CLAUSES, OMP_FOR_COND, OMP_FOR_INCR, OMP_FOR_INIT, OMP_FOR_PRE_BODY, omp_loop_number_of_iterations(), ORT_ACC, ORT_NONE, ORT_SIMD, ORT_TARGET_DATA, ORT_TASKGROUP, ORT_WORKSHARE, gimplify_omp_ctx::outer_context, POINTER_TYPE_P, gimplify_omp_ctx::region_type, seen_error(), TREE_CODE, tree_fits_uhwi_p(), TREE_OPERAND, TREE_PRIVATE, tree_to_uhwi(), TREE_TYPE, TREE_VEC_ELT, TREE_VEC_LENGTH, UNKNOWN_LOCATION, and gimplify_omp_ctx::variables.
Referenced by gimplify_omp_for().
|
static |
Gimplify an OMP_ORDERED construct. EXPR is the tree version. BODY is the OMP_BODY of the original EXPR (which has already been gimplified so it's not present in the EXPR). Return the gimplified GIMPLE_OMP_ORDERED tuple.
References decls, error_at(), gimple_build_nop(), gimple_build_omp_ordered(), gimplify_omp_ctxp, i, gimplify_omp_ctx::loop_iter_var, NULL_TREE, OMP_CLAUSE_CHAIN, OMP_CLAUSE_CODE, OMP_CLAUSE_DECL, OMP_CLAUSE_DOACROSS, OMP_CLAUSE_DOACROSS_DEPEND, OMP_CLAUSE_DOACROSS_KIND, OMP_CLAUSE_DOACROSS_SINK, OMP_CLAUSE_DOACROSS_SOURCE, OMP_CLAUSE_LOCATION, OMP_ORDERED_CLAUSES, TREE_CHAIN, TREE_CODE, and TREE_VALUE.
Referenced by gimplify_expr().
|
static |
Gimplify the contents of an OMP_PARALLEL statement. This involves gimplification of the body, as well as scanning the body for used variables. We need to do this scan now, because variable-sized decls will be decomposed during gimplification.
References g, GF_OMP_PARALLEL_COMBINED, gimple_build_omp_parallel(), gimple_omp_set_subcode(), gimplify_adjust_omp_clauses(), gimplify_and_return_first(), gimplify_scan_omp_clauses(), gimplify_seq_add_stmt(), NULL, NULL_TREE, OMP_PARALLEL_BODY, OMP_PARALLEL_CLAUSES, OMP_PARALLEL_COMBINED, ORT_COMBINED_PARALLEL, ORT_PARALLEL, pop_gimplify_context(), and push_gimplify_context().
Referenced by gimplify_expr().
|
static |
Gimplify the gross structure of OpenACC enter/exit data, update, and OpenMP target update constructs.
References gcc_assert, gcc_unreachable, GF_OMP_TARGET_KIND_ENTER_DATA, GF_OMP_TARGET_KIND_EXIT_DATA, GF_OMP_TARGET_KIND_OACC_ENTER_DATA, GF_OMP_TARGET_KIND_OACC_EXIT_DATA, GF_OMP_TARGET_KIND_OACC_UPDATE, GF_OMP_TARGET_KIND_UPDATE, gimple_build_omp_target(), gimplify_adjust_omp_clauses(), gimplify_scan_omp_clauses(), gimplify_seq_add_stmt(), NULL, NULL_TREE, OMP_CLAUSE_CHAIN, OMP_CLAUSE_CODE, OMP_CLAUSE_FINALIZE, OMP_CLAUSE_IF_PRESENT, OMP_CLAUSE_MAP, OMP_CLAUSE_MAP_KIND, OMP_CLAUSE_SET_MAP_KIND, omp_find_clause(), OMP_STANDALONE_CLAUSES, ORT_ACC, ORT_WORKSHARE, and TREE_CODE.
Referenced by gimplify_expr().
|
static |
Gimplify the contents of an OMP_TASK statement. This involves gimplification of the body, as well as scanning the body for used variables. We need to do this scan now, because variable-sized decls will be decomposed during gimplification.
References error_at(), EXPR_LOCATION, g, gimple_build_omp_task(), gimple_omp_task_set_taskwait_p(), gimplify_adjust_omp_clauses(), gimplify_and_return_first(), gimplify_scan_omp_clauses(), gimplify_seq_add_stmt(), gimplify_omp_ctx::has_depend, NULL, NULL_TREE, OMP_CLAUSE_CHAIN, OMP_CLAUSE_CODE, OMP_CLAUSE_DEPEND, OMP_CLAUSE_DEPEND_KIND, OMP_CLAUSE_DEPEND_MUTEXINOUTSET, OMP_CLAUSE_LOCATION, OMP_CLAUSE_NOWAIT, OMP_CLAUSE_UNTIED, omp_find_clause(), OMP_TASK_BODY, OMP_TASK_CLAUSES, ORT_TASK, ORT_UNTIED_TASK, pop_gimplify_context(), and push_gimplify_context().
Referenced by gimplify_expr().
|
static |
Helper function for gimplify_omp_for. If *TP is not a gimple constant, force it into a temporary initialized in PRE_P and add firstprivate clause to ORIG_FOR_STMT.
References build2(), build_omp_clause(), create_tmp_var, get_initialized_tmp_var(), gimplify_and_add(), gimplify_save_expr(), input_location, is_gimple_constant(), NULL, OMP_CLAUSE_CHAIN, OMP_CLAUSE_DECL, OMP_CLAUSE_FIRSTPRIVATE, OMP_FOR_CLAUSES, TREE_CODE, TREE_TYPE, and TYPE_MAIN_VARIANT.
Referenced by gimplify_omp_for().
|
static |
Gimplify the gross structure of several OMP constructs.
References as_a(), builtin_decl_explicit(), g, gcc_unreachable, GF_OMP_TARGET_KIND_DATA, GF_OMP_TARGET_KIND_OACC_DATA, GF_OMP_TARGET_KIND_OACC_HOST_DATA, GF_OMP_TARGET_KIND_OACC_KERNELS, GF_OMP_TARGET_KIND_OACC_PARALLEL, GF_OMP_TARGET_KIND_OACC_SERIAL, GF_OMP_TARGET_KIND_REGION, gimple_build_call(), gimple_build_omp_scope(), gimple_build_omp_sections(), gimple_build_omp_single(), gimple_build_omp_target(), gimple_build_omp_teams(), gimple_build_try(), gimple_omp_teams_set_host(), gimple_seq_add_stmt(), GIMPLE_TRY_FINALLY, gimplify_adjust_omp_clauses(), gimplify_and_add(), gimplify_and_return_first(), gimplify_omp_ctxp, gimplify_scan_omp_clauses(), gimplify_seq_add_stmt(), in_omp_construct, NULL, NULL_TREE, OMP_BODY, OMP_CLAUSE_CHAIN, OMP_CLAUSE_CODE, OMP_CLAUSE_IF_PRESENT, OMP_CLAUSE_USE_DEVICE_ADDR, OMP_CLAUSE_USE_DEVICE_PTR, OMP_CLAUSE_USE_DEVICE_PTR_IF_PRESENT, OMP_CLAUSES, omp_find_clause(), OMP_TARGET_COMBINED, OMP_TEAMS_COMBINED, optimize_target_teams(), ORT_ACC, ORT_ACC_DATA, ORT_ACC_HOST_DATA, ORT_ACC_KERNELS, ORT_ACC_PARALLEL, ORT_ACC_SERIAL, ORT_COMBINED_TARGET, ORT_COMBINED_TEAMS, ORT_HOST_TEAMS, ORT_IMPLICIT_TARGET, ORT_TARGET, ORT_TARGET_DATA, ORT_TASKGROUP, ORT_TEAMS, ORT_WORKSHARE, pop_gimplify_context(), push_gimplify_context(), gimplify_omp_ctx::region_type, TREE_CODE, and uc.
Referenced by gimplify_expr().
void gimplify_one_sizepos | ( | tree * | expr_p, |
gimple_seq * | stmt_p ) |
A subroutine of gimplify_type_sizes to make sure that *EXPR_P, a size or position, has had all of its SAVE_EXPRs evaluated. We add any required statements to *STMT_P.
References CONTAINS_PLACEHOLDER_P, fb_rvalue, get_initialized_tmp_var(), gimplify_expr(), is_gimple_constant(), is_gimple_val(), NULL, NULL_TREE, unshare_expr(), and VAR_P.
Referenced by gimplify_parameters(), gimplify_return_expr(), gimplify_type_sizes(), and gimplify_vla_decl().
|
static |
Given a conditional expression *EXPR_P without side effects, gimplify its operands. New statements are inserted to PRE_P.
References gimplify_omp_ctx::code, COND_EXPR_COND, COND_EXPR_ELSE, COND_EXPR_THEN, fb_rvalue, gimple_boolify(), gimplify_expr(), is_gimple_val(), MIN, NULL, TREE_CODE, and TREE_SET_CODE.
Referenced by gimplify_cond_expr().
|
static |
Gimplify a RETURN_EXPR. If the expression to be returned is not a GIMPLE value, it is assigned to a new temporary and the statement is re-written to return the temporary. PRE_P points to the sequence where side effects that must happen before STMT should be stored.
References aggregate_value_p(), copy_warning(), create_tmp_reg(), current_function_decl, DECL_RESULT, DECL_SIZE, DECL_SIZE_UNIT, error_mark_node, gcc_assert, gimple_build_return(), gimplify_and_add(), gimplify_ctxp, gimplify_one_sizepos(), gimplify_seq_add_stmt(), gimplify_type_sizes(), GS_ALL_DONE, GS_ERROR, INDIRECT_REF_P, maybe_add_early_return_predict_stmt(), NULL_TREE, poly_int_tree_p(), gimplify_ctx::return_temp, suppress_warning(), TREE_CODE, TREE_OPERAND, TREE_TYPE, TYPE_SIZES_GIMPLIFIED, and VOID_TYPE_P.
Referenced by gimplify_expr().
|
static |
Gimplify a SAVE_EXPR node. EXPR_P points to the expression to gimplify. After gimplification, EXPR_P will point to a new temporary that holds the original value of the SAVE_EXPR node. PRE_P points to the list where side effects that must happen before *EXPR_P should be stored.
References cfun, error_mark_node, fb_none, gcc_assert, get_initialized_tmp_var(), gimple_in_ssa_p(), gimplify_expr(), GS_ALL_DONE, GS_ERROR, is_gimple_stmt(), NULL, SAVE_EXPR_RESOLVED_P, TREE_CODE, TREE_OPERAND, TREE_TYPE, and void_type_node.
Referenced by gimplify_expr(), and gimplify_omp_taskloop_expr().
|
static |
Gimplify a comparison between two aggregate objects of integral scalar mode as a comparison between the bitwise equivalent scalar values.
References build_call_expr_loc(), builtin_decl_implicit(), EXPR_LOCATION, fold_build1_loc(), fold_build2_loc(), gcc_assert, gcc_unreachable, GS_OK, int_size_in_bytes(), NULL_TREE, TREE_CODE, TREE_OPERAND, TREE_TYPE, lang_hooks_for_types::type_for_mode, TYPE_MODE, and lang_hooks::types.
Referenced by gimplify_expr().
|
static |
Scan the OMP clauses in *LIST_P, installing mappings into a new and previous omp contexts.
References array_ref_element_size(), array_ref_low_bound(), BIND_EXPR_BODY, build3(), build_fold_addr_expr, gimplify_omp_ctx::clauses, gimplify_omp_ctx::code, gimplify_omp_ctx::combined_loop, component_ref_field_offset(), DECL_HAS_VALUE_EXPR_P, DECL_NAME, DECL_OFFSET_ALIGN, DECL_P, DECL_SIZE_UNIT, DECL_THREAD_LOCAL_P, DECL_VALUE_EXPR, lang_hooks::decls, gimplify_omp_ctx::default_kind, gimplify_omp_ctx::defaultmap, deps, gimplify_omp_ctx::distribute, do_add(), wi::eq_p(), error(), error_at(), error_operand_p(), fb_lvalue, fb_rvalue, find_decl_expr(), gcc_assert, gcc_unreachable, GDMK_AGGREGATE, GDMK_ALLOCATABLE, GDMK_POINTER, GDMK_SCALAR, GDMK_SCALAR_TARGET, get_base_address(), get_initialized_tmp_var(), gimple_boolify(), gimple_seq_first_stmt(), gimplify_and_add(), gimplify_ctxp, gimplify_expr(), gimplify_omp_affinity(), gimplify_omp_ctxp, gimplify_omp_depend(), GOVD_ALIGNED, GOVD_DATA_SHARE_CLASS, GOVD_EXPLICIT, GOVD_FIRSTPRIVATE, GOVD_FIRSTPRIVATE_IMPLICIT, GOVD_LASTPRIVATE, GOVD_LASTPRIVATE_CONDITIONAL, GOVD_LINEAR, GOVD_LINEAR_LASTPRIVATE_NO_OUTER, GOVD_LOCAL, GOVD_MAP, GOVD_MAP_0LEN_ARRAY, GOVD_MAP_ALLOC_ONLY, GOVD_MAP_ALWAYS_TO, GOVD_MAP_FORCE_PRESENT, GOVD_MAP_FROM_ONLY, GOVD_MAP_TO_ONLY, GOVD_NONTEMPORAL, GOVD_PRIVATE, GOVD_PRIVATE_OUTER_REF, GOVD_REDUCTION, GOVD_REDUCTION_INSCAN, GOVD_SEEN, GOVD_SHARED, GS_ERROR, handled_component_p(), gimplify_omp_ctx::has_depend, i, gimplify_ctx::into_ssa, is_gimple_lvalue(), is_gimple_min_invariant(), is_gimple_reg(), is_gimple_val(), is_global_var(), lang_GNU_Fortran(), new_omp_context(), NULL, null_pointer_node, NULL_TREE, offset, omp_add_variable(), omp_check_private(), OMP_CLAUSE__CACHE_, OMP_CLAUSE_AFFINITY, OMP_CLAUSE_ALIGNED, OMP_CLAUSE_ALIGNED_ALIGNMENT, OMP_CLAUSE_ALLOCATE, OMP_CLAUSE_ALLOCATE_ALLOCATOR, OMP_CLAUSE_ASYNC, OMP_CLAUSE_AUTO, OMP_CLAUSE_BIND, OMP_CLAUSE_CHAIN, OMP_CLAUSE_CODE, omp_clause_code_name, OMP_CLAUSE_COLLAPSE, OMP_CLAUSE_COPYIN, OMP_CLAUSE_COPYPRIVATE, OMP_CLAUSE_DECL, OMP_CLAUSE_DEFAULT, OMP_CLAUSE_DEFAULT_KIND, OMP_CLAUSE_DEFAULTMAP, OMP_CLAUSE_DEFAULTMAP_ALLOC, OMP_CLAUSE_DEFAULTMAP_BEHAVIOR, OMP_CLAUSE_DEFAULTMAP_CATEGORY, OMP_CLAUSE_DEFAULTMAP_CATEGORY_AGGREGATE, OMP_CLAUSE_DEFAULTMAP_CATEGORY_ALL, OMP_CLAUSE_DEFAULTMAP_CATEGORY_ALLOCATABLE, OMP_CLAUSE_DEFAULTMAP_CATEGORY_POINTER, OMP_CLAUSE_DEFAULTMAP_CATEGORY_SCALAR, OMP_CLAUSE_DEFAULTMAP_CATEGORY_UNSPECIFIED, OMP_CLAUSE_DEFAULTMAP_DEFAULT, OMP_CLAUSE_DEFAULTMAP_FIRSTPRIVATE, OMP_CLAUSE_DEFAULTMAP_FROM, OMP_CLAUSE_DEFAULTMAP_NONE, OMP_CLAUSE_DEFAULTMAP_PRESENT, OMP_CLAUSE_DEFAULTMAP_TO, OMP_CLAUSE_DEFAULTMAP_TOFROM, OMP_CLAUSE_DEPEND, OMP_CLAUSE_DETACH, OMP_CLAUSE_DEVICE, OMP_CLAUSE_DEVICE_ANCESTOR, OMP_CLAUSE_DEVICE_ID, OMP_CLAUSE_DIST_SCHEDULE, OMP_CLAUSE_DOACROSS, OMP_CLAUSE_DOACROSS_KIND, OMP_CLAUSE_DOACROSS_SINK, OMP_CLAUSE_DOACROSS_SOURCE, OMP_CLAUSE_EXCLUSIVE, OMP_CLAUSE_FILTER, OMP_CLAUSE_FINAL, OMP_CLAUSE_FINALIZE, OMP_CLAUSE_FIRSTPRIVATE, OMP_CLAUSE_FIRSTPRIVATE_IMPLICIT, OMP_CLAUSE_FROM, OMP_CLAUSE_GANG, OMP_CLAUSE_GRAINSIZE, OMP_CLAUSE_HAS_DEVICE_ADDR, OMP_CLAUSE_HINT, OMP_CLAUSE_IF, OMP_CLAUSE_IF_MODIFIER, OMP_CLAUSE_IF_PRESENT, OMP_CLAUSE_IN_REDUCTION, OMP_CLAUSE_INCLUSIVE, OMP_CLAUSE_INDEPENDENT, OMP_CLAUSE_INTEROP, OMP_CLAUSE_IS_DEVICE_PTR, OMP_CLAUSE_LASTPRIVATE, OMP_CLAUSE_LASTPRIVATE_CONDITIONAL, OMP_CLAUSE_LASTPRIVATE_GIMPLE_SEQ, OMP_CLAUSE_LASTPRIVATE_STMT, OMP_CLAUSE_LINEAR, OMP_CLAUSE_LINEAR_GIMPLE_SEQ, OMP_CLAUSE_LINEAR_NO_COPYIN, OMP_CLAUSE_LINEAR_NO_COPYOUT, OMP_CLAUSE_LINEAR_STEP, OMP_CLAUSE_LINEAR_STMT, OMP_CLAUSE_LOCATION, OMP_CLAUSE_MAP, OMP_CLAUSE_MAP_IN_REDUCTION, OMP_CLAUSE_MAP_KIND, OMP_CLAUSE_MERGEABLE, OMP_CLAUSE_NOCONTEXT, OMP_CLAUSE_NOCONTEXT_EXPR, OMP_CLAUSE_NOGROUP, OMP_CLAUSE_NOHOST, OMP_CLAUSE_NONTEMPORAL, OMP_CLAUSE_NOVARIANTS, OMP_CLAUSE_NOVARIANTS_EXPR, OMP_CLAUSE_NOWAIT, OMP_CLAUSE_NUM_GANGS, OMP_CLAUSE_NUM_TASKS, OMP_CLAUSE_NUM_TEAMS, OMP_CLAUSE_NUM_TEAMS_LOWER_EXPR, OMP_CLAUSE_NUM_THREADS, OMP_CLAUSE_NUM_WORKERS, OMP_CLAUSE_OPERAND, OMP_CLAUSE_ORDER, OMP_CLAUSE_ORDERED, OMP_CLAUSE_PRIORITY, OMP_CLAUSE_PRIVATE, OMP_CLAUSE_PRIVATE_OUTER_REF, OMP_CLAUSE_PROC_BIND, OMP_CLAUSE_REDUCTION, OMP_CLAUSE_REDUCTION_DECL_PLACEHOLDER, OMP_CLAUSE_REDUCTION_GIMPLE_INIT, OMP_CLAUSE_REDUCTION_GIMPLE_MERGE, OMP_CLAUSE_REDUCTION_INIT, OMP_CLAUSE_REDUCTION_INSCAN, OMP_CLAUSE_REDUCTION_MERGE, OMP_CLAUSE_REDUCTION_PLACEHOLDER, OMP_CLAUSE_REDUCTION_TASK, OMP_CLAUSE_RELEASE_DESCRIPTOR, OMP_CLAUSE_SAFELEN, OMP_CLAUSE_SCHEDULE, OMP_CLAUSE_SELF, OMP_CLAUSE_SEQ, OMP_CLAUSE_SHARED, OMP_CLAUSE_SIMD, OMP_CLAUSE_SIMDLEN, OMP_CLAUSE_SIZE, OMP_CLAUSE_TASK_REDUCTION, OMP_CLAUSE_THREAD_LIMIT, OMP_CLAUSE_THREADS, OMP_CLAUSE_TILE, OMP_CLAUSE_TO, OMP_CLAUSE_UNTIED, OMP_CLAUSE_USE_DEVICE_ADDR, OMP_CLAUSE_USE_DEVICE_PTR, OMP_CLAUSE_VECTOR, OMP_CLAUSE_VECTOR_LENGTH, OMP_CLAUSE_WAIT, OMP_CLAUSE_WORKER, omp_find_clause(), omp_firstprivatize_variable(), omp_gather_mapping_groups(), omp_index_mapping_groups(), omp_lastprivate_for_combined_outer_constructs(), omp_map_clause_descriptor_p(), omp_mapped_by_containing_struct(), omp_member_access_dummy_var(), omp_notice_variable(), omp_parse_expr(), lang_hooks_for_decls::omp_private_outer_ref, lang_hooks_for_decls::omp_scalar_p, gimplify_omp_ctx::order_concurrent, ORT_ACC, ORT_ACC_HOST_DATA, ORT_COMBINED_PARALLEL, ORT_COMBINED_TARGET, ORT_COMBINED_TEAMS, ORT_PARALLEL, ORT_SIMD, ORT_TASK, ORT_TASKLOOP, ORT_WORKSHARE, gimplify_omp_ctx::outer_context, pop_gimplify_context(), push_gimplify_context(), gimplify_omp_ctx::region_type, size_binop, size_int, gimplify_omp_ctx::target_firstprivatize_array_bases, wi::to_widest(), TREE_ADDRESSABLE, TREE_CHAIN, TREE_CODE, TREE_OPERAND, TREE_PURPOSE, TREE_SIDE_EFFECTS, TREE_TYPE, TYPE_ALIGN_UNIT, TYPE_DOMAIN, TYPE_MAX_VALUE, TYPE_SIZE_UNIT, unshare_expr(), splay_tree_node< T >::value(), gimplify_omp_ctx::variables, void_type_node, walk_tree, and warning_at().
Referenced by gimplify_expr(), gimplify_oacc_cache(), gimplify_oacc_declare(), gimplify_omp_dispatch(), gimplify_omp_for(), gimplify_omp_parallel(), gimplify_omp_target_update(), gimplify_omp_task(), and gimplify_omp_workshare().
enum gimplify_status gimplify_self_mod_expr | ( | tree * | expr_p, |
gimple_seq * | pre_p, | ||
gimple_seq * | post_p, | ||
bool | want_value, | ||
tree | arith_type ) |
Gimplify the self modifying expression pointed to by EXPR_P (++, --, +=, -=). PRE_P points to the list where side effects that must happen before *EXPR_P should be stored. POST_P points to the list where side effects that must happen after *EXPR_P should be stored. WANT_VALUE is nonzero iff we want to use the value of this expression in another expression. ARITH_TYPE is the type the computation should be performed in.
References build2(), convert_to_ptrofftype_loc(), EXPR_LOCATION, fb_lvalue, fb_rvalue, fold_build1_loc(), fold_build2, fold_convert, gcc_assert, get_initialized_tmp_var(), gimplify_assign(), gimplify_expr(), gimplify_seq_add_seq(), GS_ALL_DONE, GS_ERROR, GS_OK, is_gimple_lvalue(), is_gimple_val(), NULL, POINTER_TYPE_P, TREE_CODE, TREE_OPERAND, and TREE_TYPE.
Referenced by gimplify_expr().
|
static |
Append sequence SRC to the end of sequence *DST_P. If *DST_P is NULL, a new sequence is allocated. This function is similar to gimple_seq_add_seq, but does not scan the operands. During gimplification, we need to manipulate statement sequences before the def/use vectors have been constructed.
References gsi_insert_seq_after_without_update(), gsi_last(), GSI_NEW_STMT, NULL, and si.
Referenced by gimple_pop_condition(), gimplify_body(), gimplify_cleanup_point_expr(), gimplify_expr(), gimplify_omp_for(), gimplify_omp_loop_xform(), gimplify_self_mod_expr(), and gimplify_switch_expr().
|
inlinestatic |
Shorter alias name for the above function for use in gimplify.cc only.
References gimple_seq_add_stmt_without_update().
Referenced by build_instrumentation_call(), gimple_add_padding_init_for_auto_var(), gimple_push_cleanup(), gimplify_asm_expr(), gimplify_bind_expr(), gimplify_body(), gimplify_call_expr(), gimplify_case_label_expr(), gimplify_cond_expr(), gimplify_expr(), gimplify_function_tree(), gimplify_init_constructor(), gimplify_init_ctor_eval(), gimplify_init_ctor_eval_range(), gimplify_label_expr(), gimplify_loop_expr(), gimplify_modify_expr(), gimplify_modify_expr_complex_part(), gimplify_modify_expr_to_memcpy(), gimplify_modify_expr_to_memset(), gimplify_oacc_declare(), gimplify_omp_atomic(), gimplify_omp_dispatch(), gimplify_omp_for(), gimplify_omp_loop_xform(), gimplify_omp_parallel(), gimplify_omp_target_update(), gimplify_omp_task(), gimplify_omp_workshare(), gimplify_return_expr(), gimplify_switch_expr(), gimplify_transaction(), and maybe_add_early_return_predict_stmt().
|
static |
Gimplify a statement list onto a sequence. These may be created either by an enlightened front-end, or by shortcut_cond_expr.
References gimplify_stmt(), GS_ALL_DONE, GS_OK, i, NULL, tsi_delink(), tsi_end_p(), tsi_start(), tsi_stmt_ptr(), and voidify_wrapper_expr().
Referenced by gimplify_expr().
bool gimplify_stmt | ( | tree * | stmt_p, |
gimple_seq * | seq_p ) |
Gimplification of expression trees.
Gimplify an expression which appears at statement context. The corresponding GIMPLE statements are added to *SEQ_P. If *SEQ_P is NULL, a new sequence is allocated. Return true if we actually added a statement to the queue.
References fb_none, gimple_seq_last(), gimplify_expr(), is_gimple_stmt(), last, and NULL.
Referenced by gimple_push_cleanup(), gimplify_and_add(), gimplify_bind_expr(), gimplify_body(), gimplify_cleanup_point_expr(), gimplify_compound_expr(), gimplify_cond_expr(), gimplify_init_constructor(), gimplify_modify_expr(), gimplify_statement_list(), gimplify_switch_expr(), goa_stabilize_expr(), and lower_omp_task_reductions().
|
static |
Gimplify a SWITCH_EXPR, and collect the vector of labels it can branch to.
References as_a(), build_case_label(), CASE_LABEL, gimplify_ctx::case_labels, create_artificial_label(), expand_FALLTHROUGH(), EXPR_LOCATION, fb_rvalue, gcc_assert, gcc_unreachable, gimple_build_bind(), gimple_build_label(), gimple_build_switch(), gimple_label_label(), gimple_seq_add_seq(), gimple_seq_last_stmt(), gimple_set_location(), gimplify_ctxp, gimplify_expr(), gimplify_seq_add_seq(), gimplify_seq_add_stmt(), gimplify_stmt(), GS_ALL_DONE, GS_ERROR, GS_UNHANDLED, gimplify_ctx::in_switch_expr, hash_set< KeyId, Lazy, Traits >::is_empty(), is_gimple_val(), last, gimplify_ctx::live_switch_vars, maybe_warn_implicit_fallthrough(), maybe_warn_switch_unreachable_and_auto_init(), NULL, NULL_TREE, preprocess_case_label_vec_for_gimple(), SWITCH_BODY, SWITCH_BREAK_LABEL_P, SWITCH_COND, TREE_CODE, TREE_TYPE, and UNKNOWN_LOCATION.
Referenced by gimplify_expr().
|
static |
Gimplify a TARGET_EXPR which doesn't appear on the rhs of an INIT_EXPR.
References asan_poison_variable(), asan_poisoned_variables, build2(), build_asan_poison_call_expr(), build_clobber(), CLEANUP_EH_ONLY, CLOBBER_STORAGE_END, dbg_cnt(), DECL_ALIGN, DECL_SEEN_IN_BIND_EXPR_P, DECL_SIZE, fb_none, gcc_assert, ggc_free(), gimple_add_tmp_var(), gimple_push_cleanup(), gimple_seq_add_seq(), gimplify_and_add(), gimplify_ctxp, gimplify_expr(), gimplify_omp_ctxp, gimplify_type_sizes(), gimplify_vla_decl(), GS_ERROR, GS_OK, gsi_end_p(), gsi_last(), gsi_start(), gimplify_ctx::in_cleanup_point_expr, init_expr(), is_gimple_stmt(), MAX_SUPPORTED_STACK_ALIGNMENT, needs_to_live_in_memory(), NULL, NULL_TREE, poly_int_tree_p(), SR_ALL, TARGET_EXPR_CLEANUP, TARGET_EXPR_INITIAL, TARGET_EXPR_SLOT, TREE_OPERAND, TREE_STATIC, TREE_TYPE, TYPE_SIZES_GIMPLIFIED, void_type_node, and VOID_TYPE_P.
Referenced by gimplify_expr().
|
static |
Gimplify a TRANSACTION_EXPR. This involves gimplification of the body, and adding some EH bits.
References build3(), EXPR_LOCATION, gimple_build_transaction(), gimple_transaction_set_subcode(), gimplify_and_return_first(), gimplify_seq_add_stmt(), GS_ALL_DONE, GS_OK, GTMA_IS_OUTER, GTMA_IS_RELAXED, NULL, NULL_TREE, pop_gimplify_context(), push_gimplify_context(), SET_EXPR_LOCATION, TRANSACTION_EXPR_BODY, TRANSACTION_EXPR_OUTER, TRANSACTION_EXPR_RELAXED, TREE_CODE, TREE_SIDE_EFFECTS, void_type_node, and voidify_wrapper_expr().
Referenced by gimplify_expr().
void gimplify_type_sizes | ( | tree | type, |
gimple_seq * | list_p ) |
Look through TYPE for variable-sized objects and gimplify each such size that we find. Add to LIST_P any statements generated.
References DECL_ARTIFICIAL, DECL_CHAIN, DECL_FIELD_OFFSET, DECL_IGNORED_P, DECL_SIZE, DECL_SIZE_UNIT, error_mark_node, gimplify_one_sizepos(), gimplify_type_sizes(), INTEGRAL_TYPE_P, NULL, TREE_CODE, TREE_TYPE, TYPE_DOMAIN, TYPE_FIELDS, TYPE_MAIN_VARIANT, TYPE_MAX_VALUE, TYPE_MIN_VALUE, TYPE_NAME, TYPE_NEXT_VARIANT, TYPE_SIZE, TYPE_SIZE_UNIT, TYPE_SIZES_GIMPLIFIED, and VAR_P.
Referenced by gimplify_decl_expr(), gimplify_omp_depend(), gimplify_parameters(), gimplify_return_expr(), gimplify_target_expr(), and gimplify_type_sizes().
enum gimplify_status gimplify_va_arg_expr | ( | tree * | expr_p, |
gimple_seq * | pre_p, | ||
gimple_seq * | post_p ) |
Gimplify __builtin_va_arg, aka VA_ARG_EXPR, which is not really a builtin function, but a very special sort of operator.
References build_call_expr_internal_loc(), build_call_expr_loc(), build_int_cst(), build_pointer_type(), builtin_decl_implicit(), cfun, dummy_object(), error_mark_node, expansion_point_location_if_in_system_header(), EXPR_LOCATION, gcc_assert, gimplify_and_add(), GS_ALL_DONE, GS_ERROR, GS_OK, inform(), NULL_TREE, POINTER_TYPE_P, targetm, TREE_OPERAND, TREE_TYPE, lang_hooks_for_types::type_promotes_to, lang_hooks::types, and warning_at().
Referenced by gimplify_expr().
|
static |
Gimplify a VAR_DECL or PARM_DECL. Return GS_OK if we expanded a DECL_VALUE_EXPR, and it's worth re-examining things.
References current_function_decl, DECL_EXTERNAL, decl_function_context(), DECL_HAS_VALUE_EXPR_P, DECL_SEEN_IN_BIND_EXPR_P, DECL_VALUE_EXPR, gcc_assert, gimplify_omp_ctxp, GS_ALL_DONE, GS_ERROR, GS_OK, omp_notice_variable(), seen_error(), TREE_STATIC, unshare_expr(), and VAR_P.
Referenced by gimplify_compound_lval(), and gimplify_expr().
|
static |
Gimplify a comparison between two variable-sized objects. Do this with a call to BUILT_IN_MEMCMP.
References build2(), build_call_expr_loc(), build_fold_addr_expr_loc(), builtin_decl_implicit(), expr, EXPR_LOCATION, GS_OK, integer_zero_node, SET_EXPR_LOCATION, SUBSTITUTE_PLACEHOLDER_IN_EXPR, TREE_CODE, TREE_OPERAND, TREE_TYPE, TYPE_SIZE_UNIT, and unshare_expr().
Referenced by gimplify_expr().
|
static |
Gimplify a variable-length array DECL.
References build2(), build_alloca_call_expr(), build_fold_indirect_ref, build_pointer_type(), CALL_ALLOCA_FOR_VAR_P, CALLGRAPH_INFO_DYNAMIC_ALLOC, create_tmp_var, DECL_ALIGN, DECL_HAS_VALUE_EXPR_P, DECL_IGNORED_P, DECL_SIZE, DECL_SIZE_UNIT, fold_convert, get_name(), gimplify_and_add(), gimplify_one_sizepos(), max_int_size_in_bytes(), record_dynamic_alloc(), SET_DECL_VALUE_EXPR, TREE_THIS_NOTRAP, and TREE_TYPE.
Referenced by gimplify_decl_expr(), gimplify_omp_depend(), and gimplify_target_expr().
A subroutine of gimplify_omp_atomic. The front end is supposed to have stabilized the lhs of the atomic operation as *ADDR. Return true if EXPR is this stabilized form.
References CONVERT_EXPR_P, INDIRECT_REF_P, STRIP_USELESS_TYPE_CONVERSION, TREE_CODE, TREE_OPERAND, TREE_TYPE, and types_compatible_p().
Referenced by goa_stabilize_expr().
|
static |
Walk *EXPR_P and replace appearances of *LHS_ADDR with LHS_VAR. If an expression does not involve the lhs, evaluate it into a temporary. Return 1 if the lhs appeared as a subexpression, 0 if it did not, or -1 if an error was encountered.
References CALL_EXPR_ARG, call_expr_nargs, expr, fb_lvalue, fb_rvalue, fndecl_built_in_p(), get_callee_fndecl(), gimplify_expr(), gimplify_stmt(), goa_lhs_expr_p(), goa_stabilize_expr(), GS_ALL_DONE, i, is_gimple_lvalue(), is_gimple_val(), NULL, NULL_TREE, TARGET_EXPR_INITIAL, tcc_binary, tcc_comparison, tcc_expression, tcc_reference, tcc_unary, tcc_vl_exp, TREE_CODE, TREE_CODE_CLASS, TREE_OPERAND, TREE_TYPE, and VOID_TYPE_P.
Referenced by gimplify_omp_atomic(), and goa_stabilize_expr().
|
static |
Return the initial guess for an appropriate RHS predicate for this LHS, before the LHS has been gimplified.
References is_gimple_mem_rhs_or_call(), is_gimple_reg_rhs_or_call(), is_gimple_reg_type(), and TREE_TYPE.
Referenced by gimplify_modify_expr().
|
static |
Helper for get_formal_tmp_var and get_initialized_tmp_var.
References build2(), cfun, create_tmp_var_name(), EXPR_LOC_OR_LOC, fb_rvalue, get_name(), ggc_free(), gimple_in_ssa_p(), gimplify_and_add(), gimplify_ctxp, gimplify_expr(), input_location, gimplify_ctx::into_ssa, is_gimple_reg_rhs_or_call(), is_gimple_reg_type(), lookup_tmp_var(), make_ssa_name(), SET_EXPR_LOCATION, SET_SSA_NAME_VAR_OR_IDENTIFIER, SSA_NAME_DEF_STMT, TREE_CODE, TREE_TYPE, TYPE_MAIN_VARIANT, and unshare_expr().
Referenced by get_formal_tmp_var(), get_initialized_tmp_var(), and prepare_gimple_addressable().
Returns true iff T is a valid RHS for an assignment to an un-renamed LHS, or for a call argument.
References is_gimple_lvalue(), is_gimple_reg_type(), is_gimple_val(), and TREE_TYPE.
Referenced by gimplify_expr(), and gimplify_init_ctor_preeval().
Return true if T is a valid memory RHS or a CALL_EXPR. Note that this predicate should only be used during gimplification. See the rationale for this in gimplify_modify_expr.
References is_gimple_lvalue(), is_gimple_reg_type(), is_gimple_val(), TREE_CLOBBER_P, TREE_CODE, and TREE_TYPE.
Referenced by gimplify_expr(), initial_rhs_predicate_for(), and rhs_predicate_for().
Return true if T is a CALL_EXPR or an expression that can be assigned to a temporary. Note that this predicate should only be used during gimplification. See the rationale for this in gimplify_modify_expr.
References get_gimple_rhs_class(), GIMPLE_INVALID_RHS, and TREE_CODE.
Referenced by gimplify_expr(), initial_rhs_predicate_for(), internal_get_tmp_var(), and rhs_predicate_for().
Return true if T looks like a valid GIMPLE statement.
References IS_EMPTY_STMT, NULL, TREE_CODE, TREE_TYPE, and VOID_TYPE_P.
Referenced by gimplify_expr(), gimplify_omp_loop(), gimplify_save_expr(), gimplify_stmt(), and gimplify_target_expr().
Return true if DECL has an ACC DECLARE attribute.
References DECL_ATTRIBUTES, lookup_attribute(), NULL_TREE, TREE_CODE, and TREE_OPERAND.
Referenced by gimplify_oacc_declare(), and oacc_default_clause().
Return true if the DECL need to be automaticly initialized by the compiler.
References AUTO_INIT_UNINITIALIZED, auto_var_p(), DECL_ATTRIBUTES, DECL_HARD_REGISTER, is_empty_type(), lookup_attribute(), OPAQUE_TYPE_P, TREE_CODE, and TREE_TYPE.
Referenced by gimplify_decl_expr(), and gimplify_init_constructor().
Find the last nondebug statement in a scope STMT.
References as_a(), gcc_unreachable, gimple_bind_body(), gimple_call_internal_p(), gimple_seq_last_nondebug_stmt(), gimple_stmt_may_fallthru(), gimple_try_cleanup(), gimple_try_eval(), GIMPLE_TRY_FINALLY, gimple_try_kind(), last_stmt_in_scope(), and NULL.
Referenced by collect_fallthrough_labels(), and last_stmt_in_scope().
Create a temporary to hold the value of VAL. If IS_FORMAL, try to reuse an existing expression temporary. If NOT_GIMPLE_REG, mark it as such.
References create_tmp_from_val(), DECL_NOT_GIMPLE_REG_P, hash_table< Descriptor, Lazy, Allocator >::find_slot(), gcc_assert, gimplify_ctxp, NULL, gimple_temp_hash_elt::temp, gimplify_ctx::temp_htab, TREE_SIDE_EFFECTS, and gimple_temp_hash_elt::val.
Referenced by internal_get_tmp_var().
|
static |
Maybe add early return predict statement to PRE_P sequence.
References gimple_build_predict(), gimple_conditional_context(), gimplify_seq_add_stmt(), and NOT_TAKEN.
Referenced by gimplify_return_expr().
|
static |
Don't fold inside offloading or taskreg regions: it can break code by adding decl references that weren't in the source. We'll do it during omplower pass instead.
References fold_stmt(), gimple_call_builtin_p(), gimplify_omp_ctxp, gsi_stmt(), ORT_HOST_TEAMS, ORT_PARALLEL, ORT_TARGET, ORT_TASK, gimplify_omp_ctx::outer_context, and gimplify_omp_ctx::region_type.
Referenced by gimplify_call_expr(), gimplify_cond_expr(), and gimplify_modify_expr().
|
static |
Warn when a switch case falls through.
References lang_GNU_C(), lang_GNU_CXX(), lang_GNU_OBJC(), NULL, walk_gimple_seq(), and warn_implicit_fallthrough_r().
Referenced by gimplify_switch_expr().
|
static |
Possibly warn about unreachable statements between switch's controlling expression and the first case. Also warn about -ftrivial-auto-var-init cannot initialize the auto variable under such situation. SEQ is the body of a switch expression.
References lang_GNU_Fortran(), NULL, walk_gimple_seq(), and warn_switch_unreachable_and_auto_init_r().
Referenced by gimplify_switch_expr().
|
static |
If *EXPR_P has a variable sized type, wrap it in a WITH_SIZE_EXPR.
References build2(), error_mark_node, poly_int_tree_p(), SUBSTITUTE_PLACEHOLDER_IN_EXPR, TREE_CODE, TREE_TYPE, TYPE_SIZE_UNIT, and unshare_expr().
Referenced by gimplify_arg(), gimplify_init_ctor_preeval(), and gimplify_modify_expr().
This page contains routines to unshare tree nodes, i.e. to duplicate tree nodes that are referenced more than once in GENERIC functions. This is necessary because gimplification (translation into GIMPLE) is performed by modifying tree nodes in-place, so gimplication of a shared node in a first context could generate an invalid GIMPLE form in a second context. This is achieved with a simple mark/copy/unmark algorithm that walks the GENERIC representation top-down, marks nodes with TREE_VISITED the first time it encounters them, duplicates them if they already have TREE_VISITED set, and finally removes the TREE_VISITED marks it has set. The algorithm works only at the function level, i.e. it generates a GENERIC representation of a function with no nodes shared within the function when passed a GENERIC function (except for nodes that are allowed to be shared). At the global level, it is also necessary to unshare tree nodes that are referenced in more than one function, for the same aforementioned reason. This requires some cooperation from the front-end. There are 2 strategies: 1. Manual unsharing. The front-end needs to call unshare_expr on every expression that might end up being shared across functions. 2. Deep unsharing. This is an extension of regular unsharing. Instead of calling unshare_expr on expressions that might be shared across functions, the front-end pre-marks them with TREE_VISITED. This will ensure that they are unshared on the first reference within functions when the regular unsharing algorithm runs. The counterpart is that this algorithm must look deeper than for manual unsharing, which is specified by LANG_HOOKS_DEEP_UNSHARING. If there are only few specific cases of node sharing across functions, it is probably easier for a front-end to unshare the expressions manually. On the contrary, if the expressions generated at the global level are as widespread as expressions generated within functions, deep unsharing is very likely the way to go.
Similar to copy_tree_r but do not copy SAVE_EXPR or TARGET_EXPR nodes. These nodes model computations that must be done once. If we were to unshare something like SAVE_EXPR(i++), the gimplification process would create wrong code. However, if DATA is non-null, it must hold a pointer set that is used to unshare the subtrees of these nodes.
References gimplify_omp_ctx::code, copy_tree_r(), NULL, NULL_TREE, tcc_constant, tcc_declaration, tcc_type, TREE_CODE, and TREE_CODE_CLASS.
Referenced by copy_if_shared_r(), unshare_expr(), and unshare_expr_without_location().
|
static |
Create a new omp construct that deals with variable remapping.
References gimplify_omp_ctx::default_kind, gimplify_omp_ctx::defaultmap, GDMK_AGGREGATE, GDMK_ALLOCATABLE, GDMK_POINTER, GDMK_SCALAR, GDMK_SCALAR_TARGET, gimplify_omp_ctxp, GOVD_MAP, input_location, gimplify_omp_ctx::location, OMP_CLAUSE_DEFAULT_SHARED, OMP_CLAUSE_DEFAULT_UNSPECIFIED, ORT_TASK, gimplify_omp_ctx::outer_context, gimplify_omp_ctx::privatized_types, gimplify_omp_ctx::region_type, splay_tree_compare_decl_uid(), and gimplify_omp_ctx::variables.
Referenced by gimplify_body(), and gimplify_scan_omp_clauses().
|
static |
Get a fresh identifier for a new condition expression. This is used for condition coverage.
References nextconduid.
Referenced by gimplify_cond_expr().
Helper for gimplify_omp_loop, called through walk_tree.
References current_function_decl, DECL_CONTEXT, is_global_var(), NULL_TREE, and VAR_P.
Referenced by gimplify_omp_loop().
|
static |
Determine outer default flags for DECL mentioned in an OACC region but not declared in an enclosing clause.
References AGGREGATE_TYPE_P, DECL_ARTIFICIAL, DECL_NAME, lang_hooks::decls, gimplify_omp_ctx::default_kind, device_resident_p(), error(), gcc_checking_assert, gcc_unreachable, GOVD_FIRSTPRIVATE, GOVD_MAP, GOVD_MAP_FORCE, GOVD_MAP_FORCE_PRESENT, GOVD_MAP_TO_ONLY, inform(), is_global_var(), is_oacc_declared(), gimplify_omp_ctx::location, oacc_region_type_name(), OMP_CLAUSE_DEFAULT_NONE, OMP_CLAUSE_DEFAULT_PRESENT, OMP_CLAUSE_DEFAULT_SHARED, lang_hooks_for_decls::omp_disregard_value_expr, omp_privatize_by_reference(), lang_hooks_for_decls::omp_report_decl, ORT_ACC_DATA, ORT_ACC_KERNELS, ORT_ACC_PARALLEL, ORT_ACC_SERIAL, gimplify_omp_ctx::outer_context, RECORD_OR_UNION_TYPE_P, gimplify_omp_ctx::region_type, and TREE_TYPE.
Referenced by omp_notice_variable().
|
static |
Return string name for types of OpenACC constructs from ORT_* values.
References gcc_unreachable, ORT_ACC_DATA, ORT_ACC_KERNELS, ORT_ACC_PARALLEL, ORT_ACC_SERIAL, and gimplify_omp_ctx::region_type.
Referenced by oacc_default_clause().
void oacc_resolve_clause_dependencies | ( | vec< omp_mapping_group > * | groups, |
hash_map< tree_operand_hash_no_se, omp_mapping_group * > * | grpmap ) |
Similar to omp_resolve_clause_dependencies, but for OpenACC. The only clause dependencies we handle for now are struct element mappings and whole-struct mappings on the same directive, and duplicate clause detection.
References hash_set< KeyId, Lazy, Traits >::add(), hash_set< KeyId, Lazy, Traits >::contains(), DECL_P, omp_mapping_group::deleted, error_at(), FOR_EACH_VEC_ELT, gcc_assert, omp_mapping_group::grp_end, omp_mapping_group::grp_start, i, NULL, omp_check_mapping_compatibility(), OMP_CLAUSE_CODE, OMP_CLAUSE_DECL, OMP_CLAUSE_LOCATION, OMP_CLAUSE_MAP, omp_mapped_by_containing_struct(), TREE_CODE, and TREE_OPERAND.
Referenced by gimplify_adjust_omp_clauses().
|
static |
Mapping struct members causes an additional set of nodes to be created, starting with GOMP_MAP_STRUCT followed by a number of mappings equal to the number of members being mapped, in order of ascending position (address or bitwise). We scan through the list of mapping clauses, calling this function for each struct member mapping we find, and build up the list of mappings after the initial GOMP_MAP_STRUCT node. For pointer members, these will be newly-created ALLOC nodes. For non-pointer members, the existing mapping is moved into place in the sorted list. struct { int *a; int *b; int c; int *d; }; #pragma (acc|omp directive) copy(struct.a[0:n], struct.b[0:n], struct.c, struct.d[0:n]) GOMP_MAP_STRUCT (4) [GOMP_MAP_FIRSTPRIVATE_REFERENCE -- for refs to structs] GOMP_MAP_ALLOC (struct.a) GOMP_MAP_ALLOC (struct.b) GOMP_MAP_TO (struct.c) GOMP_MAP_ALLOC (struct.d) ... In the case where we are mapping references to pointers, or in Fortran if we are mapping an array with a descriptor, additional nodes may be created after the struct node list also. The return code is either a pointer to the next node to process (if the list has been rearranged), else NULL to continue with the next node in the original list.
References omp_addr_tokenizer::omp_addr_token::access_kind, alloc_node(), build_fold_addr_expr, build_fold_indirect_ref, build_omp_clause(), build_omp_struct_comp_nodes(), gimplify_omp_ctx::code, DECL_P, omp_addr_tokenizer::omp_addr_token::expr, extract_base_bit_offset(), fold_build2_loc(), fold_convert_loc(), gcc_assert, gcc_unreachable, hash_map< KeyId, Value, Traits >::get(), i, INDIRECT_REF_P, integer_zerop(), known_eq, lang_GNU_Fortran(), NULL, NULL_TREE, offset, OMP_CLAUSE_ATTACHMENT_MAPPING_ERASED, OMP_CLAUSE_CHAIN, OMP_CLAUSE_DECL, OMP_CLAUSE_LOCATION, OMP_CLAUSE_MAP, OMP_CLAUSE_MAP_KIND, OMP_CLAUSE_MAP_MAYBE_ZERO_LENGTH_ARRAY_SECTION, OMP_CLAUSE_SET_MAP_KIND, OMP_CLAUSE_SIZE, omp_directive_maps_explicitly(), omp_first_chained_access_token(), omp_get_nonfirstprivate_group(), omp_map_clause_descriptor_p(), omp_siblist_insert_node_after(), omp_siblist_move_concat_nodes_after(), omp_siblist_move_node_after(), omp_siblist_move_nodes_after(), operand_equal_p(), ORT_ACC, ORT_TARGET, ptrdiff_type_node, hash_map< KeyId, Value, Traits >::put(), gimplify_omp_ctx::region_type, sc, size_binop, size_int, size_one_node, size_zero_node, TREE_CODE, TREE_OPERAND, tree_to_uhwi(), TREE_TYPE, omp_addr_tokenizer::omp_addr_token::type, TYPE_SIZE_UNIT, omp_addr_tokenizer::omp_addr_token::u, and unshare_expr().
Referenced by omp_build_struct_sibling_lists().
|
static |
Add an entry for DECL in the OMP context CTX with FLAGS.
References DECL_P, DECL_SIZE, DECL_SIZE_UNIT, DECL_VALUE_EXPR, error_operand_p(), gcc_assert, GOVD_DATA_SHARE_CLASS, GOVD_DEBUG_PRIVATE, GOVD_EXPLICIT, GOVD_FIRSTPRIVATE, GOVD_LASTPRIVATE, GOVD_LOCAL, GOVD_MAP, GOVD_MAP_TO_ONLY, GOVD_PRIVATE, GOVD_REDUCTION, GOVD_SEEN, GOVD_SHARED, INDIRECT_REF_P, NULL, omp_add_variable(), omp_firstprivatize_type_sizes(), omp_firstprivatize_variable(), omp_notice_variable(), omp_privatize_by_reference(), ORT_ACC, ORT_ACC_KERNELS, ORT_ACC_PARALLEL, ORT_NONE, ORT_TARGET, ORT_TARGET_DATA, ORT_TASKGROUP, gimplify_omp_ctx::outer_context, poly_int_tree_p(), gimplify_omp_ctx::region_type, TREE_ADDRESSABLE, TREE_OPERAND, TREE_TYPE, TYPE_NEEDS_CONSTRUCTING, TYPE_SIZE_UNIT, splay_tree_node< T >::value(), and gimplify_omp_ctx::variables.
Referenced by gimple_add_tmp_var(), gimplify_adjust_omp_clauses(), gimplify_bind_expr(), gimplify_oacc_declare(), gimplify_omp_depend(), gimplify_omp_for(), gimplify_omp_loop_xform(), gimplify_scan_omp_clauses(), omp_add_variable(), omp_firstprivatize_variable(), omp_lastprivate_for_combined_outer_constructs(), and omp_notice_variable().
|
static |
Scan through GROUPS, and create sorted structure sibling lists without gimplifying.
References omp_addr_tokenizer::omp_addr_token::access_kind, hash_map< KeyId, Value, Traits >::begin(), build_fold_addr_expr, gimplify_omp_ctx::code, DECL_P, omp_mapping_group::deleted, hash_map< KeyId, Value, Traits >::end(), error_at(), error_operand_p(), fold_build2, fold_convert, FOR_EACH_VEC_ELT, omp_mapping_group::fragile, gcc_assert, omp_mapping_group::grp_end, omp_mapping_group::grp_start, i, INDIRECT_REF_P, omp_mapping_group::mark, omp_mapping_group::next, NULL, NULL_TREE, omp_accumulate_sibling_list(), OMP_CLAUSE_CHAIN, OMP_CLAUSE_CODE, OMP_CLAUSE_DECL, OMP_CLAUSE_LOCATION, OMP_CLAUSE_MAP, OMP_CLAUSE_MAP_KIND, OMP_CLAUSE_SET_MAP_KIND, OMP_CLAUSE_SIZE, omp_first_chained_access_token(), omp_map_clause_descriptor_p(), omp_mapped_by_containing_struct(), omp_parse_expr(), omp_reindex_mapping_groups(), ORT_TARGET, pointer_sized_int_node, ptrdiff_type_node, gimplify_omp_ctx::region_type, omp_mapping_group::reprocess_struct, omp_mapping_group::sibling, STRIP_NOPS, TREE_CODE, TREE_OPERAND, tree_to_uhwi(), TREE_TYPE, omp_addr_tokenizer::omp_addr_token::type, TYPE_SIZE_UNIT, omp_addr_tokenizer::omp_addr_token::u, and UNVISITED.
Referenced by gimplify_adjust_omp_clauses().
bool omp_check_mapping_compatibility | ( | location_t | loc, |
omp_mapping_group * | outer, | ||
omp_mapping_group * | inner ) |
If we have mappings INNER and OUTER, where INNER is a component access and OUTER is a mapping of the whole containing struct, check that the mappings are compatible. We'll be deleting the inner mapping, so we need to make sure the outer mapping does (at least) the same transfers to/from the device as the inner mapping.
References error_at(), gcc_assert, omp_mapping_group::grp_start, OMP_CLAUSE_CODE, OMP_CLAUSE_DECL, OMP_CLAUSE_MAP, and OMP_CLAUSE_MAP_KIND.
Referenced by oacc_resolve_clause_dependencies(), and omp_resolve_clause_dependencies().
|
static |
Return true if DECL is private within a parallel region that binds to the current construct's context or in parallel region's REDUCTION clause.
References GOVD_DATA_SHARE_CLASS, GOVD_LOCAL, GOVD_MAP, GOVD_SHARED, is_global_var(), NULL, omp_member_access_dummy_var(), omp_privatize_by_reference(), ORT_ACC, ORT_SIMD, ORT_TARGET, ORT_TARGET_DATA, ORT_TASKGROUP, ORT_WORKSHARE, gimplify_omp_ctx::outer_context, gimplify_omp_ctx::region_type, splay_tree_node< T >::value(), and gimplify_omp_ctx::variables.
Referenced by gimplify_scan_omp_clauses(), and omp_lastprivate_for_combined_outer_constructs().
int omp_construct_selector_matches | ( | enum tree_code * | constructs, |
int | nconstructs, | ||
int * | scores ) |
Return 0 if CONSTRUCTS selectors don't match the OpenMP context, -1 if unknown yet (simd is involved, won't be known until vectorization) and 1 if they do. If SCORES is non-NULL, it should point to an array of at least 2*NCONSTRUCTS+2 ints, and will be filled with the positions of the CONSTRUCTS (position -1 if it will never match) followed by number of constructs in the OpenMP context construct trait. If the score depends on whether it will be in a declare simd clone or not, the function returns 2 and there will be two sets of the scores, the first one for the case that it is not in a declare simd clone, the other that it is in a declare simd clone.
References alloca, gimplify_omp_ctx::code, current_function_decl, DECL_ATTRIBUTES, gcc_assert, gimplify_omp_ctxp, i, list_length(), lookup_attribute(), NULL, OMP_CLAUSE_BIND, omp_construct_traits_to_codes(), omp_find_clause(), omp_has_nocontext(), ORT_ACC, ORT_COMBINED_PARALLEL, ORT_IMPLICIT_TARGET, ORT_PARALLEL, ORT_SIMD, ORT_TARGET, ORT_TEAMS, ORT_WORKSHARE, and TREE_VALUE.
Referenced by omp_context_compute_score(), omp_context_selector_matches(), and omp_maybe_offloaded().
Find the immediately-containing struct for a component ref (etc.) expression EXPR.
References expr, STRIP_NOPS, TREE_CODE, and TREE_OPERAND.
Referenced by omp_mapped_by_containing_struct().
|
static |
Determine outer default flags for DECL mentioned in an OMP region but not declared in an enclosing clause. ??? Some compiler-generated variables (like SAVE_EXPRs) could be remapped firstprivate instead of shared. To some extent this is addressed in omp_firstprivatize_type_sizes, but not effectively.
References gimplify_omp_ctx::clauses, current_function_decl, DECL_CONTEXT, DECL_FILE_SCOPE_P, DECL_IN_CONSTANT_POOL, DECL_NAME, lang_hooks::decls, gimplify_omp_ctx::default_kind, error(), gcc_assert, gcc_unreachable, GOVD_DATA_SHARE_CLASS, GOVD_FIRSTPRIVATE, GOVD_PRIVATE, GOVD_SHARED, inform(), is_global_var(), lang_GNU_Fortran(), gimplify_omp_ctx::location, NULL, OMP_CLAUSE_DECL, OMP_CLAUSE_DEFAULT_FIRSTPRIVATE, OMP_CLAUSE_DEFAULT_NONE, OMP_CLAUSE_DEFAULT_PRIVATE, OMP_CLAUSE_DEFAULT_SHARED, OMP_CLAUSE_DEFAULT_UNSPECIFIED, OMP_CLAUSE_DETACH, omp_find_clause(), omp_notice_variable(), lang_hooks_for_decls::omp_predetermined_sharing, lang_hooks_for_decls::omp_report_decl, ORT_PARALLEL, ORT_TARGET, ORT_TARGET_DATA, ORT_TASK, ORT_TASKLOOP, ORT_TEAMS, gimplify_omp_ctx::outer_context, gimplify_omp_ctx::region_type, TREE_CODE, TREE_STATIC, splay_tree_node< T >::value(), and VAR_P.
Referenced by omp_notice_variable().
|
static |
Return TRUE if the directive (whose clauses are described by the hash table of mapping groups, GRPMAP) maps DECL explicitly. If TO_SPECIFICALLY is true, only count TO mappings. If ALLOW_DELETED is true, ignore the "deleted" flag for groups. If CONTAINED_IN_STRUCT is true, also return TRUE if DECL is mapped as a member of a whole-struct mapping.
References omp_mapping_group::grp_start, NULL, OMP_CLAUSE_CHAIN, OMP_CLAUSE_MAP_KIND, omp_get_nonfirstprivate_group(), and omp_mapped_by_containing_struct().
Referenced by omp_accumulate_sibling_list(), and omp_resolve_clause_dependencies().
Helper callback for walk_gimple_seq to discover possible stores to omp_shared_to_firstprivate_optimizable_decl_p decls and set GOVD_WRITTEN if they are GOVD_SHARED in some outer context for those.
References DECL_P, gimplify_omp_ctxp, handled_component_p(), NULL_TREE, omp_mark_stores(), omp_shared_to_firstprivate_optimizable_decl_p(), TREE_CODE, and TREE_OPERAND.
Referenced by gimplify_adjust_omp_clauses(), and omp_find_stores_stmt().
|
static |
Helper callback for walk_gimple_seq to discover possible stores to omp_shared_to_firstprivate_optimizable_decl_p decls and set GOVD_WRITTEN if they are GOVD_SHARED in some outer context for those.
References gimple_omp_for_pre_body(), gsi_stmt(), NULL_TREE, omp_find_stores_op(), omp_find_stores_stmt(), walk_stmt_info::stmt, and walk_gimple_seq().
Referenced by gimplify_adjust_omp_clauses(), and omp_find_stores_stmt().
|
static |
References gcc_assert.
Referenced by omp_accumulate_sibling_list(), and omp_build_struct_sibling_lists().
|
static |
Similarly for each of the type sizes of TYPE.
References hash_set< KeyId, Lazy, Traits >::add(), DECL_CHAIN, DECL_FIELD_OFFSET, error_mark_node, NULL, lang_hooks_for_types::omp_firstprivatize_type_sizes, omp_firstprivatize_type_sizes(), omp_firstprivatize_variable(), gimplify_omp_ctx::privatized_types, TREE_CODE, TREE_TYPE, TYPE_DOMAIN, TYPE_FIELDS, TYPE_MAIN_VARIANT, TYPE_MAX_VALUE, TYPE_MIN_VALUE, TYPE_SIZE, TYPE_SIZE_UNIT, and lang_hooks::types.
Referenced by omp_add_variable(), and omp_firstprivatize_type_sizes().
void omp_firstprivatize_variable | ( | struct gimplify_omp_ctx * | ctx, |
tree | decl ) |
Add FIRSTPRIVATE entries for DECL in the OpenMP the surrounding parallels to CTX. If entries already exist, force them to be some flavor of private. If there is no enclosing parallel, do nothing.
References DECL_P, gimplify_omp_ctx::defaultmap, GDMK_SCALAR, GOVD_FIRSTPRIVATE, GOVD_MAP, GOVD_MAP_TO_ONLY, GOVD_SEEN, GOVD_SHARED, NULL, omp_add_variable(), ORT_ACC, ORT_NONE, ORT_SIMD, ORT_TARGET, ORT_TARGET_DATA, ORT_TASKGROUP, ORT_WORKSHARE, gimplify_omp_ctx::outer_context, gimplify_omp_ctx::region_type, splay_tree_node< T >::value(), and gimplify_omp_ctx::variables.
Referenced by gimplify_scan_omp_clauses(), omp_add_variable(), and omp_firstprivatize_type_sizes().
|
static |
References NULL, NULL_TREE, and omp_gather_mapping_groups_1().
Referenced by gimplify_adjust_omp_clauses(), and gimplify_scan_omp_clauses().
|
static |
Walk through LIST_P, and return a list of groups of mappings found (e.g. OMP_CLAUSE_MAP with GOMP_MAP_{TO/FROM/TOFROM} followed by one or two associated GOMP_MAP_POINTER mappings). Return a vector of omp_mapping_group if we have more than one such group, else return NULL.
References omp_mapping_group::deleted, omp_mapping_group::fragile, omp_mapping_group::grp_end, omp_mapping_group::grp_start, omp_mapping_group::mark, omp_mapping_group::next, NULL, OMP_CLAUSE_CHAIN, OMP_CLAUSE_CODE, OMP_CLAUSE_MAP, omp_group_last(), omp_mapping_group::reprocess_struct, omp_mapping_group::sibling, and UNVISITED.
Referenced by omp_gather_mapping_groups(), and omp_reindex_mapping_groups().
|
static |
An attach or detach operation depends directly on the address being attached/detached. Return that address, or none if there are no attachments/detachments.
References error_mark_node, gcc_assert, omp_mapping_group::grp_end, omp_mapping_group::grp_start, internal_error(), NULL_TREE, OMP_CLAUSE_CHAIN, OMP_CLAUSE_DECL, OMP_CLAUSE_MAP_KIND, and omp_map_clause_descriptor_p().
Referenced by omp_tsort_mapping_groups_1().
Return the OpenMP "base pointer" of an expression EXPR, or NULL if there isn't one.
References expr, INDIRECT_REF_P, integer_zerop(), NULL_TREE, STRIP_NOPS, TREE_CODE, and TREE_OPERAND.
Referenced by omp_resolve_clause_dependencies(), and omp_tsort_mapping_groups_1().
|
static |
We might have indexed several groups for DECL, e.g. a "TO" mapping and also a "FIRSTPRIVATE" mapping. Return the one that isn't firstprivate, etc.
References omp_mapping_group::deleted, omp_mapping_group::grp_end, NULL, OMP_CLAUSE_MAP_KIND, and omp_mapping_group::sibling.
Referenced by omp_accumulate_sibling_list(), omp_directive_maps_explicitly(), and omp_resolve_clause_dependencies().
|
static |
A pointer mapping group GRP may define a block of memory starting at some base address, and maybe also define a firstprivate pointer or firstprivate reference that points to that block. The return value is a node containing the former, and the *FIRSTPRIVATE pointer is set if we have the latter. If we define several base pointers, i.e. for a GOMP_MAP_STRUCT mapping, return the number of consecutive chained nodes in CHAINED.
References error_mark_node, gcc_assert, gcc_unreachable, omp_mapping_group::grp_end, omp_mapping_group::grp_start, internal_error(), NULL_TREE, OMP_CLAUSE_CHAIN, OMP_CLAUSE_DECL, OMP_CLAUSE_MAP_KIND, OMP_CLAUSE_SIZE, omp_map_clause_descriptor_p(), seen_error(), and tree_to_uhwi().
Referenced by omp_index_mapping_groups_1().
Given a pointer START_P to the start of a group of related (e.g. pointer) mappings, return the chain pointer to the end of that group in the list.
References gcc_assert, i, OMP_CLAUSE_CHAIN, OMP_CLAUSE_CODE, OMP_CLAUSE_MAP, OMP_CLAUSE_MAP_KIND, OMP_CLAUSE_SIZE, omp_map_clause_descriptor_p(), and tree_to_uhwi().
Referenced by gimplify_adjust_omp_clauses(), and omp_gather_mapping_groups_1().
|
static |
Try to evaluate a nocontext clause. Return 1 if true, 0 if false or absent, * -1 if run-time evaluation is needed.
References gimplify_omp_ctx::clauses, gimplify_omp_ctx::code, gimplify_omp_ctxp, integer_nonzerop(), integer_zerop(), NULL, NULL_TREE, OMP_CLAUSE_NOCONTEXT, OMP_CLAUSE_NOCONTEXT_EXPR, and omp_find_clause().
Referenced by gimplify_omp_dispatch(), and omp_construct_selector_matches().
int omp_has_novariants | ( | void | ) |
Try to evaluate a novariants clause. Return 1 if true, 0 if false or absent, * -1 if run-time evaluation is needed.
References gimplify_omp_ctx::clauses, gimplify_omp_ctx::code, gimplify_omp_ctxp, gimplify_omp_ctx::in_call_args, integer_nonzerop(), integer_zerop(), NULL, NULL_TREE, OMP_CLAUSE_NOVARIANTS, OMP_CLAUSE_NOVARIANTS_EXPR, and omp_find_clause().
Referenced by gimplify_omp_dispatch(), and omp_resolve_declare_variant().
|
static |
References NULL_TREE, and omp_index_mapping_groups_1().
Referenced by gimplify_adjust_omp_clauses(), and gimplify_scan_omp_clauses().
|
static |
Given a vector of omp_mapping_groups, build a hash table so we can look up nodes by tree_operand_hash_no_se.
References build_fold_indirect_ref, error_mark_node, FOR_EACH_VEC_ELT, omp_mapping_group::grp_start, i, integer_zerop(), NULL_TREE, OMP_CLAUSE_CHAIN, OMP_CLAUSE_DECL, omp_group_base(), omp_mapping_group::reprocess_struct, omp_mapping_group::sibling, TREE_CODE, and TREE_OPERAND.
Referenced by omp_index_mapping_groups(), and omp_reindex_mapping_groups().
|
static |
Verify that DECL is private within CTX. If there's specific information to the contrary in the innermost scope, generate an error.
References DECL_NAME, error(), gimplify_omp_ctxp, GOVD_EXPLICIT, GOVD_FIRSTPRIVATE, GOVD_LINEAR, GOVD_PRIVATE, GOVD_REDUCTION, GOVD_SHARED, NULL, omp_is_private(), ORT_ACC, ORT_COMBINED_PARALLEL, ORT_SIMD, ORT_TASKGROUP, ORT_WORKSHARE, gimplify_omp_ctx::outer_context, gimplify_omp_ctx::region_type, splay_tree_node< T >::value(), and gimplify_omp_ctx::variables.
Referenced by gimplify_omp_for(), and omp_is_private().
|
static |
DECL is supposed to have lastprivate semantics in the outer contexts of combined/composite constructs, starting with OCTX. Add needed lastprivate, shared or map clause if no data sharing or mapping clause are present. IMPLICIT_P is true if it is an implicit clause (IV on simd), in which case the lastprivate will not be copied to some constructs.
References gimplify_omp_ctx::combined_loop, GOVD_EXPLICIT, GOVD_FIRSTPRIVATE, GOVD_FIRSTPRIVATE_IMPLICIT, GOVD_LASTPRIVATE, GOVD_MAP, GOVD_SEEN, GOVD_SHARED, NULL, omp_add_variable(), omp_check_private(), omp_notice_variable(), ORT_ACC, ORT_COMBINED_PARALLEL, ORT_COMBINED_TARGET, ORT_COMBINED_TEAMS, ORT_TASK, ORT_WORKSHARE, gimplify_omp_ctx::outer_context, gimplify_omp_ctx::region_type, splay_tree_node< T >::value(), and gimplify_omp_ctx::variables.
Referenced by gimplify_omp_for(), and gimplify_scan_omp_clauses().
True if mapping node C maps, or unmaps, a (Fortran) array descriptor.
References OMP_CLAUSE_CODE, OMP_CLAUSE_MAP, OMP_CLAUSE_MAP_KIND, and OMP_CLAUSE_RELEASE_DESCRIPTOR.
Referenced by build_omp_struct_comp_nodes(), gimplify_scan_omp_clauses(), omp_accumulate_sibling_list(), omp_build_struct_sibling_lists(), omp_get_attachment(), omp_group_base(), omp_group_last(), and omp_resolve_clause_dependencies().
|
static |
Return TRUE if DECL describes a component that is part of a whole structure that is mapped elsewhere in GRPMAP. *MAPPED_BY_GROUP is set to the group that maps that structure, if present.
References build_fold_indirect_ref, integer_zerop(), NULL, NULL_TREE, omp_containing_struct(), TREE_CODE, and TREE_OPERAND.
Referenced by gimplify_scan_omp_clauses(), oacc_resolve_clause_dependencies(), omp_build_struct_sibling_lists(), omp_directive_maps_explicitly(), omp_resolve_clause_dependencies(), and omp_tsort_mapping_groups_1().
|
static |
Helper function of omp_find_stores_op and gimplify_adjust_omp_clauses*. For omp_shared_to_firstprivate_optimizable_decl_p decl mark it as GOVD_WRITTEN in outer contexts.
References GOVD_DATA_SHARE_CLASS, GOVD_SHARED, GOVD_WRITTEN, NULL, gimplify_omp_ctx::outer_context, splay_tree_node< T >::value(), and gimplify_omp_ctx::variables.
Referenced by gimplify_adjust_omp_clauses(), gimplify_adjust_omp_clauses_1(), and omp_find_stores_op().
|
static |
Notice a threadprivate variable DECL used in OMP context CTX. This just prints out diagnostics about threadprivate variable uses in untied tasks. If DECL2 is non-NULL, prevent this warning on that variable.
References DECL_NAME, error(), inform(), gimplify_omp_ctx::location, NULL, gimplify_omp_ctx::order_concurrent, ORT_TARGET, ORT_UNTIED_TASK, gimplify_omp_ctx::outer_context, gimplify_omp_ctx::region_type, and gimplify_omp_ctx::variables.
Referenced by omp_notice_variable().
|
static |
Record the fact that DECL was used within the OMP context CTX. IN_CODE is true when real code uses DECL, and false when we should merely emit default(none) errors. Return true if DECL is going to be remapped and thus DECL shouldn't be gimplified into its DECL_VALUE_EXPR (if any).
References current_function_decl, DECL_ARTIFICIAL, DECL_ATTRIBUTES, DECL_HAS_VALUE_EXPR_P, DECL_NAME, DECL_P, DECL_SIZE, DECL_SOURCE_LOCATION, DECL_THREAD_LOCAL_P, DECL_VALUE_EXPR, lang_hooks::decls, gimplify_omp_ctx::defaultmap, error(), error_at(), error_operand_p(), gcc_assert, gcc_unreachable, GDMK_AGGREGATE, GDMK_ALLOCATABLE, GDMK_POINTER, GDMK_SCALAR, GDMK_SCALAR_TARGET, get_base_address(), varpool_node::get_create(), gimplify_omp_ctxp, GOVD_DATA_SHARE_CLASS, GOVD_EXPLICIT, GOVD_FIRSTPRIVATE, GOVD_LASTPRIVATE, GOVD_LINEAR, GOVD_LINEAR_LASTPRIVATE_NO_OUTER, GOVD_LOCAL, GOVD_MAP, GOVD_MAP_0LEN_ARRAY, GOVD_MAP_ALLOC_ONLY, GOVD_MAP_FORCE_PRESENT, GOVD_MAP_FROM_ONLY, GOVD_MAP_TO_ONLY, GOVD_PRIVATE, GOVD_PRIVATE_OUTER_REF, GOVD_SEEN, GOVD_SHARED, gimplify_omp_ctx::in_for_exprs, INDIRECT_REF_P, inform(), is_global_var(), gimplify_omp_ctx::location, lookup_attribute(), NULL, NULL_TREE, oacc_default_clause(), oacc_get_fn_attrib(), omp_add_variable(), lang_hooks_for_decls::omp_allocatable_p, OMP_CLAUSE_DEFAULTMAP_CATEGORY_UNSPECIFIED, OMP_CLAUSE_DEFAULTMAP_FIRSTPRIVATE, OMP_CLAUSE_DEFAULTMAP_TO, omp_default_clause(), lang_hooks_for_decls::omp_disregard_value_expr, omp_mappable_type(), omp_notice_threadprivate_variable(), omp_notice_variable(), lang_hooks_for_decls::omp_predetermined_mapping, lang_hooks_for_decls::omp_private_outer_ref, omp_privatize_by_reference(), lang_hooks_for_decls::omp_report_decl, lang_hooks_for_decls::omp_scalar_p, lang_hooks_for_decls::omp_scalar_target_p, ORT_ACC, ORT_ACC_DATA, ORT_ACC_HOST_DATA, ORT_NONE, ORT_SIMD, ORT_TARGET, ORT_TARGET_DATA, ORT_TASKGROUP, ORT_WORKSHARE, gimplify_omp_ctx::outer_context, gimplify_omp_ctx::region_type, gimplify_omp_ctx::target_firstprivatize_array_bases, TREE_CODE, TREE_OPERAND, TREE_TYPE, TREE_VALUE, TYPE_SIZE_UNIT, splay_tree_node< T >::value(), VAR_P, and gimplify_omp_ctx::variables.
Referenced by gimplify_adjust_omp_clauses(), gimplify_adjust_omp_clauses_1(), gimplify_expr(), gimplify_omp_for(), gimplify_scan_omp_clauses(), gimplify_var_or_parm_decl(), omp_add_variable(), omp_default_clause(), omp_lastprivate_for_combined_outer_constructs(), and omp_notice_variable().
|
static |
Rebuild group map from partially-processed clause list (during omp_build_struct_sibling_lists). We have already processed nodes up until a high-water mark (HWM). This is a bit tricky because the list is being reordered as it is scanned, but we know: 1. The list after HWM has not been touched yet, so we can reindex it safely. 2. The list before and including HWM has been altered, but remains well-formed throughout the sibling-list building operation. so, we can do the reindex operation in two parts, on the processed and then the unprocessed halves of the list.
References NULL_TREE, omp_gather_mapping_groups_1(), and omp_index_mapping_groups_1().
Referenced by omp_build_struct_sibling_lists().
|
static |
Given a list LIST_P containing groups of mappings given by GROUPS, reorder those groups based on the output list of omp_tsort_mapping_groups -- singly-linked, threaded through each element's NEXT pointer starting at HEAD. Each list element appears exactly once in that linked list. Each element of GROUPS may correspond to one or several mapping nodes. Node groups are kept together, and in the reordered list, the positions of the original groups are reused for the positions of the reordered list. Hence if we have e.g. {to ptr ptr} firstprivate {tofrom ptr} ... ^ ^ ^ first group non-"map" second group and say the second group contains a base pointer for the first so must be moved before it, the resulting list will contain: {tofrom ptr} firstprivate {to ptr ptr} ... ^ prev. second group ^ prev. first group
References FOR_EACH_VEC_ELT, gcc_assert, omp_mapping_group::grp_end, omp_mapping_group::grp_start, i, NULL, and OMP_CLAUSE_CHAIN.
Referenced by gimplify_adjust_omp_clauses().
void omp_resolve_clause_dependencies | ( | enum tree_code | code, |
vec< omp_mapping_group > * | groups, | ||
hash_map< tree_operand_hash_no_se, omp_mapping_group * > * | grpmap ) |
This function handles several cases where clauses on a mapping directive can interact with each other. If we have a FIRSTPRIVATE_POINTER node and we're also mapping the pointer on the same directive, change the mapping of the first node to ATTACH_DETACH. We should have detected that this will happen already in c-omp.cc:c_omp_adjust_map_clauses and marked the appropriate decl as addressable. (If we didn't, bail out.) If we have a FIRSTPRIVATE_REFERENCE (for a reference to pointer) and we're mapping the base pointer also, we may need to change the mapping type to ATTACH_DETACH and synthesize an alloc node for the reference itself. If we have an ATTACH_DETACH node, this is an array section with a pointer base. If we're mapping the base on the same directive too, we can drop its mapping. However, if we have a reference to pointer, make other appropriate adjustments to the mapping nodes instead. If we have an ATTACH_DETACH node with a Fortran pointer-set (array descriptor) mapping for a derived-type component, and we're also mapping the whole of the derived-type variable on another clause, the pointer-set mapping is removed. If we have a component access but we're also mapping the whole of the containing struct, drop the former access. If the expression is a component access, and we're also mapping a base pointer used in that component access in the same expression, change the mapping type of the latter to ALLOC (ready for processing by omp_build_struct_sibling_lists).
References build2(), build_fold_addr_expr, build_fold_indirect_ref, build_int_cst(), build_omp_clause(), build_pointer_type(), char_type_node, gimplify_omp_ctx::code, DECL_P, omp_mapping_group::deleted, FOR_EACH_VEC_ELT, gcc_assert, omp_mapping_group::grp_end, omp_mapping_group::grp_start, i, NULL, NULL_TREE, omp_check_mapping_compatibility(), OMP_CLAUSE_ATTACHMENT_MAPPING_ERASED, OMP_CLAUSE_CHAIN, OMP_CLAUSE_CODE, OMP_CLAUSE_DECL, OMP_CLAUSE_LOCATION, OMP_CLAUSE_MAP, OMP_CLAUSE_MAP_KIND, OMP_CLAUSE_MAP_MAYBE_ZERO_LENGTH_ARRAY_SECTION, OMP_CLAUSE_SET_MAP_KIND, OMP_CLAUSE_SIZE, omp_directive_maps_explicitly(), omp_get_base_pointer(), omp_get_nonfirstprivate_group(), omp_map_clause_descriptor_p(), omp_mapped_by_containing_struct(), TREE_ADDRESSABLE, TREE_CODE, TREE_OPERAND, TREE_TYPE, and TYPE_SIZE_UNIT.
Referenced by gimplify_adjust_omp_clauses().
|
static |
Split INLIST into three parts: - "present" alloc/to/from groups - other to/from groups - other alloc/release/delete groups These sub-lists are then concatenated together to form the final list. Each sub-list retains the order of the original list. Note that ATTACH nodes are later moved to the end of the list in gimplify_adjust_omp_clauses, for target regions.
References gcc_assert, omp_mapping_group::next, NULL, OMP_CLAUSE_CODE, OMP_CLAUSE_MAP, and OMP_CLAUSE_MAP_KIND.
Referenced by gimplify_adjust_omp_clauses().
Return true if DECL is a candidate for shared to firstprivate optimization. We only consider non-addressable scalars, not too big, and not references.
References int_size_in_bytes(), is_gimple_reg_type(), omp_privatize_by_reference(), POINTER_SIZE, TREE_ADDRESSABLE, TREE_CODE, and TREE_TYPE.
Referenced by gimplify_adjust_omp_clauses(), gimplify_adjust_omp_clauses_1(), and omp_find_stores_op().
Link node NEWNODE so it is pointed to by chain INSERT_AT. NEWNODE's chain is linked to the previous node pointed to by INSERT_AT.
References OMP_CLAUSE_CHAIN.
Referenced by omp_accumulate_sibling_list().
|
static |
Concatenate two lists described by [FIRST_NEW, LAST_NEW_TAIL] and [FIRST_PTR, LAST_NODE], and insert them in the OMP clause list after chain pointer MOVE_AFTER. The latter list was previously part of the OMP clause list, and the former (prepended) part is comprised of new nodes. We start with a list of nodes starting with a struct mapping node. We rearrange the list so that new nodes starting from FIRST_NEW and whose last node's chain is LAST_NEW_TAIL comes directly after MOVE_AFTER, followed by the group of mapping nodes we are currently processing (from the chain FIRST_PTR to LAST_NODE). The return value is the pointer to the next chain we should continue processing from, or NULL to stay where we were. The transformation (in the case where MOVE_AFTER and FIRST_PTR are different) is worked through below. Here we are processing LAST_NODE, and FIRST_PTR points at the preceding mapping clause: #. mapping node chain --------------------------------------------------- A. struct_node [->B] B. comp_1 [->C] C. comp_2 [->D (move_after)] D. map_to_3 [->E] E. attach_3 [->F (first_ptr)] F. map_to_4 [->G (continue_at)] G. attach_4 (last_node) [->H] H. ... *last_new_tail = *first_ptr; I. new_node (first_new) [->F (last_new_tail)] *first_ptr = OMP_CLAUSE_CHAIN (last_node) #. mapping node chain ---------------------------------------------------- A. struct_node [->B] B. comp_1 [->C] C. comp_2 [->D (move_after)] D. map_to_3 [->E] E. attach_3 [->H (first_ptr)] F. map_to_4 [->G (continue_at)] G. attach_4 (last_node) [->H] H. ... I. new_node (first_new) [->F (last_new_tail)] OMP_CLAUSE_CHAIN (last_node) = *move_after; #. mapping node chain --------------------------------------------------- A. struct_node [->B] B. comp_1 [->C] C. comp_2 [->D (move_after)] D. map_to_3 [->E] E. attach_3 [->H (continue_at)] F. map_to_4 [->G] G. attach_4 (last_node) [->D] H. ... I. new_node (first_new) [->F (last_new_tail)] *move_after = first_new; #. mapping node chain --------------------------------------------------- A. struct_node [->B] B. comp_1 [->C] C. comp_2 [->I (move_after)] D. map_to_3 [->E] E. attach_3 [->H (continue_at)] F. map_to_4 [->G] G. attach_4 (last_node) [->D] H. ... I. new_node (first_new) [->F (last_new_tail)] or, in order: #. mapping node chain --------------------------------------------------- A. struct_node [->B] B. comp_1 [->C] C. comp_2 [->I (move_after)] I. new_node (first_new) [->F (last_new_tail)] F. map_to_4 [->G] G. attach_4 (last_node) [->D] D. map_to_3 [->E] E. attach_3 [->H (continue_at)] H. ...
References NULL, and OMP_CLAUSE_CHAIN.
Referenced by omp_accumulate_sibling_list().
Move NODE (which is currently pointed to by the chain OLD_POS) so it is pointed to by chain MOVE_AFTER instead.
References gcc_assert, and OMP_CLAUSE_CHAIN.
Referenced by omp_accumulate_sibling_list().
|
static |
Move nodes from FIRST_PTR (pointed to by previous node's chain) to LAST_NODE to after MOVE_AFTER chain. Similar to below function, but no new nodes are prepended to the list before splicing into the new position. Return the position we should continue scanning the list at, or NULL to stay where we were.
References NULL, and OMP_CLAUSE_CHAIN.
Referenced by omp_accumulate_sibling_list().
|
static |
Topologically sort GROUPS, so that OMP 5.0-defined base pointers come before mappings that use those pointers. This is an implementation of the depth-first search algorithm, described e.g. at: https://en.wikipedia.org/wiki/Topological_sorting
References FOR_EACH_VEC_ELT, omp_mapping_group::grp_start, i, omp_mapping_group::mark, NULL, OMP_CLAUSE_MAP_RUNTIME_IMPLICIT_P, omp_tsort_mapping_groups_1(), and PERMANENT.
Referenced by gimplify_adjust_omp_clauses().
|
static |
Helper function for omp_tsort_mapping_groups. Returns TRUE on success, or FALSE on error.
References debug_mapping_group(), omp_mapping_group::grp_start, internal_error(), omp_mapping_group::mark, omp_mapping_group::next, OMP_CLAUSE_DECL, omp_get_attachment(), omp_get_base_pointer(), omp_mapped_by_containing_struct(), omp_tsort_mapping_groups_1(), PERMANENT, omp_mapping_group::sibling, TEMPORARY, and TREE_CODE.
Referenced by omp_tsort_mapping_groups(), and omp_tsort_mapping_groups_1().
Optimize embedded COMPOUND_LITERAL_EXPRs within a CONSTRUCTOR, return a new CONSTRUCTOR if something changed.
References COMPOUND_LITERAL_EXPR_DECL_EXPR, CONSTRUCTOR_ELTS, copy_node(), DECL_EXPR_DECL, DECL_INITIAL, optimize_compound_literals_in_ctor(), TREE_ADDRESSABLE, TREE_CODE, vec_safe_copy(), and vec_safe_length().
Referenced by gimplify_init_constructor(), and optimize_compound_literals_in_ctor().
|
static |
Try to determine if the num_teams and/or thread_limit expressions can have their values determined already before entering the target construct. INTEGER_CSTs trivially are, integral decls that are firstprivate (explicitly or implicitly) or explicitly map(always, to:) or map(always, tofrom:) on the target region too, and expressions involving simple arithmetics on those too, function calls are not ok, dereferencing something neither etc. Add NUM_TEAMS and THREAD_LIMIT clauses to the OMP_CLAUSES of EXPR based on what we find: 0 stands for clause not specified at all, use implementation default -1 stands for value that can't be determined easily before entering the target construct. -2 means that no explicit teams construct was specified If teams construct is not present at all, use 1 for num_teams and 0 for thread_limit (only one team is involved, and the thread limit is implementation defined.
References build_int_cst(), build_omp_clause(), computable_teams_clause(), DECL_P, expr, EXPR_LOCATION, fb_rvalue, find_omp_teams(), gimplify_expr(), gimplify_omp_ctxp, GS_ERROR, integer_minus_one_node, integer_type_node, integer_zero_node, is_gimple_val(), NULL, NULL_TREE, OMP_BODY, OMP_CLAUSE_CHAIN, OMP_CLAUSE_CODE, OMP_CLAUSE_LOCATION, OMP_CLAUSE_NUM_TEAMS, OMP_CLAUSE_NUM_TEAMS_LOWER_EXPR, OMP_CLAUSE_NUM_TEAMS_UPPER_EXPR, OMP_CLAUSE_OPERAND, OMP_CLAUSE_THREAD_LIMIT, OMP_CLAUSE_THREAD_LIMIT_EXPR, omp_find_clause(), OMP_TARGET_CLAUSES, OMP_TEAMS_CLAUSES, gimplify_omp_ctx::outer_context, TREE_CODE, and walk_tree.
Referenced by gimplify_omp_workshare().
void pop_gimplify_context | ( | gimple * | body | ) |
Tear down a context for the gimplifier. If BODY is non-null, then put the temporaries into the outer BIND_EXPR. Otherwise, put them in the local_decls. BODY is not a sequence, but the first tuple in a sequence.
References gimplify_ctx::bind_expr_stack, ctx_free(), declare_vars(), gcc_assert, gimplify_ctxp, NULL, gimplify_ctx::prev_context, record_vars(), gimplify_ctx::temp_htab, and gimplify_ctx::temps.
Referenced by create_task_copyfn(), execute_lower_omp(), expand_ifn_va_arg_1(), force_gimple_operand_1(), gimple_regimplify_operands(), gimplify_and_update_call_from_tree(), gimplify_body(), gimplify_call_expr(), gimplify_omp_dispatch(), gimplify_omp_for(), gimplify_omp_parallel(), gimplify_omp_task(), gimplify_omp_workshare(), gimplify_scan_omp_clauses(), gimplify_transaction(), lower_omp_critical(), lower_omp_dispatch(), lower_omp_for(), lower_omp_master(), lower_omp_ordered(), lower_omp_scope(), lower_omp_sections(), lower_omp_single(), lower_omp_target(), lower_omp_taskgroup(), lower_omp_taskreg(), lower_omp_teams(), oacc_xform_loop(), oacc_xform_tile(), optimize_inline_calls(), and simd_clone_adjust().
|
static |
Prepare the node pointed to by EXPR_P, an is_gimple_addressable expression, to be marked addressable. We cannot rely on such an expression being directly markable if a temporary has been created by the gimplification. In this case, we create another temporary and initialize it with a copy, which will become a store after we mark it addressable. This can happen if the front-end passed us something that it could not mark addressable yet, like a Fortran pass-by-reference parameter (int) floatvar.
References handled_component_p(), internal_get_tmp_var(), is_gimple_reg(), NULL, and TREE_OPERAND.
Referenced by gimplify_addr_expr(), gimplify_asm_expr(), gimplify_compound_lval(), and gimplify_modify_expr_to_memcpy().
Worker for unshare_expr_without_location.
References EXPR_P, NULL_TREE, SET_EXPR_LOCATION, and UNKNOWN_LOCATION.
Referenced by unshare_expr_without_location().
Set up a context for the gimplifier.
References gimplify_ctx::allow_rhs_cond_expr, ctx_alloc(), gimplify_ctxp, gimplify_ctx::into_ssa, and gimplify_ctx::prev_context.
Referenced by create_task_copyfn(), execute_lower_omp(), expand_ifn_va_arg_1(), force_gimple_operand_1(), gimple_regimplify_operands(), gimplify_and_update_call_from_tree(), gimplify_body(), gimplify_call_expr(), gimplify_omp_dispatch(), gimplify_omp_for(), gimplify_omp_parallel(), gimplify_omp_task(), gimplify_omp_workshare(), gimplify_scan_omp_clauses(), gimplify_transaction(), lower_omp_critical(), lower_omp_dispatch(), lower_omp_for(), lower_omp_master(), lower_omp_ordered(), lower_omp_scope(), lower_omp_sections(), lower_omp_single(), lower_omp_target(), lower_omp_taskgroup(), lower_omp_taskreg(), lower_omp_teams(), oacc_xform_loop(), oacc_xform_tile(), optimize_inline_calls(), and simd_clone_adjust().
|
static |
Recalculate the value of the TREE_SIDE_EFFECTS flag for T.
References gcc_unreachable, i, tcc_binary, tcc_comparison, tcc_constant, tcc_expression, tcc_reference, tcc_unary, tcc_vl_exp, TREE_CODE, TREE_CODE_CLASS, TREE_OPERAND, TREE_OPERAND_LENGTH, TREE_SIDE_EFFECTS, and TREE_THIS_VOLATILE.
Referenced by gimplify_compound_lval(), gimplify_cond_expr(), gimplify_expr(), and gimplify_modify_expr_rhs().
|
static |
Reset the condition uid to the value it should have when compiling a new function. 0 is already the default/untouched value, so start at non-zero. A valid and set id should always be > 0. This is used for condition coverage.
References nextconduid.
Referenced by gimplify_function_tree().
Return TRUE iff EXPR (maybe recursively) has a location; see rexpr_location for the potential recursion.
References rexpr_location(), and UNKNOWN_LOCATION.
Referenced by gimplify_cond_expr(), and shortcut_cond_expr().
|
static |
Return the EXPR_LOCATION of EXPR, if it (maybe recursively) has one, OR_ELSE otherwise. The location of a STATEMENT_LISTs comprising at least one DEBUG_BEGIN_STMT followed by exactly one EXPR is the location of the EXPR.
References EXPR_HAS_LOCATION, EXPR_LOCATION, i, rexpr_location(), TREE_CODE, tsi_end_p(), tsi_next(), tsi_one_before_end_p(), tsi_start(), and tsi_stmt().
Referenced by gimplify_cond_expr(), rexpr_has_location(), rexpr_location(), shortcut_cond_expr(), and shortcut_cond_r().
gimple_predicate rhs_predicate_for | ( | tree | lhs | ) |
Return the appropriate RHS predicate for this LHS.
References is_gimple_mem_rhs_or_call(), is_gimple_reg(), and is_gimple_reg_rhs_or_call().
Referenced by gimple_regimplify_operands(), gimplify_init_constructor(), gimplify_modify_expr(), and gimplify_modify_expr_rhs().
Given a conditional expression EXPR with short-circuit boolean predicates using TRUTH_ANDIF_EXPR or TRUTH_ORIF_EXPR, break the predicate apart into the equivalent sequence of conditionals. CONDITION_UID is a the tag/discriminator for this EXPR - all basic conditions in the expression will be given the same CONDITION_UID.
References append_to_statement_list(), block_may_fallthru(), build1(), build3(), build_and_jump(), expr, expr_last(), EXPR_LOC_OR_LOC, find_goto_label(), GOTO_DESTINATION, input_location, LABEL_EXPR_LABEL, last, NULL, NULL_TREE, rexpr_has_location(), rexpr_location(), SET_EXPR_LOCATION, shortcut_cond_expr(), shortcut_cond_r(), tag_shortcut_cond(), tree_associate_condition_with_expr(), TREE_CODE, TREE_OPERAND, TREE_SIDE_EFFECTS, and void_type_node.
Referenced by gimplify_cond_expr(), and shortcut_cond_expr().
|
static |
Handle shortcut semantics in the predicate operand of a COND_EXPR by rewriting it into multiple COND_EXPRs, and possibly GOTO_EXPRs. TRUE_LABEL_P and FALSE_LABEL_P point to the labels to jump to if the condition is true or false, respectively. If null, we should generate our own to skip over the evaluation of this specific expression. LOCUS is the source location of the COND_EXPR. The condition_uid is a discriminator tag for condition coverage used to map conditions to its corresponding full Boolean function. This function is the tree equivalent of do_jump. shortcut_cond_r should only be called by shortcut_cond_expr.
References append_to_statement_list(), build1(), build3(), build_and_jump(), expr, NULL, NULL_TREE, rexpr_location(), SET_EXPR_LOCATION, shortcut_cond_r(), tree_associate_condition_with_expr(), TREE_CODE, TREE_OPERAND, TREE_TYPE, void_type_node, and VOID_TYPE_P.
Referenced by shortcut_cond_expr(), and shortcut_cond_r().
|
static |
Return true if the switch fallthough warning should occur. LABEL is the label statement that we're falling through to.
References as_a(), case_label_p(), gimplify_ctx::case_labels, FALLTHROUGH_LABEL_P, gimple_label_label(), gimplify_ctxp, gsi_end_p(), gsi_next_nondebug(), gsi_stmt(), and label_entry::label.
Referenced by warn_implicit_fallthrough_r().
|
static |
Sort pair of VAR_DECLs A and B by DECL_UID.
References a, b, and DECL_UID.
Referenced by asan_poison_variables().
|
static |
A stable comparison routine for use with splay trees and DECLs.
References a, b, and DECL_UID.
Referenced by new_omp_context().
|
static |
Given a multi-term condition (ANDIF, ORIF), walk the predicate PRED and tag every basic condition with CONDITION_UID. Two basic conditions share the CONDITION_UID discriminator when they belong to the same predicate, which is used by the condition coverage. Doing this as an explicit step makes for a simpler implementation than weaving it into the splitting code as the splitting code eventually calls the entry point gimplfiy_expr which makes bookkeeping complicated.
References tag_shortcut_cond(), tree_associate_condition_with_expr(), TREE_CODE, and TREE_OPERAND.
Referenced by shortcut_cond_expr(), and tag_shortcut_cond().
|
static |
Associate the condition STMT with the discriminator UID. STMTs that are broken down with ANDIF/ORIF from the same Boolean expression should be given the same UID; 'if (a && b && c) { if (d || e) ... } ...' should yield the { a: 1, b: 1, c: 1, d: 2, e: 2 } when gimplification is done. This is used for condition coverage.
References cond_uids, and hash_map< KeyId, Value, Traits >::put().
Referenced by shortcut_cond_expr(), shortcut_cond_r(), and tag_shortcut_cond().
|
inlinestatic |
Unmark the visited trees rooted at *TP.
References NULL, unmark_visited_r(), and walk_tree.
Referenced by unvisit_body().
Callback for walk_tree to unmark the visited trees rooted at *TP. Subtrees are walked until the first unvisited node is encountered.
References NULL_TREE, and TREE_VISITED.
Referenced by unmark_visited().
|
static |
Unshare all the trees in the body of FNDECL, as well as in the bodies of any nested functions.
References copy_if_shared(), symtab_node::decl, DECL_RESULT, DECL_SAVED_TREE, DECL_SIZE, DECL_SIZE_UNIT, lang_hooks::deep_unsharing, first_nested_function(), cgraph_node::get(), next_nested_function(), NULL, unshare_body(), and visited.
Referenced by gimplify_body(), and unshare_body().
Unconditionally make an unshared copy of EXPR. This is used when using stored expressions which span multiple functions, such as BINFO_VTABLE, as the normal unsharing process can't tell that they're shared.
References expr, mostly_copy_tree_r(), NULL, and walk_tree.
Referenced by access_with_size_object_size(), add_iv_candidate_for_doloop(), add_parent_or_loop_num_clause(), adjust_before_returns_twice_call(), adjust_nested_loop_clauses(), analyze_ref(), build_check_stmt(), build_cltz_expr(), build_debug_ref_for_model(), build_omp_struct_comp_nodes(), build_outer_var_ref(), build_popcount_expr(), build_reconstructed_reference(), build_ref_for_offset(), loop_cand::classify_simple_reduction(), clear_padding_flush(), compute_doloop_base_on_mode(), cond_store_replacement(), convert_scalar_cond_reduction(), copy_tree_body_r(), create_mem_ref(), create_new_iv(), cse_and_gimplify_to_preheader(), determine_exit_conditions(), do_cond(), duplicate_insn_chain(), tree_switch_conversion::jump_table_cluster::emit(), execute_sm(), execute_sm_exit(), execute_sm_if_changed(), expand_complex_move(), expand_omp_atomic_mutex(), expand_omp_for_generic(), expand_omp_for_init_counts(), expand_omp_for_init_vars(), expand_omp_for_static_chunk(), expand_omp_for_static_nochunk(), expand_omp_ordered_sink(), expand_omp_simd(), extract_component(), extract_omp_for_update_vars(), final_value_replacement_loop(), find_interesting_uses_address(), finish_taskreg_remap(), finish_taskreg_scan(), fold_ctor_reference(), ccp_folder::fold_stmt(), fold_truth_andor_for_ifcombine(), forward_propagate_addr_expr_1(), forward_propagate_into_gimple_cond(), gather_mem_refs_stmt(), gen_counter_update(), gen_parallel_loop(), gen_phi_arg_condition(), gen_phi_nest_statement(), get_debug_computation_at(), get_string_length(), get_symbol_constant_value(), gimple_copy(), gimple_fold_stmt_to_constant_1(), gimple_gen_ic_profiler(), gimple_ic(), gimplify_adjust_omp_clauses_1(), gimplify_asm_expr(), gimplify_bind_expr(), gimplify_compound_lval(), gimplify_init_constructor(), gimplify_init_ctor_eval(), gimplify_init_ctor_eval_range(), gimplify_modify_expr(), gimplify_modify_expr_rhs(), gimplify_omp_depend(), gimplify_omp_for(), gimplify_omp_loop(), gimplify_one_sizepos(), gimplify_scan_omp_clauses(), gimplify_var_or_parm_decl(), gimplify_variable_sized_compare(), strlen_pass::handle_builtin_strcat(), strlen_pass::handle_builtin_strchr(), strlen_pass::handle_builtin_strcpy(), strlen_pass::handle_builtin_strlen(), increment_start_addr(), initialize_constant_pool_replacements(), insert_debug_temp_for_var_def(), insert_init_debug_bind(), insert_into_preds_of_block(), instrument_decisions(), instrument_expr(), tree_loop_interchange::interchange_loops(), internal_get_tmp_var(), ipa_simd_modify_function_body(), ipa_simd_modify_stmt_ops(), issue_prefetch_ref(), lower_bitfield(), lower_emutls_1(), lower_lastprivate_clauses(), lower_oacc_reductions(), lower_omp_for_lastprivate(), lower_omp_for_scan(), lower_omp_scan(), lower_omp_target(), lower_omp_task_reductions(), lower_rec_input_clauses(), lower_reduction_clauses(), lower_send_clauses(), lower_send_shared_vars(), make_bit_field_load(), make_region_loop_nest(), make_region_seq(), tree_loop_interchange::map_inductions_to_loop(), maybe_move_debug_stmts_to_successors(), maybe_with_size_expr(), ipa_param_adjustments::modify_call(), move_stmt_op(), omp_accumulate_sibling_list(), omp_mark_declare_variant(), omp_oacc_kernels_decompose_1(), optimize_range_tests_to_bit_test(), optimize_vector_load(), phiprop_insert_phi(), predicate_bbs(), predicate_scalar_phi(), predicate_statements(), pcom_worker::prepare_finalizers_chain(), prepare_target_mem_ref_lvalue(), propagate_tree_value(), record_equivalences_from_stmt(), record_reference(), ref_at_iteration(), remap_decl(), remap_gimple_stmt(), remap_ssa_name(), remove_dead_stmt(), remove_unused_ivs(), replace_block_vars_by_duplicates(), replace_exp(), replace_ref_with(), replace_with_mapped_expr(), rewrite_phi_with_iv(), rewrite_to_non_trapping_overflow(), rewrite_use_compare(), scan_omp_for(), set_mem_attributes_minus_bitpos(), simplify_permutation(), simplify_replace_tree(), split_function(), sra_modify_assign(), std_gimplify_va_arg_expr(), take_address_of(), tm_log_emit_restores(), tm_log_emit_saves(), transform_kernels_loop_clauses(), tree_unswitch_loop(), unshare_aff_combination(), unshare_and_remap(), unshare_and_remap_1(), update_range_test(), vect_analyze_data_refs(), vect_build_loop_niters(), vect_create_addr_base_for_vector_ref(), vect_create_nonlinear_iv_vec_step(), vect_get_loop_niters(), vect_get_strided_load_store_ops(), vect_is_simple_iv_evolution(), vect_loop_versioning(), vect_transform_loop(), vect_update_ivs_after_vectorizer(), vectorizable_induction(), vectorizable_load(), vectorizable_scan_store(), vectorizable_simd_clone_call(), vectorizable_store(), rt_bb_visited::visit(), and rt_bb_visited::vset().
Similar to unshare_expr but also prune all expression locations from EXPR.
References expr, EXPR_P, mostly_copy_tree_r(), NULL, prune_expr_location(), and walk_tree.
Referenced by add_condition(), build_agg_jump_func_from_list(), tree_switch_conversion::switch_conversion::build_constructors(), create_access_replacement(), ipa_set_jf_arith_pass_through(), ipa_set_jf_constant(), ipa_param_body_adjustments::prepare_debug_expressions(), and remap_gimple_stmt().
|
static |
Likewise, but mark all trees as not visited.
References symtab_node::decl, DECL_RESULT, DECL_SAVED_TREE, DECL_SIZE, DECL_SIZE_UNIT, first_nested_function(), cgraph_node::get(), next_nested_function(), unmark_visited(), and unvisit_body().
Referenced by gimplify_body(), and unvisit_body().
WRAPPER is a code such as BIND_EXPR or CLEANUP_POINT_EXPR which can both contain statements and have a value. Assign its value to a temporary and give it void_type_node. Return the temporary, or NULL_TREE if WRAPPER was already void.
References BIND_EXPR_BODY, build2(), create_tmp_var, gcc_assert, i, IS_EMPTY_STMT, NULL, NULL_TREE, TRANSACTION_EXPR_BODY, TREE_CODE, TREE_OPERAND, TREE_SIDE_EFFECTS, TREE_TYPE, tsi_end_p(), tsi_last(), tsi_stmt_ptr(), void_type_node, and VOID_TYPE_P.
Referenced by gimplify_bind_expr(), gimplify_cleanup_point_expr(), gimplify_modify_expr_rhs(), gimplify_statement_list(), and gimplify_transaction().
|
static |
Callback for walk_gimple_seq.
References as_a(), collect_fallthrough_labels(), FALLTHROUGH_LABEL_P, find_label_entry(), gimple_call_internal_p(), gimple_has_location(), gimple_label_label(), gimple_location(), gimple_stmt_may_fallthru(), gsi_end_p(), gsi_next_nondebug(), gsi_prev(), gsi_stmt(), inform(), integer_zero_node, label_entry::label, label_entry::loc, NULL, NULL_TREE, should_warn_for_implicit_fallthrough(), UNKNOWN_LOCATION, and warning_at().
Referenced by maybe_warn_implicit_fallthrough().
|
static |
Callback for walk_gimple_seq.
References AUTO_INIT_UNINITIALIZED, emit_warn_switch_unreachable(), gimple_call_arg(), gimple_call_internal_p(), gimple_location(), gimple_try_eval(), gsi_stmt(), integer_zero_node, NULL, NULL_TREE, TREE_OPERAND, TREE_STRING_POINTER, and warning_at().
Referenced by maybe_warn_switch_unreachable_and_auto_init().
Hash set of poisoned variables in a bind expr.
Referenced by gimplify_bind_expr(), gimplify_decl_expr(), gimplify_expr(), gimplify_function_tree(), and gimplify_target_expr().
Annotated gconds so that basic conditions in the same expression map to the same uid. This is used for condition coverage.
Referenced by gimplify_cond_expr(), gimplify_function_tree(), and tree_associate_condition_with_expr().
|
static |
Pointer to a list of allocated gimplify_ctx structs to be used for pushing and popping gimplify contexts.
Referenced by ctx_alloc(), ctx_free(), and free_gimplify_stack().
|
static |
Referenced by gimple_add_tmp_var(), gimple_bind_expr_stack(), gimple_conditional_context(), gimple_current_bind_expr(), gimple_pop_bind_expr(), gimple_pop_condition(), gimple_push_bind_expr(), gimple_push_cleanup(), gimple_push_condition(), gimplify_bind_expr(), gimplify_body(), gimplify_call_expr(), gimplify_case_label_expr(), gimplify_cleanup_point_expr(), gimplify_cond_expr(), gimplify_decl_expr(), gimplify_exit_expr(), gimplify_expr(), gimplify_loop_expr(), gimplify_modify_expr(), gimplify_modify_expr_rhs(), gimplify_omp_atomic(), gimplify_omp_for(), gimplify_return_expr(), gimplify_scan_omp_clauses(), gimplify_switch_expr(), gimplify_target_expr(), internal_get_tmp_var(), lookup_tmp_var(), pop_gimplify_context(), push_gimplify_context(), and should_warn_for_implicit_fallthrough().
|
static |
Referenced by computable_teams_clause(), gimple_add_tmp_var(), gimplify_adjust_omp_clauses(), gimplify_adjust_omp_clauses_1(), gimplify_bind_expr(), gimplify_body(), gimplify_call_expr(), gimplify_decl_expr(), gimplify_expr(), gimplify_oacc_declare(), gimplify_omp_depend(), gimplify_omp_dispatch(), gimplify_omp_for(), gimplify_omp_loop(), gimplify_omp_loop_xform(), gimplify_omp_ordered(), gimplify_omp_workshare(), gimplify_scan_omp_clauses(), gimplify_target_expr(), gimplify_var_or_parm_decl(), maybe_fold_stmt(), new_omp_context(), omp_construct_selector_matches(), omp_find_stores_op(), omp_has_nocontext(), omp_has_novariants(), omp_is_private(), omp_notice_variable(), and optimize_target_teams().
|
static |
Referenced by gimplify_expr(), gimplify_omp_loop(), and gimplify_omp_workshare().
|
static |
Tree lowering pass. This pass converts the GENERIC functions-as-trees tree representation into the GIMPLE form. Copyright (C) 2002-2024 Free Software Foundation, Inc. Major work done by Sebastian Pop <s.pop@laposte.net>, Diego Novillo <dnovillo@redhat.com> and Jason Merrill <jason@redhat.com>. 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/>.
Identifier for a basic condition, mapping it to other basic conditions of its Boolean expression. Basic conditions given the same uid (in the same function) are parts of the same ANDIF/ORIF expression. Used for condition coverage.
Referenced by next_cond_uid(), and reset_cond_uid().
Referenced by gimplify_bind_expr(), and gimplify_oacc_declare().