GCC Middle and Back End API Reference
|
Go to the source code of this file.
Return true if CODE is an operation that when operating on signed integer types involves undefined behavior on overflow and the operation can be expressed with unsigned arithmetic.
Referenced by final_value_replacement_loop(), if_convertible_gimple_assign_stmt_p(), ifcombine_rewrite_to_defined_overflow(), move_computations_worker(), predicate_statements(), split_loop(), and update_range_test().
CVAL is value taken from DECL_INITIAL of variable. Try to transform it into acceptable form for is_gimple_min_invariant. FROM_DECL (if non-NULL) specify variable whose constructor contains CVAL.
References build1_loc(), build_fold_addr_expr, can_refer_decl_in_current_unit_p(), COMPOUND_LITERAL_EXPR_DECL, CONSTANT_CLASS_P, drop_tree_overflow(), error_mark_node, EXPR_LOCATION, fold_build2, fold_convert, get_base_address(), cgraph_node::get_create(), is_gimple_min_invariant(), NULL_TREE, ptr_type_node, STRIP_NOPS, TREE_CODE, TREE_OPERAND, TREE_OVERFLOW_P, TREE_TYPE, useless_type_conversion_p(), VAR_OR_FUNCTION_DECL_P, and VAR_P.
Referenced by fold_ctor_reference(), get_symbol_constant_value(), ipa_make_edge_direct_to_target(), and record_reference().
Gimple folding definitions. Copyright (C) 2011-2024 Free Software Foundation, Inc. Contributed by Richard Guenther <rguenther@suse.de> 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/>.
Create a temporary for TYPE for a statement STMT. If the current function is in SSA form, a SSA name is created. Otherwise a temporary register is made.
References cfun, create_tmp_reg(), gimple_in_ssa_p(), and make_ssa_name().
Referenced by copy_bb(), gimple_build(), gimple_build(), gimple_build(), gimple_build(), gimple_build(), gimple_build(), gimple_build(), gimple_fold_builtin_memory_op(), gimple_fold_builtin_strcat(), gimple_fold_builtin_strchr(), gimple_fold_builtin_string_compare(), and gimple_load_first_char().
|
extern |
Fold r = __atomic_compare_exchange_N (p, &e, d, w, s, f); into _Complex uintN_t t = ATOMIC_COMPARE_EXCHANGE (p, e, d, w * 256 + N, s, f); i = IMAGPART_EXPR <t>; r = (_Bool) i; e = REALPART_EXPR <t>;
References as_a(), build1(), build_complex_type(), build_int_cst(), cfun, find_fallthru_edge(), g, gimple_assign_lhs(), gimple_build_assign(), gimple_build_call_internal(), gimple_call_arg(), gimple_call_fndecl(), gimple_call_lhs(), gimple_call_nothrow_p(), gimple_call_set_lhs(), gimple_call_set_nothrow(), gimple_move_vops(), gsi_bb(), gsi_for_stmt(), gsi_insert_after(), gsi_insert_before(), gsi_insert_on_edge_immediate(), GSI_NEW_STMT, gsi_replace(), GSI_SAME_STMT, gsi_stmt(), int_size_in_bytes(), integer_onep(), integer_type_node, make_ssa_name(), NULL, NULL_TREE, stmt_can_throw_internal(), basic_block_def::succs, TREE_CHAIN, TREE_OPERAND, TREE_TYPE, TREE_VALUE, TYPE_ARG_TYPES, and useless_type_conversion_p().
Referenced by execute_update_addresses_taken().
References fold_const_aggregate_ref_1(), and NULL.
Referenced by gimple_fold_builtin_memory_op(), strlen_pass::handle_builtin_memcmp(), and maybe_fold_reference().
Return the tree representing the element referenced by T if T is an ARRAY_REF or COMPONENT_REF into constant aggregates valuezing SSA names using VALUEIZE. Return NULL_TREE otherwise.
References array_ref_element_size(), array_ref_low_bound(), build_zero_cst(), DECL_BIT_FIELD, DECL_BIT_FIELD_REPRESENTATIVE, DECL_FIELD_BIT_OFFSET, DECL_FIELD_OFFSET, DECL_P, DECL_SIZE, error_mark_node, EXPR_LOCATION, fold_build1_loc(), fold_const_aggregate_ref_1(), fold_ctor_reference(), fold_read_from_constant_string(), get_base_constructor(), get_ref_base_and_extent(), get_symbol_constant_value(), INTEGRAL_TYPE_P, poly_int< N, C >::is_constant(), wi::lrshift(), NULL_TREE, offset, poly_int_tree_p(), wi::sext(), sizetype, wi::to_poly_offset(), poly_int< N, C >::to_shwi(), wi::to_wide(), TREE_CODE, tree_fits_uhwi_p(), TREE_OPERAND, TREE_THIS_VOLATILE, tree_to_uhwi(), TREE_TYPE, TYPE_PRECISION, and wide_int_to_tree().
Referenced by fold_const_aggregate_ref(), fold_const_aggregate_ref_1(), and gimple_fold_stmt_to_constant_1().
|
extern |
CTOR is a value initializing memory. Fold a reference of TYPE and bit size POLY_SIZE to the memory at bit POLY_OFFSET. When POLY_SIZE is zero, attempt to fold a reference to the entire subobject which OFFSET refers to. This is used when folding accesses to string members of aggregates. When non-null, set *SUBOFF to the bit offset of the accessed subobject.
References AGGREGATE_TYPE_P, can_native_interpret_type_p(), canonicalize_constructor_val(), CONSTANT_CLASS_P, fold_array_ctor_reference(), fold_nonarray_ctor_reference(), fold_unary, INT_MAX, poly_int< N, C >::is_constant(), known_eq, native_encode_expr(), native_encode_initializer(), native_interpret_expr(), NULL_TREE, offset, STRIP_USELESS_TYPE_CONVERSION, wi::to_poly_widest(), TREE_CODE, TREE_TYPE, TYPE_REVERSE_STORAGE_ORDER, TYPE_SIZE, unshare_expr(), and useless_type_conversion_p().
Referenced by constant_byte_string(), fold_array_ctor_reference(), fold_const_aggregate_ref_1(), fold_nonarray_ctor_reference(), and fully_constant_vn_reference_p().
|
extern |
Fold the statement pointed to by GSI. In some cases, this function may replace the whole statement with a new one. Returns true iff folding makes any changes. The statement pointed to by GSI should be in valid gimple form but may be in unfolded state as resulting from for example constant propagation which can produce *&x = 0.
References fold_stmt_1(), and no_follow_ssa_edges().
Referenced by substitute_and_fold_dom_walker::before_dom_children(), bump_vector_ptr(), convert_mult_to_fma_1(), eliminate_dom_walker::eliminate_stmt(), execute_early_expand_coro_ifns(), fold_marked_statements(), forward_propagate_into_comparison(), generate_memcpy_builtin(), generate_memset_builtin(), gimple_fold_builtin_bzero(), gimple_fold_builtin_memory_op(), gimple_fold_builtin_snprintf(), gimple_fold_builtin_snprintf_chk(), gimple_fold_builtin_sprintf(), gimple_fold_builtin_sprintf_chk(), gimple_fold_builtin_stpcpy(), gimple_fold_builtin_strcat(), gimple_fold_builtin_strchr(), lower_omp(), lower_stmt(), maybe_fold_stmt(), dom_opt_dom_walker::optimize_stmt(), predicate_scalar_phi(), replace_call_with_call_and_fold(), replace_uses_by(), simplify_using_ranges::simplify(), simplify_using_ranges::simplify_abs_using_ranges(), simplify_bitfield_ref(), simplify_conversion_using_ranges(), simplify_using_ranges::simplify_div_or_mod_using_ranges(), simplify_using_ranges::simplify_float_conversion_using_ranges(), and simplify_using_ranges::simplify_truth_ops_using_ranges().
|
extern |
References fold_stmt_1().
|
extern |
Perform the minimal folding on statement *GSI. Only operations like *&x created by constant propagation are handled. The statement cannot be replaced with a new one. Return true if the statement was changed, false otherwise. The statement *GSI should be in valid gimple form but may be in unfolded state as resulting from for example constant propagation which can produce *&x = 0.
References changed, fold_stmt_1(), gcc_assert, gsi_stmt(), and no_follow_ssa_edges().
Referenced by create_expression_by_pieces(), forward_propagate_addr_expr_1(), insert_debug_temp_for_var_def(), optimize_recip_sqrt(), replace_reciprocal(), replace_reciprocal_squares(), and update_ops().
Valueization callback that follows all SSA edges.
Referenced by bump_vector_ptr(), convert_mult_to_fma_1(), eliminate_dom_walker::eliminate_stmt(), fold_build_cond_expr(), gimple_build(), gimple_build(), gimple_build(), gimple_simplify_phiopt(), maybe_fold_comparisons_from_match_pd(), predicate_bbs(), predicate_scalar_phi(), and tree_vec_extract().
Valueization callback that ends up following single-use SSA edges only.
References has_single_use(), NULL_TREE, and TREE_CODE.
Referenced by substitute_and_fold_dom_walker::before_dom_children(), fvrp_folder::fold_stmt(), rvrp_folder::fold_stmt(), simplify_using_ranges::simplify(), simplify_using_ranges::simplify_abs_using_ranges(), simplify_conversion_using_ranges(), simplify_using_ranges::simplify_div_or_mod_using_ranges(), simplify_using_ranges::simplify_float_conversion_using_ranges(), and simplify_using_ranges::simplify_truth_ops_using_ranges().
|
extern |
Try to obtain the range of the lengths of the string(s) referenced by ARG, or the size of the largest array ARG refers to if the range of lengths cannot be determined, and store all in *PDATA which must be zero-initialized on input except PDATA->MAXBOUND may be set to a non-null tree node other than INTEGER_CST to request to have it set to the length of the longest string in a PHI. ELTSIZE is the expected size of the string element in bytes: 1 for char and some power of 2 for wide characters. Return true if the range [PDATA->MINLEN, PDATA->MAXLEN] is suitable for optimization. Returning false means that a nonzero PDATA->MINLEN doesn't reflect the true lower bound of the range when PDATA->MAXLEN is -1 (in that case, the actual range is indeterminate, i.e., [0, PTRDIFF_MAX - 2].
References build_all_ones_cst(), get_range_strlen(), integer_all_onesp(), c_strlen_data::maxbound, c_strlen_data::maxlen, c_strlen_data::minlen, size_type_node, SRK_LENRANGE, ssize_int, and visited.
If SYM is a constant variable with known value, return the value. NULL_TREE is returned otherwise.
References build_zero_cst(), canonicalize_constructor_val(), ctor_for_folding(), error_mark_node, is_gimple_min_invariant(), is_gimple_reg_type(), NULL_TREE, TREE_TYPE, unshare_expr(), and useless_type_conversion_p().
Referenced by fold_const_aggregate_ref_1(), fold_gimple_assign(), get_default_value(), and gimple_fold_stmt_to_constant_1().
|
inline |
References gimple_build(), GSI_CONTINUE_LINKING, gsi_last(), and UNKNOWN_LOCATION.
|
inline |
References gimple_build(), GSI_CONTINUE_LINKING, gsi_last(), and UNKNOWN_LOCATION.
|
inline |
References gimple_build(), GSI_CONTINUE_LINKING, gsi_last(), and UNKNOWN_LOCATION.
|
inline |
References gimple_build(), GSI_CONTINUE_LINKING, and gsi_last().
|
inline |
References gimple_build(), GSI_CONTINUE_LINKING, and gsi_last().
|
inline |
References gimple_build(), GSI_CONTINUE_LINKING, and gsi_last().
|
extern |
|
extern |
|
extern |
|
extern |
|
extern |
|
extern |
|
extern |
|
extern |
gimple_build, functionally matching fold_buildN, outputs stmts int the provided sequence, matching and simplifying them on-the-fly. Supposed to replace force_gimple_operand (fold_buildN (...), ...).
Referenced by gimple_build(), gimple_build(), gimple_build(), gimple_build(), gimple_build(), and gimple_build().
|
extern |
|
extern |
|
inline |
References gimple_build_round_up(), GSI_CONTINUE_LINKING, and gsi_last().
|
inline |
References gimple_build_round_up(), GSI_CONTINUE_LINKING, gsi_last(), and UNKNOWN_LOCATION.
|
extern |
Referenced by gimple_build_round_up(), and gimple_build_round_up().
|
inline |
References gimple_build_vector(), GSI_CONTINUE_LINKING, and gsi_last().
|
inline |
References gimple_build_vector(), GSI_CONTINUE_LINKING, gsi_last(), and UNKNOWN_LOCATION.
|
extern |
Referenced by gimple_build_vector(), and gimple_build_vector().
|
inline |
References gimple_build_vector_from_val(), GSI_CONTINUE_LINKING, and gsi_last().
|
inline |
References gimple_build_vector_from_val(), GSI_CONTINUE_LINKING, gsi_last(), and UNKNOWN_LOCATION.
|
extern |
Referenced by gimple_build_vector_from_val(), and gimple_build_vector_from_val().
|
inline |
References gimple_convert(), GSI_CONTINUE_LINKING, and gsi_last().
|
inline |
References gimple_convert(), GSI_CONTINUE_LINKING, gsi_last(), and UNKNOWN_LOCATION.
|
extern |
Referenced by gimple_convert(), and gimple_convert().
|
inline |
References gimple_convert_to_ptrofftype(), GSI_CONTINUE_LINKING, and gsi_last().
|
inline |
References gimple_convert_to_ptrofftype(), GSI_CONTINUE_LINKING, gsi_last(), and UNKNOWN_LOCATION.
|
extern |
Referenced by gimple_convert_to_ptrofftype(), and gimple_convert_to_ptrofftype().
|
extern |
Simplify a call to the snprintf builtin with arguments DEST, DESTSIZE, FMT, and ORIG. ORIG may be null if this is a 3-argument call. We don't attempt to simplify calls with more than 4 arguments. Return true if simplification was possible, otherwise false.
References as_a(), build_int_cstu(), builtin_decl_implicit(), c_getstr(), cfun, fold_convert, fold_stmt(), get_maxval_strlen(), gimple_build_assign(), gimple_build_call(), gimple_call_arg(), gimple_call_lhs(), gimple_call_num_args(), gimple_in_ssa_p(), gimple_seq_add_stmt_without_update(), gimple_vdef(), gsi_prev(), gsi_replace_with_seq_vops(), gsi_stmt(), init_target_chars(), known_lower(), NULL, NULL_TREE, SRK_STRLEN, target_percent, target_percent_s, TREE_TYPE, and useless_type_conversion_p().
|
extern |
Simplify a call to the sprintf builtin with arguments DEST, FMT, and ORIG. ORIG may be null if this is a 2-argument call. We don't attempt to simplify calls with more than 3 arguments. Return true if simplification was possible, otherwise false.
References build_int_cst(), builtin_decl_implicit(), c_getstr(), cfun, copy_warning(), fold_convert, fold_stmt(), get_maxval_strlen(), gimple_build_assign(), gimple_build_call(), gimple_call_arg(), gimple_call_lhs(), gimple_call_num_args(), gimple_in_ssa_p(), gimple_seq_add_stmt_without_update(), gimple_vdef(), gsi_prev(), gsi_replace_with_seq_vops(), gsi_stmt(), init_target_chars(), NULL, NULL_TREE, POINTER_TYPE_P, SRK_STRLEN, target_percent, target_percent_s, TREE_TYPE, and useless_type_conversion_p().
Given a pointer value T, return a simplified version of an indirection through T, 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 bitsize_int, build1(), build4(), DECL_P, fold_build1, fold_build2, fold_build3, gimple_fold_indirect_ref(), known_lt, NULL_TREE, offset, POINTER_TYPE_P, size_zero_node, STRIP_NOPS, wi::to_wide(), TREE_CODE, tree_fits_uhwi_p(), tree_int_cst_equal(), TREE_OPERAND, tree_to_shwi(), tree_to_uhwi(), TREE_TYPE, TYPE_DOMAIN, TYPE_MIN_VALUE, TYPE_REF_CAN_ALIAS_ALL, TYPE_SIZE, TYPE_SIZE_UNIT, TYPE_VECTOR_SUBPARTS(), useless_type_conversion_p(), and wide_int_to_tree().
Referenced by copy_tree_body_r(), expand_thunk(), gimple_fold_indirect_ref(), gimple_fold_indirect_ref_rhs(), and maybe_make_indirect().
Fold STMT to a constant using VALUEIZE to valueize SSA names. Returns NULL_TREE if folding to a constant is not possible, otherwise returns a constant according to is_gimple_min_invariant.
References gimple_fold_stmt_to_constant_1(), is_gimple_min_invariant(), and NULL_TREE.
Referenced by object_sizes_execute().
|
extern |
Fold STMT to a constant using VALUEIZE to valueize SSA names. Either NULL_TREE, a simplified but non-constant or a constant is returned. ??? This should go into a gimple-fold-inline.h file to be eventually privatized with the single valueize function used in the various TUs to avoid the indirect function call overhead.
References as_a(), build1_loc(), build_invariant_address(), build_zero_cst(), CONSTANT_CLASS_P, CONSTRUCTOR_ELTS, CONSTRUCTOR_NELTS, decl_address_invariant_p(), dump_file, dump_flags, EXPR_LOCATION, fndecl_built_in_p(), fold_binary_loc(), fold_build2, fold_builtin_call_array(), fold_const_aggregate_ref_1(), fold_convert, fold_ternary_loc(), fold_unary_loc(), FOR_EACH_CONSTRUCTOR_VALUE, gcc_unreachable, get_addr_base_and_unit_offset_1(), get_gimple_rhs_class(), get_symbol_constant_value(), gimple_assign_lhs(), gimple_assign_rhs1(), gimple_assign_rhs2(), gimple_assign_rhs3(), gimple_assign_rhs_code(), GIMPLE_BINARY_RHS, gimple_builtin_call_types_compatible_p(), gimple_call_arg(), gimple_call_fn(), gimple_call_internal_fn(), gimple_call_internal_p(), gimple_call_num_args(), gimple_call_return_type(), gimple_location(), gimple_simplified_result_is_gimple_val(), gimple_simplify(), GIMPLE_SINGLE_RHS, GIMPLE_TERNARY_RHS, GIMPLE_UNARY_RHS, i, integer_onep(), integer_zerop(), is_gimple_min_invariant(), known_eq, mprts_hook, NULL, NULL_TREE, OBJ_TYPE_REF_EXPR, offset, operand_equal_p(), gimple_match_op::ops, print_generic_expr(), print_gimple_expr(), ptr_type_node, STRIP_NOPS, tcc_declaration, tcc_reference, TDF_DETAILS, TDF_SLIM, TREE_CODE, TREE_CODE_CLASS, TREE_OPERAND, TREE_OVERFLOW, TREE_TYPE, TYPE_VECTOR_SUBPARTS(), unshare_expr(), and useless_type_conversion_p().
Referenced by back_propagate_equivalences(), ccp_fold(), copy_prop_visit_assignment(), gimple_fold_stmt_to_constant(), jt_state::register_equivs_stmt(), try_to_simplify(), pointer_equiv_analyzer::visit_stmt(), and visit_stmt().
|
extern |
Return a declaration of a function which an OBJ_TYPE_REF references. TOKEN is integer form of OBJ_TYPE_REF_TOKEN of the reference expression. KNOWN_BINFO carries the binfo describing the true type of OBJ_TYPE_REF_OBJECT(REF). Set CAN_REFER if non-NULL to false if method is not referable or if the virtual table is ill-formed (such as rewriten by non-C++ produced symbol). Otherwise just return NULL in that calse.
References BINFO_VTABLE, gimple_get_virt_method_for_vtable(), NULL_TREE, offset, and vtable_pointer_value_to_vtable().
Referenced by possible_polymorphic_call_targets(), record_target_from_binfo(), and record_targets_from_bases().
|
extern |
Lookup virtual method with index TOKEN in a virtual table V at OFFSET. Set CAN_REFER if non-NULL to false if method is not referable or if the virtual table is ill-formed (such as rewriten by non-C++ produced symbol). Otherwise just return NULL in that calse.
References builtin_decl_unreachable(), can_refer_decl_in_current_unit_p(), CONSTRUCTOR_ELT, CONSTRUCTOR_NELTS, ctor_for_folding(), DECL_VIRTUAL_P, error_mark_node, gcc_assert, gcc_checking_assert, cgraph_node::get_create(), integer_zerop(), NULL, NULL_TREE, offset, STRIP_NOPS, TREE_CODE, TREE_OPERAND, tree_to_uhwi(), TREE_TYPE, TYPE_DOMAIN, TYPE_MIN_VALUE, TYPE_SIZE, TYPE_SIZE_UNIT, and VAR_P.
Referenced by gimple_get_virt_method_for_binfo(), ipa_get_indirect_edge_target_1(), and try_make_edge_direct_virtual_call().
|
extern |
Builtin or internal function with one argument.
References CONSTANT_CLASS_P, constant_for_folding(), fold_const_call(), gimple_simplify(), maybe_push_res_to_seq(), and NULL_TREE.
|
extern |
Builtin or internal function with two arguments.
References CONSTANT_CLASS_P, constant_for_folding(), fold_const_call(), gimple_simplify(), maybe_push_res_to_seq(), and NULL_TREE.
|
extern |
Builtin or internal function with three arguments.
References CONSTANT_CLASS_P, constant_for_folding(), fold_const_call(), gimple_simplify(), maybe_push_res_to_seq(), and NULL_TREE.
|
extern |
In gimple-match.cc.
Public API overloads follow for operation being tree_code or built_in_function and for one to three operands or arguments. They return NULL_TREE if nothing could be simplified or the resulting simplified value with parts pushed to SEQ. If SEQ is NULL then if the simplification needs to create new stmts it will fail. If VALUEIZE is non-NULL then all SSA names will be valueized using that hook prior to applying simplifications.
Unary ops.
Functions that are needed by gimple-match but that are exported and used in other places in the compiler.
Public API overloads follow for operation being tree_code or built_in_function and for one to three operands or arguments. They return NULL_TREE if nothing could be simplified or the resulting simplified value with parts pushed to SEQ. If SEQ is NULL then if the simplification needs to create new stmts it will fail. If VALUEIZE is non-NULL then all SSA names will be valueized using that hook prior to applying simplifications.
Unary ops.
References const_unop(), CONSTANT_CLASS_P, constant_for_folding(), gimple_simplify(), maybe_push_res_to_seq(), and NULL_TREE.
Referenced by cleanup_control_expr_graph(), fold_stmt_1(), gimple_build(), gimple_build(), gimple_build(), gimple_build(), gimple_build(), gimple_build(), gimple_fold_stmt_to_constant_1(), and process_bb().
|
extern |
Ternary ops.
References commutative_ternary_tree_code(), CONSTANT_CLASS_P, constant_for_folding(), fold_ternary, gimple_simplify(), maybe_push_res_to_seq(), NULL_TREE, tree_swap_operands_p(), and type().
Return true if the floating-point value computed by STMT is known to have an integer value. We also allow +Inf, -Inf and NaN to be considered integer values. Return false for signaling NaN. DEPTH is the current nesting depth of the query.
References gimple_assign_integer_valued_real_p(), gimple_call_integer_valued_real_p(), and gimple_phi_integer_valued_real_p().
Referenced by integer_valued_real_single_p().
Return true if STMT is known to compute a non-negative value. If the return value is based on the assumption that signed overflow is undefined, set *STRICT_OVERFLOW_P to true; otherwise, don't change *STRICT_OVERFLOW_P. DEPTH is the current nesting depth of the query.
References get_global_range_query(), gimple_assign_nonnegative_warnv_p(), gimple_call_nonnegative_warnv_p(), gimple_phi_nonnegative_warnv_p(), gimple_range_type(), r, and frange::supports_p().
Referenced by fold_using_range::fold_stmt(), fold_using_range::range_of_call(), and tree_single_nonnegative_warnv_p().
|
extern |
Convert EXPR into a GIMPLE value suitable for substitution on the RHS of an assignment. Insert the necessary statements before iterator *SI_P. The statement at *SI_P, which must be a GIMPLE_CALL is replaced. If the call is expected to produces a result, then it is replaced by an assignment of the new RHS to the result variable. If the result is to be ignored, then the call is replaced by a GIMPLE_NOP. A proper VDEF chain is retained by making the first VUSE and the last VDEF of the whole sequence be the same as the replaced statement and using new SSA names for stores in between.
References CALL_EXPR_ARG, CALL_EXPR_FN, call_expr_nargs, cfun, finish_update_gimple_call(), force_gimple_operand(), gcc_assert, gimple_build_assign(), gimple_build_call_vec(), gimple_build_nop(), gimple_call_lhs(), gimple_in_ssa_p(), gimple_seq_empty_p(), gimplify_and_add(), GSI_CONTINUE_LINKING, gsi_insert_after_without_update(), gsi_last(), gsi_replace(), gsi_replace_with_seq_vops(), gsi_stmt(), i, is_gimple_call(), NULL, NULL_TREE, pop_gimplify_context(), push_gimplify_context(), release_defs(), unlink_stmt_vdef(), valid_gimple_call_p(), and vNULL.
Referenced by dynamic_object_sizes_execute_one(), ccp_folder::fold_stmt(), gimple_fold_builtin(), gimple_fold_call(), strlen_pass::handle_builtin_memcmp(), strlen_pass::handle_builtin_strchr(), strlen_pass::handle_builtin_strlen(), maybe_optimize_arith_overflow(), and simplify_builtin_call().
|
extern |
Replace a statement at *SI_P with a sequence of statements in STMTS, adjusting the replacement stmts location and virtual operands. If the statement has a lhs the last stmt in the sequence is expected to assign to that lhs.
References annotate_all_with_location(), cfun, ECF_CONST, ECF_NORETURN, ECF_NOVOPS, ECF_PURE, gimple_assign_lhs(), gimple_assign_single_p(), gimple_call_flags(), gimple_has_location(), gimple_has_mem_ops(), gimple_location(), gimple_set_modified(), gimple_set_vdef(), gimple_set_vuse(), gimple_vdef(), gimple_vop(), gimple_vuse(), gsi_end_p(), gsi_last(), gsi_next(), gsi_prev(), gsi_replace_with_seq(), gsi_start(), gsi_stmt(), i, is_gimple_call(), is_gimple_reg(), make_ssa_name(), NULL, release_ssa_name(), SSA_NAME_DEF_STMT, TREE_CODE, and unlink_stmt_vdef().
Referenced by gimple_fold_builtin_bzero(), gimple_fold_builtin_memchr(), gimple_fold_builtin_snprintf(), gimple_fold_builtin_sprintf(), gimple_fold_builtin_strcat(), gimple_fold_builtin_strchr(), gimple_fold_builtin_string_compare(), gimple_fold_builtin_strstr(), gimplify_and_update_call_from_tree(), and replace_stmt_with_simplification().
|
extern |
Try to simplify the AND of two comparisons, specified by (OP1A CODE1 OP1B) and (OP2B CODE2 OP2B), respectively. If this can be simplified to a single expression (without requiring introducing more SSA variables to hold intermediate values), return the resulting tree. Otherwise return NULL_TREE. If the result expression is non-null, it has boolean type.
References and_comparisons_1(), maybe_fold_comparisons_from_match_pd(), and NULL_TREE.
Referenced by and_var_with_comparison_1(), eliminate_redundant_comparison(), ifcombine_ifandif(), optimize_vec_cond_expr(), and simplify_1b().
|
extern |
Try to simplify the OR of two comparisons, specified by (OP1A CODE1 OP1B) and (OP2B CODE2 OP2B), respectively. If this can be simplified to a single expression (without requiring introducing more SSA variables to hold intermediate values), return the resulting tree. Otherwise return NULL_TREE. If the result expression is non-null, it has boolean type.
References maybe_fold_comparisons_from_match_pd(), NULL_TREE, and or_comparisons_1().
Referenced by eliminate_redundant_comparison(), fold_or_predicates(), optimize_vec_cond_expr(), and or_var_with_comparison_1().
Valueziation callback that ends up not following SSA edges.
References NULL_TREE.
Referenced by back_propagate_equivalences(), cleanup_control_expr_graph(), fold_stmt(), and fold_stmt_inplace().
Return true if stmt is __atomic_compare_exchange_N call which is suitable for conversion into ATOMIC_COMPARE_EXCHANGE if the second argument is &var where var is only addressable because of such calls.
References auto_var_in_fn_p(), BUILT_IN_NORMAL, current_function_decl, DECL_FUNCTION_CODE(), direct_optab_handler(), GET_MODE_BITSIZE(), GET_MODE_SIZE(), gimple_call_arg(), gimple_call_builtin_p(), gimple_call_fndecl(), gimple_call_num_args(), gimple_vdef(), gimple_vuse(), int_size_in_bytes(), integer_onep(), integer_zerop(), is_gimple_reg_type(), optab_handler(), SANITIZE_ADDRESS, sanitize_flags_p(), SANITIZE_THREAD, SCALAR_FLOAT_TYPE_P, SSA_VAR_P, TREE_CHAIN, TREE_CODE, TREE_OPERAND, TREE_THIS_VOLATILE, TREE_TYPE, TREE_VALUE, TYPE_ARG_TYPES, TYPE_MODE, TYPE_PRECISION, and VECTOR_TYPE_P.
Referenced by execute_update_addresses_taken().
|
extern |
Replace the call at *GSI with the gimple value VAL.
References fold_convert, gimple_build_assign(), gimple_build_nop(), gimple_call_lhs(), gimple_vdef(), gsi_replace(), gsi_stmt(), release_ssa_name(), TREE_CODE, TREE_TYPE, unlink_stmt_vdef(), and useless_type_conversion_p().
Referenced by fold_loop_internal_call(), ccp_folder::fold_stmt(), gimple_fold_builtin_acc_on_device(), gimple_fold_builtin_fprintf(), gimple_fold_builtin_fputs(), gimple_fold_builtin_memchr(), gimple_fold_builtin_memory_chk(), gimple_fold_builtin_memset(), gimple_fold_builtin_omp_is_initial_device(), gimple_fold_builtin_printf(), gimple_fold_builtin_strcat(), gimple_fold_builtin_strcat_chk(), gimple_fold_builtin_strchr(), gimple_fold_builtin_strcpy(), gimple_fold_builtin_string_compare(), gimple_fold_builtin_strlen(), gimple_fold_builtin_strncat(), gimple_fold_builtin_strncat_chk(), gimple_fold_builtin_strncpy(), gimple_fold_builtin_strstr(), gimple_fold_builtin_stxcpy_chk(), gimple_fold_call(), handle_builtin_alloca(), strlen_pass::handle_builtin_string_cmp(), object_sizes_execute(), optimize_stack_restore(), and propagate_tree_value_into_stmt().
|
extern |
References rewrite_to_defined_overflow().
|
extern |
References gsi_stmt(), and rewrite_to_defined_overflow().
|
extern |
Extract the vector element of type TYPE at BITPOS with BITSIZE from T and return it.
References build3(), follow_all_ssa_edges(), g, gimple_build_assign(), gsi_insert_before(), gsi_insert_seq_before(), GSI_SAME_STMT, make_ssa_name(), maybe_push_res_to_seq(), NULL, gimple_match_op::resimplify(), and gimple_match_op::set_op().
Referenced by do_binop(), do_compare(), do_cond(), do_negate(), do_plus_minus(), do_unop(), do_vec_conversion(), do_vec_narrow_conversion(), expand_vector_comparison(), expand_vector_condition(), and expand_vector_conversion().
|
extern |
Update a GIMPLE_CALL statement at iterator *SI_P to call to FN with number of arguments NARGS, where the arguments in GIMPLE form follow NARGS argument.
References ap, as_a(), finish_update_gimple_call(), gcc_assert, gimple_build_call_valist(), gsi_stmt(), and is_gimple_call().
Referenced by strlen_pass::handle_builtin_memset(), strlen_pass::handle_builtin_strcat(), strlen_pass::handle_builtin_strcpy(), strlen_pass::handle_builtin_string_cmp(), and instrument_builtin_call().