GCC Middle and Back End API Reference
|
Go to the source code of this file.
Typedefs | |
typedef bool(* | gimple_predicate) (tree) |
typedef int | fallback_t |
Enumerations | |
enum | fallback { fb_none = 0 , fb_rvalue = 1 , fb_lvalue = 2 , fb_mayfail = 4 , fb_either = fb_rvalue | fb_lvalue } |
enum | gimplify_status { GS_ERROR = -2 , GS_UNHANDLED = -1 , GS_OK = 0 , GS_ALL_DONE = 1 } |
typedef int fallback_t |
Header file for gimplification. Copyright (C) 2013-2025 Free Software Foundation, Inc. This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with GCC; see the file COPYING3. If not see <http://www.gnu.org/licenses/>.
Validation of GIMPLE expressions. Note that these predicates only check the basic form of the expression, they don't recurse to make sure that underlying nodes are also of the right form.
enum fallback |
enum gimplify_status |
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().
|
extern |
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().
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().
|
extern |
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().
|
extern |
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().
|
extern |
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().
|
extern |
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, 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().
Return the stack of bindings created during gimplification.
References gimplify_ctxp.
Referenced by find_supercontext().
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_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().
|
extern |
Return the first element of the stack of bindings.
References gimplify_ctxp.
|
extern |
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().
|
extern |
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().
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_dispatch(), 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().
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().
|
extern |
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, annotate_all_with_location(), annotate_all_with_location_after(), append_to_statement_list(), asan_poison_variables(), asan_poisoned_variables, asan_used_labels, omp_variant::body, 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, COMPLETE_TYPE_P, CONSTRUCTOR_ELTS, 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, cgraph_node::get(), 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_metadirective(), 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(), cgraph_node::has_omp_variant_constructs, in_omp_construct, input_location, INTEGRAL_TYPE_P, internal_error(), 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, 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(), 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.
|
extern |
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(), omp_variant::body, 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, omp_resolved_variant_calls, 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().
|
extern |
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().
|
extern |
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().
|
extern |
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 expand_omp_metadirective(), 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(), gimplify_variant_call_expr(), goa_stabilize_expr(), and lower_omp_task_reductions().
|
extern |
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().
|
extern |
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, PROP_gimple_lva, targetm, TREE_OPERAND, TREE_TYPE, lang_hooks_for_types::type_promotes_to, lang_hooks::types, and warning_at().
Referenced by gimplify_expr().
|
extern |
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().
|
extern |
Collect a list of traits for enclosing constructs in the current OpenMP context. The list is in the same format as the trait selector list of construct trait sets built by the front ends. Per the OpenMP specification, the construct trait set includes constructs up to an enclosing "target" construct. If there is no "target" construct, then additional things may be added to the construct trait set (simd for simd clones, additional constructs associated with "declare variant", the target trait for "declare target"); those are not handled here. In particular simd clones are not known during gimplification so matching/scoring of context selectors that might involve them needs to be deferred to the omp_device_lower pass.
References gimplify_omp_ctxp, last, make_trait_selector(), NULL_TREE, OMP_CLAUSE_BIND, OMP_CLAUSE_CHAIN, OMP_CLAUSE_CODE, OMP_CLAUSE_INBRANCH, OMP_CLAUSE_NOTINBRANCH, OMP_CLAUSE_SIMDLEN, omp_find_clause(), omp_has_nocontext(), OMP_TRAIT_CONSTRUCT_DISPATCH, OMP_TRAIT_CONSTRUCT_FOR, OMP_TRAIT_CONSTRUCT_PARALLEL, OMP_TRAIT_CONSTRUCT_SIMD, OMP_TRAIT_CONSTRUCT_TARGET, OMP_TRAIT_CONSTRUCT_TEAMS, ORT_ACC, ORT_COMBINED_PARALLEL, ORT_IMPLICIT_TARGET, ORT_PARALLEL, ORT_SIMD, ORT_TARGET, ORT_TEAMS, ORT_WORKSHARE, and unshare_expr().
Referenced by gimplify_omp_dispatch(), gimplify_omp_metadirective(), and gimplify_variant_call_expr().
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_call_expr(), and gimplify_omp_dispatch().
|
extern |
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().
Set up a context for the gimplifier.
References ctx_alloc(), gimplify_ctxp, 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().
|
extern |
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().
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 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(), gimplify_variant_call_expr(), 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_get_construct_context(), 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_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().
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().