|
GCC Middle and Back End API Reference
|

Go to the source code of this file.
Data Structures | |
| class | gimple_match_cond |
| class | gimple_match_op |
Functions | |
| bool | gimple_simplified_result_is_gimple_val (const gimple_match_op *op) |
| bool | gimple_extract_op (gimple *, gimple_match_op *) |
| bool | gimple_simplify (gimple *, gimple_match_op *, gimple_seq *, tree(*)(tree), tree(*)(tree)) |
| tree | maybe_push_res_to_seq (gimple_match_op *, gimple_seq *, tree res=NULL_TREE) |
| void | maybe_build_generic_op (gimple_match_op *) |
| bool | commutative_binary_op_p (code_helper, tree) |
| bool | commutative_ternary_op_p (code_helper, tree) |
| int | first_commutative_argument (code_helper, tree) |
| bool | associative_binary_op_p (code_helper, tree) |
| code_helper | canonicalize_code (code_helper, tree) |
| internal_fn | get_conditional_internal_fn (code_helper, tree) |
| int | find_different_opnum (const gimple_match_op &arg0_op, const gimple_match_op &arg1_op, tree *new_arg0, tree *new_arg1) |
| bool | factor_operation_ok (code_helper code, int opnum, tree *args, location_t *locs, size_t numargs, bool divconstok, bool ptrplusconstok) |
Variables | |
| tree(*) | mprts_hook (gimple_match_op *) |
| bool associative_binary_op_p | ( | code_helper | code, |
| tree | type ) |
Return true if CODE is a binary operation that is associative when operating on type TYPE.
References associated_internal_fn(), associative_binary_fn_p(), associative_binary_op_p(), and associative_tree_code().
Referenced by associative_binary_op_p(), and vectorizable_reduction().
| code_helper canonicalize_code | ( | code_helper | code, |
| tree | type ) |
Return a canonical form for CODE when operating on TYPE. The idea is to remove redundant ways of representing the same operation so that code_helpers can be hashed and compared for equality. The only current canonicalization is to replace built-in functions with internal functions, in cases where internal-fn.def defines such an internal function. Note that the new code_helper cannot necessarily be used in place of the original code_helper. For example, the new code_helper might be an internal function that the target does not support.
References associated_internal_fn(), and canonicalize_code().
Referenced by canonicalize_code(), check_reduction_path(), and vect_transform_reduction().
| bool commutative_binary_op_p | ( | code_helper | code, |
| tree | type ) |
Return true if CODE is a binary operation and if CODE is commutative when operating on type TYPE.
References associated_internal_fn(), commutative_binary_fn_p(), commutative_binary_op_p(), and commutative_tree_code().
Referenced by commutative_binary_op_p(), gimple_resimplify2(), and vectorizable_reduction().
| bool commutative_ternary_op_p | ( | code_helper | code, |
| tree | type ) |
Return true if CODE represents a ternary operation and if the first two operands are commutative when CODE is operating on TYPE.
References associated_internal_fn(), commutative_ternary_fn_p(), commutative_ternary_op_p(), and commutative_ternary_tree_code().
Referenced by commutative_ternary_op_p().
| bool factor_operation_ok | ( | code_helper | code, |
| int | opnum, | ||
| tree * | args, | ||
| location_t * | locs, | ||
| size_t | num_args, | ||
| bool | divconstok, | ||
| bool | ptrplusconstok ) |
Some factoring of operations including some builtins need to be stop from happening in some cases. factor_operation_ok returns true when the factoring is ok for CODE where OPNUM is operand was and the ARGS are the operands of the original operation. DIVCONSTOK says if an integer division with a constant is ok to be factored out. PTRPLUSCONSTOK says if a POINTER_PLUS_EXPR can be factored out. When opnum < 0, args is allowed to be null.
References all_ssa_names_p(), factor_operation_ok(), fn_arg_must_be_const_p(), i, int_divide_or_mod_p(), TREE_TYPE, true, and types_compatible_p().
Referenced by factor_operation_ok(), factor_out_conditional_operation(), factor_out_operators(), and merge_stmts_p().
| int find_different_opnum | ( | const gimple_match_op & | arg0_op, |
| const gimple_match_op & | arg1_op, | ||
| tree * | new_arg0, | ||
| tree * | new_arg1 ) |
Find the operand which is different between ARG0_OP and ARG1_OP. Returns the operand num where the difference is. Set NEWARG0 and NEWARG1 from the different argument. Returns -1 if none is found. If ARG0_OP/ARG1_OP is commutative also try swapping the two commutative operands and return the operand number where the difference happens in ARG0_OP.
Handle commutative operations.
References gimple_match_op::code, find_different_opnum(), first_commutative_argument(), gcc_assert, i, gimple_match_op::num_ops, operand_equal_for_phi_arg_p(), gimple_match_op::ops, and gimple_match_op::type.
Referenced by factor_out_conditional_operation(), factor_out_operators(), and find_different_opnum().
| int first_commutative_argument | ( | code_helper | code, |
| tree | type ) |
If CODE is commutative in two consecutive operands, return the index of the first, otherwise return -1.
References associated_internal_fn(), commutative_ternary_tree_code(), commutative_tree_code(), and first_commutative_argument().
Referenced by find_different_opnum(), first_commutative_argument(), first_commutative_argument(), fold_stmt_1(), gimple_resimplify3(), gimple_resimplify4(), gimple_resimplify5(), gimple_resimplify6(), gimple_resimplify7(), vect_build_slp_tree_2(), vect_build_slp_tree_3(), and vect_get_and_check_slp_defs().
| internal_fn get_conditional_internal_fn | ( | code_helper | code, |
| tree | type ) |
A wrapper around the internal-fn.cc versions of get_conditional_internal_fn for a code_helper CODE operating on type TYPE.
References associated_internal_fn(), and get_conditional_internal_fn().
Referenced by convert_conditional_op(), convert_scalar_cond_reduction(), get_conditional_internal_fn(), get_conditional_internal_fn(), get_conditional_internal_fn(), ifcvt_can_predicate(), predicate_rhs_code(), vect_reduction_update_partial_vector_usage(), vect_transform_reduction(), vectorizable_call(), and vectorizable_operation().
| bool gimple_extract_op | ( | gimple * | stmt, |
| gimple_match_op * | res_op ) |
Try to describe STMT in RES_OP, returning true on success. For GIMPLE_CONDs, describe the condition that is being tested. For GIMPLE_ASSIGNs, describe the rhs of the assignment. For GIMPLE_CALLs, describe the call.
References gimple_extract(), and gimple_extract_op().
Referenced by check_reduction_path(), factor_out_conditional_operation(), factor_out_operators(), gimple_extract_op(), vect_analyze_slp_reduc_chain(), vect_is_simple_reduction(), vect_mark_pattern_stmts(), vect_model_reduction_cost(), vect_transform_reduction(), and vectorizable_reduction().
|
inline |
Return whether OP is a non-expression result and a gimple value.
References gimple_match_op::code, gimple_simplified_result_is_gimple_val(), is_gimple_val(), code_helper::is_tree_code(), gimple_match_op::ops, and TREE_CODE_LENGTH.
Referenced by fold_build_cond_expr(), gimple_fold_stmt_to_constant_1(), gimple_simplified_result_is_gimple_val(), maybe_fold_comparisons_from_match_pd(), maybe_push_res_to_seq(), maybe_resimplify_conditional_op(), and vn_nary_build_or_lookup_1().
| bool gimple_simplify | ( | gimple * | stmt, |
| gimple_match_op * | res_op, | ||
| gimple_seq * | seq, | ||
| tree(* | valueize )(tree), | ||
| tree(* | top_valueize )(tree) ) |
The main STMT based simplification entry. It is used by the fold_stmt and the fold_stmt_to_constant APIs.
References gimple_match_op::code, do_valueize(), gimple_extract(), gimple_simplify(), code_helper::is_internal_fn(), gimple_match_op::num_ops, gimple_match_op::resimplify(), gimple_match_op::reverse, and try_conditional_simplification().
| void maybe_build_generic_op | ( | gimple_match_op * | res_op | ) |
If in GIMPLE the operation described by RES_OP should be single-rhs, build a GENERIC tree for that expression and update RES_OP accordingly.
References build1(), build3(), gimple_match_op::code, maybe_build_generic_op(), gimple_match_op::ops, REF_REVERSE_STORAGE_ORDER, gimple_match_op::reverse, gimple_match_op::set_value(), and gimple_match_op::type.
Referenced by maybe_build_generic_op(), maybe_push_res_to_seq(), and replace_stmt_with_simplification().
| tree maybe_push_res_to_seq | ( | gimple_match_op * | res_op, |
| gimple_seq * | seq, | ||
| tree | res ) |
Push the exploded expression described by RES_OP as a statement to SEQ if necessary and return a gimple value denoting the value of the expression. If RES is not NULL then the result will be always RES and even gimple values are pushed to SEQ.
References as_builtin_fn(), as_internal_fn(), build_call_internal(), builtin_decl_implicit(), cfun, gimple_match_op::code, gimple_match_cond::cond, gimple_match_op::cond, create_tmp_reg(), ECF_CONST, flags_from_decl_or_type(), gcc_assert, gimple_build_assign(), gimple_build_call(), gimple_call_set_lhs(), gimple_in_ssa_p(), gimple_seq_add_stmt_without_update(), gimple_simplified_result_is_gimple_val(), i, internal_fn_flags(), internal_fn_p(), code_helper::is_tree_code(), make_ssa_name(), maybe_build_generic_op(), maybe_push_res_to_seq(), mprts_hook, NULL, NULL_TREE, gimple_match_op::num_ops, gimple_match_op::op_or_null(), gimple_match_op::ops, SSA_NAME_OCCURS_IN_ABNORMAL_PHI, TREE_CODE, and gimple_match_op::type.
Referenced by factor_out_conditional_operation(), factor_out_operators(), gimple_simplify(), gimple_simplify(), gimple_simplify(), gimple_simplify(), gimple_simplify(), gimple_simplify(), gimple_simplify_phiopt(), maybe_push_res_to_seq(), replace_stmt_with_simplification(), tree_vec_extract(), and vn_nary_build_or_lookup_1().
|
extern |
Helpers for the autogenerated gimple-match.cc file. Copyright (C) 2023-2026 Free Software Foundation, Inc. This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with GCC; see the file COPYING3. If not see <http://www.gnu.org/licenses/>.
Referenced by gimple_fold_stmt_to_constant_1(), maybe_push_res_to_seq(), try_to_simplify(), vn_lookup_simplify_result(), and vn_nary_build_or_lookup_1().