GCC Middle and Back End API Reference
|
#include "tree-pass.h"
Data Structures | |
struct | gimplify_omp_ctx |
struct | gimplify_init_ctor_preeval_data |
Typedefs | |
typedef char * | char_p |
Enumerations | |
enum | gimplify_omp_var_data { GOVD_SEEN = 1, GOVD_EXPLICIT = 2, GOVD_SHARED = 4, GOVD_PRIVATE = 8, GOVD_FIRSTPRIVATE = 16, GOVD_LASTPRIVATE = 32, GOVD_REDUCTION = 64, GOVD_LOCAL = 128, GOVD_DEBUG_PRIVATE = 256, GOVD_PRIVATE_OUTER_REF = 512, GOVD_LINEAR = 2048, GOVD_DATA_SHARE_CLASS } |
enum | omp_region_type { ORT_WORKSHARE = 0, ORT_SIMD = 1, ORT_PARALLEL = 2, ORT_COMBINED_PARALLEL = 3, ORT_TASK = 4, ORT_UNTIED_TASK = 5 } |
Variables | |
static struct gimplify_ctx * | gimplify_ctxp |
static struct gimplify_omp_ctx * | gimplify_omp_ctxp |
static unsigned int | tmp_var_id_num |
static struct pointer_set_t * | nonlocal_vlas |
typedef char* char_p |
@verbatim Tree lowering pass. This pass converts the GENERIC functions-as-trees
tree representation into the GIMPLE form. Copyright (C) 2002-2013 Free Software Foundation, Inc. Major work done by Sebastian Pop s.pop, Diego Novillo @lap oste. netdnovi and Jason Merrill llo@ redha t.co mjason. @red hat.c om
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/.
enum omp_region_type |
void annotate_all_with_location | ( | ) |
Set the location for all the statements in a sequence STMT_P to LOCATION.
References annotate_one_with_location(), gimple_seq_empty_p(), gsi_end_p(), gsi_next(), and gsi_stmt().
|
static |
Set LOCATION for all the statements after iterator GSI in sequence SEQ. If GSI is pointing to the end of the sequence, start with the first statement in SEQ.
References annotate_one_with_location(), gsi_end_p(), gsi_next(), gsi_stmt(), and gimplify_omp_ctx::location.
Referenced by gimplify_expr().
|
static |
Set the location for gimple statement GS to LOCATION.
References gimple_do_not_emit_location_p(), gimple_has_location(), gimple_set_location(), and should_carry_location_p().
Referenced by annotate_all_with_location(), and annotate_all_with_location_after().
tree build_and_jump | ( | ) |
Build a GOTO to the LABEL_DECL pointed to by LABEL_P, building it first if necessary.
References create_artificial_label().
|
static |
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(), and gimple_call_set_lhs().
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 build_pointer_type(), 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(), get_unwidened(), type(), and useless_type_conversion_p().
Referenced by gimplify_compound_lval(), and gimplify_conversion().
|
static |
Compare two case labels. Because the front end should already have made sure that case ranges do not overlap, it is enough to only compare the CASE_LOW values of each case label.
References tree_int_cst_compare().
Referenced by sort_case_labels().
|
inlinestatic |
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().
Referenced by unshare_body().
|
static |
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 mostly_copy_tree_r(), tcc_constant, tcc_declaration, and tcc_type.
Referenced by copy_if_shared().
|
inlinestatic |
Create a temporary with a name derived from VAL. Subroutine of lookup_tmp_var; nobody else should call this function.
References create_tmp_var(), and get_name().
Referenced by lookup_tmp_var().
tree create_tmp_reg | ( | ) |
Create a new temporary variable declaration of type TYPE by calling create_tmp_var and if TYPE is a vector or a complex number, mark the new temporary as gimple register.
References create_tmp_var().
tree create_tmp_var | ( | ) |
Create a new temporary variable declaration of type TYPE. DO push the variable into the current binding. Further, assume that this is called only from gimplification or optimization, at which point the creation of certain types are bugs.
References create_tmp_var_raw(), and gimple_add_tmp_var().
tree create_tmp_var_name | ( | ) |
References clean_symbol_name(), get_identifier(), remove_suffix(), and strlen().
tree create_tmp_var_raw | ( | ) |
Create a new temporary variable declaration of type TYPE. Do NOT push it into the current binding.
References create_tmp_var_name(), and input_location.
void declare_vars | ( | ) |
Declare all the variables in VARS in SCOPE. If DEBUG_INFO is true, generate debug info for them; otherwise don't.
References chainon(), gimple_bind_block(), gimple_bind_set_vars(), gimple_bind_vars(), last, and nreverse().
|
static |
Destroy an omp construct that deals with variable remapping.
References pointer_set_destroy(), gimplify_omp_ctx::privatized_types, and gimplify_omp_ctx::variables.
Referenced by gimplify_adjust_omp_clauses().
|
static |
Return whether we should exclude FNDECL from instrumentation.
References lang_hooks::decl_printable_name, and strstr().
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(), HOST_WIDE_INT, and max_int_size_in_bytes().
Referenced by gimple_add_tmp_var().
tree force_gimple_operand | ( | ) |
Expand EXPR to list of gimple statements STMTS. If SIMPLE is true, force the result to be either ssa_name or an invariant, otherwise just force it to be a rhs expression. If VAR is not NULL, make the base variable of the final destination be VAR if suitable.
References force_gimple_operand_1(), is_gimple_reg_rhs(), and is_gimple_val().
Referenced by canonicalize_loop_ivs(), copy_phis_for_bb(), create_empty_loop_on_edge(), create_expression_by_pieces(), create_iv(), determine_exit_conditions(), gen_parallel_loop(), get_initial_def_for_induction(), initialize_root_vars(), initialize_root_vars_lm(), insert_into_preds_of_block(), insert_out_of_ssa_copy(), insert_out_of_ssa_copy_on_edge(), mf_build_check_statement_for(), prepare_initializers_chain(), propagate_expr_outside_region(), remove_invariant_phi(), rename_uses(), rewrite_use_compare(), set_component_ssa_name(), set_prologue_iterations(), take_address_of(), translate_clast_assignment(), vect_build_loop_niters(), vect_create_addr_base_for_vector_ref(), vect_do_peeling_for_alignment(), vect_gen_niters_for_prolog_loop(), vect_generate_tmps_on_preheader(), and vectorizable_load().
tree force_gimple_operand_1 | ( | tree | expr, |
gimple_seq * | stmts, | ||
gimple_predicate | gimple_test_f, | ||
tree | var | ||
) |
Expand EXPR to list of gimple statements STMTS. GIMPLE_TEST_F specifies the predicate that will hold for the result. If VAR is not NULL, make the base variable of the final destination be VAR if suitable.
References gimplify_ctx::allow_rhs_cond_expr, cfun, fb_rvalue, gimple_in_ssa_p(), gimplify_and_add(), gimplify_expr(), GS_ERROR, input_location, gimplify_ctx::into_ssa, is_gimple_reg(), is_gimple_val(), make_ssa_name(), pop_gimplify_context(), and push_gimplify_context().
Referenced by add_to_predicate_list(), force_gimple_operand(), force_gimple_operand_gsi_1(), slpeel_add_loop_guard(), and vect_loop_versioning().
tree force_gimple_operand_gsi | ( | gimple_stmt_iterator * | gsi, |
tree | expr, | ||
bool | simple_p, | ||
tree | var, | ||
bool | before, | ||
enum gsi_iterator_update | m | ||
) |
Invoke force_gimple_operand_1 for EXPR with parameter VAR. If SIMPLE is true, force the result to be either ssa_name or an invariant, otherwise just force it to be a rhs expression. If some statements are produced, emits them at GSI. If BEFORE is true, the statements are appended before GSI, otherwise they are appended after it. M specifies the way GSI moves after insertion (GSI_SAME_STMT or GSI_CONTINUE_LINKING are the usual values).
References force_gimple_operand_gsi_1(), is_gimple_reg_rhs(), and is_gimple_val().
Referenced by adjust_accumulator_values(), adjust_return_value_with_ops(), build_arrays(), build_one_array(), combine_conversions(), conditional_replacement(), convert_mult_to_fma(), copy_bb(), create_call_for_reduction_1(), create_empty_if_region_on_edge(), create_empty_loop_on_edge(), create_mem_ref(), emit_case_bit_tests(), expand_omp_atomic_fetch_op(), expand_omp_atomic_load(), expand_omp_atomic_mutex(), expand_omp_atomic_pipeline(), expand_omp_atomic_store(), expand_omp_build_assign(), 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_simd(), expand_omp_single(), expand_parallel_call(), expand_task_call(), expand_vector_parallel(), extract_component(), extract_omp_for_update_vars(), generate_memcpy_builtin(), generate_memset_builtin(), generate_subtree_copies(), get_string_length(), gimple_gen_average_profiler(), gimple_gen_ic_func_profiler(), gimple_gen_ic_profiler(), gimple_gen_interval_profiler(), gimple_gen_ior_profiler(), gimple_gen_one_value_profiler(), gimple_gen_pow2_profiler(), gimplify_addr(), gimplify_build1(), gimplify_build2(), gimplify_build3(), gimplify_mem_ref_parts(), handle_builtin_strcat(), handle_builtin_strcpy(), hoist_edge_and_branch_if_true(), ifcombine_ifandif(), insert_init_stmt(), ipa_modify_call_arguments(), issue_prefetch_ref(), load_assign_lhs_subreplacements(), lower_vec_perm(), negate_value(), prepare_instrumented_value(), replace_ref(), rewrite_phi_with_iv(), rewrite_use_compare(), rewrite_use_nonlinear_expr(), scev_const_prop(), set_ifsese_condition(), simplify_builtin_call(), slpeel_make_loop_iterate_ntimes(), split_function(), sra_ipa_modify_assign(), sra_modify_assign(), sra_modify_expr(), thunk_adjust(), transform_to_exit_first_loop(), update_accumulator_with_ops(), update_range_test(), vect_update_ivs_after_vectorizer(), and vectorizable_load().
tree force_gimple_operand_gsi_1 | ( | gimple_stmt_iterator * | gsi, |
tree | expr, | ||
gimple_predicate | gimple_test_f, | ||
tree | var, | ||
bool | before, | ||
enum gsi_iterator_update | m | ||
) |
Invoke force_gimple_operand_1 for EXPR with parameters GIMPLE_TEST_F and VAR. If some statements are produced, emits them at GSI. If BEFORE is true. the statements are appended before GSI, otherwise they are appended after it. M specifies the way GSI moves after insertion (GSI_SAME_STMT or GSI_CONTINUE_LINKING are the usual values).
References force_gimple_operand_1(), gimple_seq_empty_p(), gsi_insert_seq_after(), and gsi_insert_seq_before().
Referenced by create_mem_ref(), find_phi_replacement_condition(), force_gimple_operand_gsi(), gimplify_mem_ref_parts(), predicate_mem_writes(), and set_prologue_iterations().
tree force_labels_r | ( | ) |
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.
|
static |
Return true if evaluating EXPR could trap. EXPR is GENERIC, while tree_could_trap_p can be called only on GIMPLE.
References is_gimple_val(), and tree_could_trap_p().
Referenced by gimplify_cond_expr().
tree get_formal_tmp_var | ( | ) |
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().
tree get_initialized_tmp_var | ( | ) |
Return a temporary variable initialized with VAL. PRE_P and POST_P are as in gimplify_expr.
References internal_get_tmp_var().
void gimple_add_tmp_var | ( | ) |
Push the temporary variable TMP into the current binding.
References cfun, current_function_decl, declare_vars(), force_constant_size(), gimple_body(), gimple_seq_first_stmt(), gimplify_omp_ctxp, GOVD_LOCAL, GOVD_SEEN, host_integerp(), omp_add_variable(), ORT_SIMD, ORT_WORKSHARE, gimplify_omp_ctx::outer_context, record_vars(), gimplify_omp_ctx::region_type, and gimplify_ctx::temps.
Return the stack of bindings created during gimplification.
References gimplify_ctx::bind_expr_stack.
tree gimple_boolify | ( | ) |
EXPR is used in a boolean context; make sure it has BOOLEAN_TYPE.
References BUILT_IN_NORMAL, fold_convert_loc(), get_callee_fndecl(), gimple_boolify(), integer_zerop(), and truth_value_p().
|
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.
Referenced by gimple_push_cleanup().
gimple gimple_current_bind_expr | ( | void | ) |
Return the first element of the stack of bindings.
References gimplify_ctx::bind_expr_stack.
|
inlinestatic |
Return true if a location should not be emitted for this statement by annotate_one_with_location.
References GF_PLF_1, and gimple_plf().
Referenced by annotate_one_with_location().
tree gimple_fold_indirect_ref | ( | ) |
Given a pointer value OP0, return a simplified version of an indirection through OP0, or NULL_TREE if no simplification is possible. 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 build_int_cst_wide(), host_integerp(), HOST_WIDE_INT, offset, tree_int_cst_equal(), tree_low_cst(), and useless_type_conversion_p().
Referenced by copy_tree_body_r(), expand_thunk(), and gimple_fold_indirect_ref_rhs().
|
static |
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.
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, and gimplify_seq_add_seq().
Referenced by gimplify_cond_expr().
|
static |
Push a GIMPLE_BIND tuple onto the stack of bindings.
References gimplify_ctx::bind_expr_stack.
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.
References gimplify_ctx::conditional_cleanups, create_tmp_var(), gimple_build_wce(), gimple_conditional_context(), gimple_wce_set_cleanup_eh_only(), gimplify_seq_add_stmt(), gimplify_stmt(), and seen_error().
Referenced by gimplify_target_expr().
|
static |
Note that we've entered a COND_EXPR.
References gimplify_ctx::conditional_cleanups, gimplify_ctx::conditions, and gimple_seq_empty_p().
Referenced by gimplify_cond_expr().
void gimple_regimplify_operands | ( | ) |
Some transformations like inlining may invalidate the GIMPLE form for operands. This function traverses all the operands in STMT and gimplifies anything that is not a valid gimple operand. Any new GIMPLE statements are inserted before *GSI_P.
References aggregate_value_p(), cfun, create_tmp_reg(), fb_lvalue, fb_mayfail, fb_rvalue, get_gimple_rhs_class(), gimple_asm_input_op(), gimple_asm_ninputs(), gimple_asm_noutputs(), gimple_asm_output_op(), gimple_assign_lhs(), gimple_assign_rhs1_ptr(), gimple_call_flags(), gimple_call_fndecl(), gimple_cond_lhs_ptr(), gimple_cond_rhs_ptr(), gimple_expr_code(), gimple_get_lhs(), gimple_in_ssa_p(), gimple_num_ops(), gimple_omp_atomic_load_rhs_ptr(), gimple_op(), gimple_seq_empty_p(), gimple_set_lhs(), gimple_set_op(), GIMPLE_SINGLE_RHS, gimple_switch_index_ptr(), gimplify_expr(), gsi_insert_after(), gsi_insert_seq_before(), GSI_NEW_STMT, GSI_SAME_STMT, gimplify_ctx::into_ssa, is_gimple_asm_val(), is_gimple_assign(), is_gimple_call(), is_gimple_call_addr(), is_gimple_lvalue(), is_gimple_min_lval(), is_gimple_reg(), is_gimple_reg_type(), is_gimple_val(), make_ssa_name(), parse_input_constraint(), parse_output_constraint(), pop_gimplify_context(), push_gimplify_context(), rhs_predicate_for(), and stmt_can_throw_internal().
void gimple_seq_add_stmt_without_update | ( | ) |
Link gimple statement GS to the end of the sequence *SEQ_P. If *SEQ_P is NULL, a new sequence is allocated. This function is similar to gimple_seq_add_stmt, 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_after_without_update(), GSI_NEW_STMT, and si.
|
inlinestatic |
Mark statement G so a location will not be emitted by annotate_one_with_location.
References GF_PLF_1, and gimple_set_plf().
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_loc(), fb_either, fold_convert_loc(), gimplify_expr(), GS_ERROR, GS_OK, is_gimple_addressable(), mark_addressable(), prepare_gimple_addressable(), recompute_tree_invariant_for_addr_expr(), tree_ssa_useless_type_conversion(), types_compatible_p(), and useless_type_conversion_p().
Referenced by gimplify_expr().
|
static |
References lang_hooks::decls, delete_omp_context(), gimplify_adjust_omp_clauses_1(), gimplify_omp_ctxp, GOVD_DATA_SHARE_CLASS, GOVD_DEBUG_PRIVATE, GOVD_FIRSTPRIVATE, GOVD_LASTPRIVATE, GOVD_PRIVATE, GOVD_SEEN, GOVD_SHARED, is_global_var(), omp_add_variable(), OMP_CLAUSE_COLLAPSE, OMP_CLAUSE_COPYIN, OMP_CLAUSE_COPYPRIVATE, OMP_CLAUSE_DEFAULT, OMP_CLAUSE_FINAL, OMP_CLAUSE_FIRSTPRIVATE, OMP_CLAUSE_IF, OMP_CLAUSE_LASTPRIVATE, OMP_CLAUSE_LINEAR, OMP_CLAUSE_MERGEABLE, OMP_CLAUSE_NOWAIT, OMP_CLAUSE_NUM_THREADS, OMP_CLAUSE_ORDERED, OMP_CLAUSE_PRIVATE, OMP_CLAUSE_REDUCTION, OMP_CLAUSE_SAFELEN, OMP_CLAUSE_SCHEDULE, OMP_CLAUSE_SHARED, OMP_CLAUSE_UNTIED, omp_notice_variable(), lang_hooks_for_decls::omp_private_debug_clause, ORT_COMBINED_PARALLEL, gimplify_omp_ctx::outer_context, gimplify_omp_ctx::region_type, and gimplify_omp_ctx::variables.
Referenced by gimplify_omp_for(), gimplify_omp_parallel(), 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 build_omp_clause(), lang_hooks::decls, GOVD_DATA_SHARE_CLASS, GOVD_DEBUG_PRIVATE, GOVD_EXPLICIT, GOVD_FIRSTPRIVATE, GOVD_LASTPRIVATE, GOVD_LINEAR, GOVD_LOCAL, GOVD_PRIVATE, GOVD_PRIVATE_OUTER_REF, GOVD_REDUCTION, GOVD_SEEN, GOVD_SHARED, input_location, is_global_var(), OMP_CLAUSE_FIRSTPRIVATE, OMP_CLAUSE_LASTPRIVATE, OMP_CLAUSE_PRIVATE, OMP_CLAUSE_SHARED, lang_hooks_for_decls::omp_finish_clause, lang_hooks_for_decls::omp_private_debug_clause, gimplify_omp_ctx::outer_context, and gimplify_omp_ctx::variables.
Referenced by gimplify_adjust_omp_clauses().
void gimplify_and_add | ( | ) |
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().
|
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_next(), gsi_stmt(), and last.
Referenced by gimplify_omp_parallel(), gimplify_omp_task(), and gimplify_transaction().
|
static |
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.
References fb_either, fb_rvalue, gimplify_expr(), is_gimple_lvalue(), is_gimple_reg_type(), is_gimple_val(), maybe_with_size_expr(), and protected_set_expr_location().
Referenced by gimplify_call_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 build_string(), chainon(), constraint_len(), error(), fb_lvalue, fb_mayfail, fb_rvalue, free(), gimple_asm_set_input(), gimple_asm_set_volatile(), gimple_build_asm_vec(), gimplify_expr(), gimplify_seq_add_stmt(), GS_ALL_DONE, GS_ERROR, input_location, is_gimple_asm_val(), is_gimple_lvalue(), is_gimple_min_lval(), len, list_length(), mark_addressable(), memcpy(), parse_input_constraint(), parse_output_constraint(), strlen(), unshare_expr(), and vec_safe_push().
Referenced by gimplify_expr().
|
static |
Gimplify a BIND_EXPR. Just voidify and recurse.
References build_constructor(), build_stack_save_restore(), cfun, current_function_decl, gimple_bind_body(), gimple_bind_set_body(), gimple_build_bind(), gimple_build_try(), gimple_pop_bind_expr(), gimple_push_bind_expr(), GIMPLE_TRY_FINALLY, gimplify_omp_ctxp, gimplify_seq_add_stmt(), gimplify_stmt(), GOVD_LOCAL, GOVD_SEEN, GS_ALL_DONE, GS_OK, function::has_local_explicit_reg_vars, is_gimple_reg(), is_global_var(), needs_to_live_in_memory(), omp_add_variable(), gimplify_ctx::save_stack, SR_NONE, gimplify_omp_ctx::variables, and voidify_wrapper_expr().
Referenced by gimplify_expr().
gimple gimplify_body | ( | ) |
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 cgraph_get_node(), current_function_decl, default_rtl_profile(), gimple_bind_body(), gimple_bind_set_body(), gimple_build_bind(), gimple_build_nop(), gimple_seq_empty_p(), gimple_seq_first(), gimple_seq_first_stmt(), gimple_seq_last(), gimplify_parameters(), gimplify_seq_add_seq(), gimplify_seq_add_stmt(), gimplify_stmt(), input_location, cgraph_node::origin, pointer_set_create(), pointer_set_destroy(), pop_gimplify_context(), push_gimplify_context(), seen_error(), timevar_pop(), timevar_push(), unshare_body(), unvisit_body(), and verify_gimple_in_seq().
|
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 build_call_array_loc(), build_empty_stmt(), build_int_cst(), build_string_literal(), BUILT_IN_NORMAL, call_expr_flags(), current_function_decl, error(), error_at(), expand_location(), fb_rvalue, fold_builtin_next_arg(), fold_call_expr(), fold_stmt(), get_callee_fndecl(), gimple_build_call_from_tree(), gimple_call_set_fntype(), gimplify_arg(), gimplify_expr(), gimplify_seq_add_stmt(), GS_ERROR, GS_OK, input_location, is_gimple_call_addr(), notice_special_calls(), and strlen().
Referenced by gimplify_expr().
|
static |
Gimplify the CASE_LABEL_EXPR pointed to by EXPR_P.
References gimplify_ctx::case_labels, gimple_build_label(), gimplify_seq_add_stmt(), GS_ALL_DONE, and gimplify_ctx::prev_context.
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, gimple_statement_try::eval, gimple_build_try(), GIMPLE_TRY_CATCH, GIMPLE_TRY_FINALLY, gimple_wce_cleanup(), gimple_wce_cleanup_eh_only(), 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_stmt(), gimplify_ctx::in_cleanup_point_expr, and voidify_wrapper_expr().
Referenced by gimplify_expr().
|
static |
Forward declaration.
Referenced by gimplify_compound_expr(), gimplify_cond_expr(), gimplify_expr(), and gimplify_modify_expr_rhs().
|
static |
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, and GS_OK.
|
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 fb_lvalue, gimple_add_tmp_var(), gimplify_and_add(), GS_OK, and needs_to_live_in_memory().
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(), fb_lvalue, fb_rvalue, fold_indirect_ref_loc(), gimplify_expr(), gimplify_var_or_parm_decl(), GS_ALL_DONE, GS_OK, handled_component_p(), is_gimple_min_invariant(), is_gimple_min_lval(), is_gimple_reg(), is_gimple_val(), offset, recalculate_side_effects(), size_binop_loc(), and unshare_expr().
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, build_fold_addr_expr_loc(), build_pointer_type(), build_simple_mem_ref_loc(), create_artificial_label(), create_tmp_var(), current_function_decl, fb_lvalue, fb_rvalue, g, generic_expr_could_trap_p(), 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(), gimplify_compound_expr(), gimplify_expr(), gimplify_pure_cond_expr(), gimplify_seq_add_stmt(), gimplify_stmt(), GS_ALL_DONE, GS_ERROR, is_gimple_condexpr(), recalculate_side_effects(), and shortcut_cond_expr().
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(), GS_OK, is_gimple_reg_type(), and tree_ssa_useless_type_conversion().
Referenced by gimplify_expr().
|
static |
Gimplify a DECL_EXPR node *STMT_P by making any necessary allocation and initialization explicit.
References compare_tree_int(), force_labels_r(), GENERIC_STACK_CHECK, ggc_free(), gimple_add_tmp_var(), gimplify_and_add(), gimplify_type_sizes(), gimplify_vla_decl(), GS_ALL_DONE, and GS_ERROR.
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 build_and_jump(), gimplify_ctx::exit_label, and GS_OK.
Referenced by gimplify_expr().
enum gimplify_status gimplify_expr | ( | tree * | expr_p, |
gimple_seq * | pre_p, | ||
gimple_seq * | post_p, | ||
bool(*)(tree) | gimple_test_f, | ||
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.c. 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 gimplify_ctx::allow_rhs_cond_expr, annotate_all_with_location(), annotate_all_with_location_after(), append_to_statement_list(), build_fold_addr_expr_loc(), build_fold_addr_expr_with_type_loc(), build_int_cst(), create_tmp_var_raw(), current_function_decl, debug_tree(), decl_function_context(), eval(), failure, fb_either, fb_lvalue, fb_mayfail, fb_none, fb_rvalue, fold_convert_loc(), fold_indirect_ref_loc(), g, get_formal_tmp_var(), get_initialized_tmp_var(), gimple_add_tmp_var(), gimple_boolify(), gimple_build_catch(), gimple_build_eh_filter(), gimple_build_goto(), gimple_build_label(), gimple_build_omp_critical(), gimple_build_omp_master(), gimple_build_omp_ordered(), gimple_build_omp_section(), gimple_build_predict(), gimple_build_try(), gimple_seq_add_seq(), gimple_seq_empty_p(), gimple_set_location(), gimple_set_no_warning(), GIMPLE_TRY_CATCH, GIMPLE_TRY_FINALLY, gimple_try_set_catch_is_cleanup(), gimplify_addr_expr(), gimplify_and_add(), 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_decl_expr(), gimplify_exit_expr(), lang_hooks::gimplify_expr, gimplify_expr(), gimplify_loop_expr(), gimplify_modify_expr(), gimplify_omp_atomic(), gimplify_omp_for(), gimplify_omp_parallel(), gimplify_omp_task(), gimplify_omp_workshare(), gimplify_return_expr(), gimplify_save_expr(), gimplify_scalar_mode_aggregate_compare(), 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(), GS_ALL_DONE, GS_ERROR, GS_OK, GS_UNHANDLED, handler(), HOST_WIDE_INT, input_location, internal_error(), gimplify_ctx::into_ssa, is_gimple_addressable(), is_gimple_asm_val(), is_gimple_call_addr(), is_gimple_condexpr(), is_gimple_lvalue(), is_gimple_mem_ref_addr(), is_gimple_mem_rhs(), is_gimple_mem_rhs_or_call(), is_gimple_min_invariant(), is_gimple_min_lval(), is_gimple_reg(), is_gimple_reg_rhs(), is_gimple_reg_rhs_or_call(), is_gimple_stmt(), is_gimple_val(), mark_addressable(), omp_notice_variable(), print_generic_expr(), recalculate_side_effects(), save_expr(), tcc_binary, tcc_comparison, tcc_constant, tcc_declaration, tcc_unary, and useless_type_conversion_p().
Referenced by force_gimple_operand_1(), gimple_regimplify_operands(), gimplify_addr_expr(), gimplify_arg(), gimplify_asm_expr(), gimplify_call_expr(), gimplify_compound_lval(), gimplify_cond_expr(), gimplify_expr(), gimplify_init_constructor(), gimplify_init_ctor_preeval(), gimplify_modify_expr(), gimplify_modify_expr_rhs(), gimplify_omp_atomic(), gimplify_omp_for(), 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(), gimplify_va_arg_expr(), goa_stabilize_expr(), internal_get_tmp_var(), lower_lastprivate_clauses(), and std_gimplify_va_arg_expr().
void gimplify_function_tree | ( | ) |
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 builtin_decl_implicit(), cfun, create_tmp_var(), function::curr_properties, current_function_decl, flag_instrument_functions_exclude_p(), gimple_bind_block(), gimple_bind_set_block(), gimple_body(), gimple_build_bind(), gimple_build_call(), gimple_build_try(), gimple_call_set_lhs(), gimple_seq_add_stmt(), gimple_set_body(), GIMPLE_TRY_FINALLY, gimplify_body(), gimplify_seq_add_stmt(), needs_to_live_in_memory(), pop_cfun(), push_cfun(), and push_struct_function().
|
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 build_complex(), build_vector_from_ctor(), build_zero_cst(), can_move_by_pieces(), categorize_ctor_elements(), cfun, create_tmp_var(), create_tmp_var_name(), fb_lvalue, fb_rvalue, force_labels_r(), get_alias_set(), get_base_address(), get_formal_tmp_var(), 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, HOST_WIDE_INT, initializer_constant_valid_p(), int_size_in_bytes(), is_gimple_lvalue(), is_gimple_reg(), is_gimple_val(), lhd_set_decl_assembler_name(), gimplify_init_ctor_preeval_data::lhs_alias_set, gimplify_init_ctor_preeval_data::lhs_base_decl, optimize_compound_literals_in_ctor(), optimize_function_for_speed_p(), rhs_predicate_for(), tree_output_constant_def(), type(), unshare_expr(), useless_type_conversion_p(), constructor_elt_d::value, vec_safe_is_empty(), and vec_safe_length().
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 ggc_free(), gimplify_and_add(), gimplify_init_ctor_eval_range(), HOST_WIDE_INT, initializer_zerop(), simple_cst_equal(), unshare_expr(), and zero_sized_field_decl().
Referenced by gimplify_init_constructor(), and gimplify_init_ctor_eval_range().
|
static |
A subroutine of gimplify_init_constructor. Pre-evaluate EXPR, force values that overlap with the lhs (as described by *DATA) into temporaries.
References fb_rvalue, get_formal_tmp_var(), gimplify_expr(), gimplify_init_ctor_preeval_1(), GS_ERROR, HOST_WIDE_INT, is_gimple_mem_rhs(), maybe_with_size_expr(), and constructor_elt_d::value.
Referenced by gimplify_init_constructor().
|
static |
|
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_seq_add_stmt(), and GS_ALL_DONE.
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 create_tmp_var_name(), fb_lvalue, fb_rvalue, fold_convert_loc(), fold_stmt(), get_initialized_tmp_var(), gimple_build_call_from_tree(), gimple_call_noreturn_p(), gimple_call_set_fntype(), gimple_call_set_lhs(), gimple_set_location(), 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, gimplify_ctx::into_ssa, is_gimple_addressable(), is_gimple_lvalue(), is_gimple_reg(), maybe_with_size_expr(), notice_special_calls(), rhs_predicate_for(), unshare_expr(), useless_type_conversion_p(), and zero_sized_type().
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 variable with DECL_GIMPLE_REG_P set. 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 build_complex(), get_formal_tmp_var(), gimplify_seq_add_stmt(), and GS_ALL_DONE.
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_value_p(), build_simple_mem_ref_loc(), changed, copy_node(), fb_lvalue, gimple_fold_indirect_ref_rhs(), gimplify_and_add(), gimplify_compound_expr(), gimplify_expr(), gimplify_init_constructor(), GS_ERROR, GS_OK, GS_UNHANDLED, is_gimple_lvalue(), is_gimple_min_lval(), is_gimple_reg_type(), is_gimple_variable(), mark_addressable(), needs_to_live_in_memory(), recalculate_side_effects(), rhs_predicate_for(), tcc_declaration, unshare_expr(), variably_modified_type_p(), voidify_wrapper_expr(), and wrap().
Referenced by gimplify_modify_expr().
|
static |
A subroutine of gimplify_modify_expr. Replace a MODIFY_EXPR with a call to __builtin_memcpy.
References build_fold_addr_expr_loc(), builtin_decl_implicit(), create_tmp_var(), gimple_build_call(), gimple_call_set_lhs(), gimplify_arg(), gimplify_seq_add_stmt(), GS_ALL_DONE, mark_addressable(), and prepare_gimple_addressable().
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 build_fold_addr_expr_loc(), builtin_decl_implicit(), create_tmp_var(), gimple_build_call(), gimple_call_set_lhs(), gimplify_arg(), gimplify_seq_add_stmt(), GS_ALL_DONE, and vec_safe_is_empty().
Referenced by gimplify_modify_expr().
|
static |
Gimplify an OMP_ATOMIC statement.
References create_tmp_reg(), fb_rvalue, gimple_build_omp_atomic_load(), gimple_build_omp_atomic_store(), gimple_omp_atomic_set_need_value(), gimplify_expr(), gimplify_seq_add_stmt(), goa_stabilize_expr(), GS_ALL_DONE, GS_ERROR, and is_gimple_val().
Referenced by gimplify_expr().
|
static |
Gimplify the gross structure of an OMP_FOR statement.
References bitmap_bit_p(), bitmap_set_bit(), build_int_cst(), build_omp_clause(), create_tmp_var(), fb_rvalue, get_name(), GF_OMP_FOR_KIND_FOR, GF_OMP_FOR_KIND_SIMD, gimple_build_omp_for(), 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(), gimplify_adjust_omp_clauses(), gimplify_and_add(), gimplify_assign(), gimplify_expr(), gimplify_scan_omp_clauses(), gimplify_seq_add_stmt(), GOVD_DATA_SHARE_CLASS, GOVD_EXPLICIT, GOVD_LASTPRIVATE, GOVD_LINEAR, GOVD_PRIVATE, GOVD_SEEN, GS_ALL_DONE, GS_ERROR, input_location, is_gimple_reg(), is_gimple_val(), omp_add_variable(), OMP_CLAUSE_LASTPRIVATE, OMP_CLAUSE_LINEAR, OMP_CLAUSE_PRIVATE, omp_is_private(), omp_notice_variable(), ORT_SIMD, ORT_WORKSHARE, si, tsi_end_p(), tsi_next(), tsi_start(), tsi_stmt(), and gimplify_omp_ctx::variables.
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(), ORT_COMBINED_PARALLEL, ORT_PARALLEL, pop_gimplify_context(), and push_gimplify_context().
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 find_omp_clause(), g, gimple_build_omp_task(), gimplify_adjust_omp_clauses(), gimplify_and_return_first(), gimplify_scan_omp_clauses(), gimplify_seq_add_stmt(), OMP_CLAUSE_UNTIED, ORT_TASK, ORT_UNTIED_TASK, pop_gimplify_context(), and push_gimplify_context().
Referenced by gimplify_expr().
|
static |
Gimplify the gross structure of other OpenMP worksharing constructs. In particular, OMP_SECTIONS and OMP_SINGLE.
References gimple_build_omp_sections(), gimple_build_omp_single(), gimplify_adjust_omp_clauses(), gimplify_and_add(), gimplify_scan_omp_clauses(), gimplify_seq_add_stmt(), and ORT_WORKSHARE.
Referenced by gimplify_expr().
void gimplify_one_sizepos | ( | ) |
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 fb_rvalue, gimplify_expr(), is_gimple_sizepos(), is_gimple_val(), and unshare_expr().
|
static |
Given a conditional expression *EXPR_P without side effects, gimplify its operands. New statements are inserted to PRE_P.
References fb_rvalue, gimple_boolify(), gimplify_expr(), is_gimple_condexpr(), and is_gimple_val().
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(), create_tmp_reg(), current_function_decl, gimple_build_return(), gimple_set_no_warning(), gimplify_and_add(), gimplify_one_sizepos(), gimplify_seq_add_stmt(), gimplify_type_sizes(), GS_ALL_DONE, GS_ERROR, and gimplify_ctx::return_temp.
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 fb_none, get_initialized_tmp_var(), gimplify_expr(), GS_ALL_DONE, and is_gimple_stmt().
Referenced by gimplify_expr().
|
static |
Gimplify a comparison between two aggregate objects of integral scalar mode as a comparison between the bitwise equivalent scalar values.
References GS_OK, lang_hooks_for_types::type_for_mode, and lang_hooks::types.
Referenced by gimplify_expr().
|
static |
Scan the OpenMP clauses in *LIST_P, installing mappings into a new and previous omp contexts.
References lang_hooks::decls, gimplify_omp_ctx::default_kind, do_add(), error(), fb_rvalue, gimple_boolify(), gimple_seq_first_stmt(), gimplify_and_add(), gimplify_expr(), GOVD_EXPLICIT, GOVD_FIRSTPRIVATE, GOVD_LASTPRIVATE, GOVD_LINEAR, GOVD_LOCAL, GOVD_PRIVATE, GOVD_PRIVATE_OUTER_REF, GOVD_REDUCTION, GOVD_SEEN, GOVD_SHARED, GS_ERROR, is_gimple_val(), new_omp_context(), omp_add_variable(), omp_check_private(), OMP_CLAUSE_COLLAPSE, OMP_CLAUSE_COPYIN, OMP_CLAUSE_COPYPRIVATE, OMP_CLAUSE_DEFAULT, OMP_CLAUSE_FINAL, OMP_CLAUSE_FIRSTPRIVATE, OMP_CLAUSE_IF, OMP_CLAUSE_LASTPRIVATE, OMP_CLAUSE_LINEAR, OMP_CLAUSE_MERGEABLE, OMP_CLAUSE_NOWAIT, OMP_CLAUSE_NUM_THREADS, OMP_CLAUSE_ORDERED, OMP_CLAUSE_PRIVATE, OMP_CLAUSE_REDUCTION, OMP_CLAUSE_SAFELEN, OMP_CLAUSE_SCHEDULE, OMP_CLAUSE_SHARED, OMP_CLAUSE_UNTIED, omp_notice_variable(), lang_hooks_for_decls::omp_private_outer_ref, ORT_WORKSHARE, gimplify_omp_ctx::outer_context, pop_gimplify_context(), and push_gimplify_context().
Referenced by gimplify_omp_for(), gimplify_omp_parallel(), 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 convert_to_ptrofftype_loc(), fb_lvalue, fb_rvalue, get_initialized_tmp_var(), gimplify_assign(), gimplify_expr(), gimplify_seq_add_seq(), GS_ALL_DONE, GS_ERROR, GS_OK, is_gimple_lvalue(), and is_gimple_val().
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_NEW_STMT, and si.
Referenced by gimple_pop_condition(), gimplify_body(), gimplify_cleanup_point_expr(), gimplify_expr(), gimplify_self_mod_expr(), and gimplify_switch_expr().
|
inlinestatic |
Shorter alias name for the above function for use in gimplify.c only.
References gimple_seq_add_stmt_without_update().
Referenced by 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_range(), gimplify_loop_expr(), gimplify_modify_expr(), gimplify_modify_expr_complex_part(), gimplify_modify_expr_to_memcpy(), gimplify_modify_expr_to_memset(), gimplify_omp_atomic(), gimplify_omp_for(), gimplify_omp_parallel(), gimplify_omp_task(), gimplify_omp_workshare(), gimplify_return_expr(), gimplify_switch_expr(), and gimplify_transaction().
|
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, tsi_delink(), tsi_end_p(), tsi_start(), tsi_stmt_ptr(), and voidify_wrapper_expr().
Referenced by gimplify_expr().
bool gimplify_stmt | ( | ) |
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(), and last.
|
static |
Gimplify a SWITCH_EXPR, and collect the vector of labels it can branch to.
References build_case_label(), gimplify_ctx::case_labels, create_artificial_label(), fb_rvalue, gimple_build_label(), gimple_build_switch(), gimplify_expr(), gimplify_seq_add_seq(), gimplify_seq_add_stmt(), gimplify_stmt(), GS_ALL_DONE, GS_ERROR, GS_UNHANDLED, is_gimple_val(), and preprocess_case_label_vec_for_gimple().
Referenced by gimplify_expr().
|
static |
Gimplify a TARGET_EXPR which doesn't appear on the rhs of an INIT_EXPR.
References build_constructor(), fb_none, ggc_free(), gimple_add_tmp_var(), gimple_push_cleanup(), gimplify_and_add(), gimplify_expr(), gimplify_type_sizes(), gimplify_vla_decl(), GS_ERROR, GS_OK, gimplify_ctx::in_cleanup_point_expr, init_expr(), is_gimple_stmt(), needs_to_live_in_memory(), and SR_ALL.
Referenced by gimplify_expr().
|
static |
Gimplify a TRANSACTION_EXPR. This involves gimplification of the body, and adding some EH bits.
References g, gimple_build_transaction(), gimple_transaction_set_subcode(), gimplify_and_return_first(), gimplify_seq_add_stmt(), GS_ALL_DONE, GS_OK, pop_gimplify_context(), push_gimplify_context(), and voidify_wrapper_expr().
Referenced by gimplify_expr().
void gimplify_type_sizes | ( | ) |
Look through TYPE for variable-sized objects and gimplify each such size that we find. Add to LIST_P any statements generated.
References gimplify_one_sizepos(), and gimplify_type_sizes().
|
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 copy(), copy_node(), current_function_decl, decl_function_context(), lang_hooks::dup_lang_specific_decl, gimplify_omp_ctxp, GS_ALL_DONE, GS_ERROR, GS_OK, omp_notice_variable(), ORT_SIMD, ORT_WORKSHARE, gimplify_omp_ctx::outer_context, pointer_set_insert(), gimplify_omp_ctx::region_type, seen_error(), and unshare_expr().
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 build_call_expr_loc(), build_fold_addr_expr_loc(), builtin_decl_implicit(), GS_OK, and unshare_expr().
Referenced by gimplify_expr().
|
static |
Gimplify a variable-length array DECL.
References build_call_expr(), build_pointer_type(), builtin_decl_explicit(), create_tmp_var(), get_name(), gimplify_and_add(), gimplify_one_sizepos(), and gimplify_ctx::save_stack.
Referenced by gimplify_decl_expr(), and gimplify_target_expr().
|
static |
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 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 fb_rvalue, gimplify_expr(), gimplify_stmt(), goa_lhs_expr_p(), GS_ALL_DONE, is_gimple_val(), tcc_binary, tcc_comparison, tcc_expression, and tcc_unary.
Referenced by gimplify_omp_atomic().
|
static |
Helper for get_formal_tmp_var and get_initialized_tmp_var.
References fb_rvalue, ggc_free(), gimplify_and_add(), gimplify_expr(), gimplify_ctx::into_ssa, is_gimple_reg_rhs_or_call(), is_gimple_reg_type(), lookup_tmp_var(), make_ssa_name(), and unshare_expr().
Referenced by get_formal_tmp_var(), and get_initialized_tmp_var().
|
static |
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(), and is_gimple_val().
Referenced by gimplify_expr(), and gimplify_init_ctor_preeval().
|
static |
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(), and is_gimple_val().
Referenced by gimplify_expr(), and rhs_predicate_for().
|
static |
Returns true iff T is a valid RHS for an assignment to a renamed user -- or front-end generated artificial -- variable.
References get_gimple_rhs_class(), and GIMPLE_INVALID_RHS.
Referenced by force_gimple_operand(), force_gimple_operand_gsi(), and gimplify_expr().
|
static |
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(), and GIMPLE_INVALID_RHS.
Referenced by gimplify_expr(), internal_get_tmp_var(), and rhs_predicate_for().
|
static |
Return true if T looks like a valid GIMPLE statement.
Referenced by gimplify_expr(), gimplify_save_expr(), gimplify_stmt(), and gimplify_target_expr().
|
static |
Create a temporary to hold the value of VAL. If IS_FORMAL, try to reuse an existing expression temporary.
References hash_table< Descriptor, Allocator >::create(), create_tmp_from_val(), hash_table< Descriptor, Allocator >::find_slot(), hash_table< Descriptor, Allocator >::is_created(), gimple_temp_hash_elt::temp, gimplify_ctx::temp_htab, and gimple_temp_hash_elt::val.
Referenced by internal_get_tmp_var().
void mark_addressable | ( | ) |
Mark X addressable. Unlike the langhook we expect X to be in gimple form and we don't do any syntax checking.
References cfun, gimple_df::decls_to_pointers, function::gimple_df, handled_component_p(), and pointer_map_contains().
Referenced by create_iv(), emit_block_move_hints(), emit_library_call_value_1(), expand_asm_operands(), gimplify_addr_expr(), gimplify_asm_expr(), gimplify_expr(), gimplify_modify_expr_rhs(), gimplify_modify_expr_to_memcpy(), initialize_argument_information(), and instrument_builtin_call().
|
static |
If *EXPR_P has a variable sized type, wrap it in a WITH_SIZE_EXPR.
References unshare_expr().
Referenced by gimplify_arg(), gimplify_init_ctor_preeval(), and gimplify_modify_expr().
|
static |
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 copy_tree_r(), pointer_set_insert(), tcc_constant, tcc_declaration, and tcc_type.
Referenced by copy_if_shared_r(), unshare_expr(), and unshare_expr_without_location().
|
staticread |
Create a new omp construct that deals with variable remapping.
References gimplify_omp_ctx::default_kind, gimplify_omp_ctxp, input_location, gimplify_omp_ctx::location, OMP_CLAUSE_DEFAULT_SHARED, OMP_CLAUSE_DEFAULT_UNSPECIFIED, ORT_TASK, gimplify_omp_ctx::outer_context, pointer_set_create(), gimplify_omp_ctx::privatized_types, gimplify_omp_ctx::region_type, splay_tree_compare_decl_uid(), and gimplify_omp_ctx::variables.
Referenced by gimplify_scan_omp_clauses().
|
static |
|
static |
Add an entry for DECL in the OpenMP context CTX with FLAGS.
References lang_hooks::decls, GOVD_DATA_SHARE_CLASS, GOVD_DEBUG_PRIVATE, GOVD_EXPLICIT, GOVD_FIRSTPRIVATE, GOVD_LASTPRIVATE, GOVD_LOCAL, GOVD_PRIVATE, GOVD_SEEN, GOVD_SHARED, omp_add_variable(), omp_firstprivatize_type_sizes(), omp_firstprivatize_variable(), omp_notice_variable(), lang_hooks_for_decls::omp_privatize_by_reference, and gimplify_omp_ctx::variables.
|
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 lang_hooks::decls, GOVD_SHARED, is_global_var(), lang_hooks_for_decls::omp_privatize_by_reference, ORT_SIMD, ORT_WORKSHARE, gimplify_omp_ctx::outer_context, gimplify_omp_ctx::region_type, and gimplify_omp_ctx::variables.
Referenced by gimplify_scan_omp_clauses().
|
static |
Similarly for each of the type sizes of TYPE.
References lang_hooks_for_types::omp_firstprivatize_type_sizes, omp_firstprivatize_variable(), pointer_set_insert(), gimplify_omp_ctx::privatized_types, and lang_hooks::types.
Referenced by omp_add_variable().
void omp_firstprivatize_variable | ( | ) |
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 GOVD_FIRSTPRIVATE, GOVD_SEEN, GOVD_SHARED, omp_add_variable(), ORT_SIMD, ORT_WORKSHARE, gimplify_omp_ctx::outer_context, gimplify_omp_ctx::region_type, and gimplify_omp_ctx::variables.
|
static |
Verify that DECL is private within CTX. If there's specific information to the contrary in the innermost scope, generate an error.
References error(), GOVD_EXPLICIT, GOVD_FIRSTPRIVATE, GOVD_LASTPRIVATE, GOVD_LINEAR, GOVD_PRIVATE, GOVD_REDUCTION, GOVD_SHARED, ORT_COMBINED_PARALLEL, ORT_SIMD, ORT_WORKSHARE, gimplify_omp_ctx::outer_context, gimplify_omp_ctx::region_type, and gimplify_omp_ctx::variables.
Referenced by gimplify_omp_for().
|
static |
Notice a threadprivate variable DECL used in OpenMP 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 error(), error_at(), gimplify_omp_ctx::location, ORT_UNTIED_TASK, gimplify_omp_ctx::region_type, and gimplify_omp_ctx::variables.
Referenced by omp_notice_variable().
|
static |
|
static |
Record the fact that DECL was used within the OpenMP 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, lang_hooks::decls, gimplify_omp_ctx::default_kind, error(), error_at(), get_base_address(), GOVD_DATA_SHARE_CLASS, GOVD_FIRSTPRIVATE, GOVD_LOCAL, GOVD_PRIVATE, GOVD_PRIVATE_OUTER_REF, GOVD_SEEN, GOVD_SHARED, is_global_var(), gimplify_omp_ctx::location, omp_add_variable(), OMP_CLAUSE_DEFAULT_FIRSTPRIVATE, OMP_CLAUSE_DEFAULT_NONE, OMP_CLAUSE_DEFAULT_PRIVATE, OMP_CLAUSE_DEFAULT_SHARED, OMP_CLAUSE_DEFAULT_UNSPECIFIED, lang_hooks_for_decls::omp_disregard_value_expr, omp_notice_threadprivate_variable(), omp_notice_variable(), lang_hooks_for_decls::omp_predetermined_sharing, lang_hooks_for_decls::omp_private_outer_ref, lang_hooks_for_decls::omp_report_decl, ORT_PARALLEL, ORT_SIMD, ORT_TASK, ORT_WORKSHARE, gimplify_omp_ctx::outer_context, gimplify_omp_ctx::region_type, and gimplify_omp_ctx::variables.
|
static |
Optimize embedded COMPOUND_LITERAL_EXPRs within a CONSTRUCTOR, return a new CONSTRUCTOR if something changed.
References copy_node(), vec_safe_copy(), and vec_safe_length().
Referenced by gimplify_init_constructor().
void pop_gimplify_context | ( | ) |
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, declare_vars(), hash_table< Descriptor, Allocator >::dispose(), gimplify_ctxp, hash_table< Descriptor, Allocator >::is_created(), gimplify_ctx::prev_context, record_vars(), gimplify_ctx::temp_htab, and gimplify_ctx::temps.
|
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 get_initialized_tmp_var(), handled_component_p(), and is_gimple_reg().
Referenced by gimplify_addr_expr(), and gimplify_modify_expr_to_memcpy().
void preprocess_case_label_vec_for_gimple | ( | vec< tree > | labels, |
tree | index_type, | ||
tree * | default_casep | ||
) |
Prepare a vector of case labels to be used in a GIMPLE_SWITCH statement. LABELS is a vector that contains all case labels to look at. INDEX_TYPE is the type of the switch index expression. Case labels in LABELS are discarded if their values are not in the value range covered by INDEX_TYPE. The remaining case label values are folded to INDEX_TYPE. If a default case exists in LABELS, it is removed from LABELS and returned in DEFAULT_CASEP. If no default case exists, but the case labels already cover the whole range of INDEX_TYPE, a default case is returned pointing to one of the existing case labels. Otherwise DEFAULT_CASEP is set to NULL_TREE. DEFAULT_CASEP may be NULL, in which case the above comment doesn't apply and no action is taken regardless of whether a default case is found or not.
References build_case_label(), len, sort_case_labels(), tree_int_cst_compare(), and tree_int_cst_equal().
Referenced by gimplify_switch_expr(), and simplify_gimple_switch_label_vec().
|
static |
Worker for unshare_expr_without_location.
Referenced by unshare_expr_without_location().
void push_gimplify_context | ( | ) |
Set up a context for the gimplifier.
References gimplify_ctxp, memset(), and gimplify_ctx::prev_context.
|
inlinestatic |
Strip off a legitimate source ending from the input string NAME of length LEN. Rather than having to know the names used by all of our front ends, we strip off an ending of a period followed by up to five characters. (Java uses ".class".)
Referenced by create_tmp_var_name().
gimple_predicate rhs_predicate_for | ( | ) |
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().
|
static |
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.
References append_to_statement_list(), block_may_fallthru(), build_and_jump(), expr_last(), last, and shortcut_cond_r().
Referenced by gimplify_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. 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(), and build_and_jump().
Referenced by shortcut_cond_expr().
|
static |
Determine whether to assign a location to the statement GS.
Referenced by annotate_one_with_location().
void sort_case_labels | ( | ) |
Sort the case labels in LABEL_VEC in place in ascending order.
References compare_case_labels().
|
static |
A stable comparison routine for use with splay trees and DECLs.
Referenced by new_omp_context().
|
inlinestatic |
Unmark the visited trees rooted at *TP.
References unmark_visited_r().
Referenced by unvisit_body().
|
static |
Callback for walk_tree to unmark the visited trees rooted at *TP. Subtrees are walked until the first unvisited node is encountered.
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 cgraph_get_node(), copy_if_shared(), symtab_node_base::decl, lang_hooks::deep_unsharing, cgraph_node::nested, cgraph_node::next_nested, pointer_set_create(), pointer_set_destroy(), cgraph_node::symbol, and visited.
Referenced by gimplify_body().
tree unshare_expr | ( | ) |
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().
Referenced by analyze_ref(), build_check_stmt(), build_debug_ref_for_model(), build_ref_for_offset(), ccp_fold_stmt(), combine_cond_exprs(), combine_conversions(), cond_store_replacement(), copy_tree_body_r(), create_expression_by_pieces(), create_new_iv(), determine_exit_conditions(), execute_sm(), execute_sm_if_changed(), expand_complex_move(), expand_omp_atomic_mutex(), expand_omp_for_init_counts(), expand_omp_for_static_chunk(), expand_omp_for_static_nochunk(), extract_component(), find_interesting_uses_address(), find_phi_replacement_condition(), fold_ctor_reference(), fold_vec_perm(), forward_propagate_addr_expr_1(), forward_propagate_comparison(), forward_propagate_into_cond(), forward_propagate_into_gimple_cond(), gen_parallel_loop(), get_initial_def_for_induction(), get_string_length(), get_symbol_constant_value(), gimple_copy(), gimple_fold_stmt_to_constant_1(), gimple_gen_edge_profiler(), gimple_gen_ic_profiler(), gimple_ic(), gimplify_asm_expr(), gimplify_compound_lval(), gimplify_init_constructor(), gimplify_init_ctor_eval(), gimplify_init_ctor_eval_range(), gimplify_modify_expr(), gimplify_modify_expr_rhs(), gimplify_one_sizepos(), gimplify_var_or_parm_decl(), gimplify_variable_sized_compare(), handle_builtin_strcat(), handle_builtin_strchr(), handle_builtin_strcpy(), handle_builtin_strlen(), insert_debug_temp_for_var_def(), insert_into_preds_of_block(), insert_out_of_ssa_copy(), insert_out_of_ssa_copy_on_edge(), instantiate_array_ref(), instrument_expr(), instrument_mem_region_access(), internal_get_tmp_var(), ipa_modify_call_arguments(), ipa_set_jf_constant(), issue_prefetch_ref(), lower_omp_for_lastprivate(), lower_rec_input_clauses(), maybe_move_debug_stmts_to_successors(), maybe_with_size_expr(), mf_build_check_statement_for(), phiprop_insert_phi(), predicate_bbs(), predicate_mem_writes(), predicate_scalar_phi(), propagate_expr_outside_region(), propagate_tree_value(), ref_at_iteration(), remap_decl(), remap_ssa_name(), remove_dead_stmt(), remove_forwarder_block(), rename_uses(), replace_exp_1(), replace_ref_with(), rewrite_close_phi_out_of_ssa(), rewrite_phi_out_of_ssa(), rewrite_phi_with_iv(), rewrite_use_compare(), scev_const_prop(), set_prologue_iterations(), simplify_bitfield_ref(), simplify_permutation(), simplify_replace_tree(), slpeel_tree_peel_loop_to_edge(), split_function(), sra_modify_assign(), take_address_of(), tm_log_emit_restores(), tm_log_emit_saves(), translate_scalar_reduction_to_array(), translate_scalar_reduction_to_array_for_stmt(), tree_unswitch_loop(), unshare_aff_combination(), vect_analyze_data_refs(), vect_build_loop_niters(), vect_create_addr_base_for_vector_ref(), vect_is_simple_iv_evolution(), vect_recog_mixed_size_cond_pattern(), vect_update_ivs_after_vectorizer(), vectorizable_load(), vectorizable_store(), and visit_use().
tree unshare_expr_without_location | ( | ) |
Similar to unshare_expr but also prune all expression locations from EXPR.
References mostly_copy_tree_r(), and prune_expr_location().
Referenced by build_constructors(), create_access_replacement(), determine_known_aggregate_parts(), ipa_set_jf_arith_pass_through(), and ipa_set_jf_constant().
|
static |
Likewise, but mark all trees as not visited.
References cgraph_get_node(), symtab_node_base::decl, cgraph_node::nested, cgraph_node::next_nested, cgraph_node::symbol, and unmark_visited().
Referenced by gimplify_body().
tree voidify_wrapper_expr | ( | ) |
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 create_tmp_var(), tsi_end_p(), tsi_last(), and tsi_stmt_ptr().
|
static |
Return true if FDECL is accessing a field that is zero sized.
References integer_zerop().
Referenced by gimplify_init_ctor_eval().
|
static |
Return true if TYPE is zero sized.
References integer_zerop().
Referenced by gimplify_modify_expr().
|
static |
Referenced by pop_gimplify_context(), and push_gimplify_context().
|
static |
|
static |
Nonlocal VLAs seen in the current function.
|
static |
Create a new temporary name with PREFIX. Return an identifier.