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) |
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_tree_code(), and code_helper::is_tree_code().
Referenced by 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 code_helper::is_fn_code().
Referenced by 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_tree_code(), and code_helper::is_tree_code().
Referenced by gimple_resimplify2(), vect_transform_reduction(), 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_tree_code(), and code_helper::is_tree_code().
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(), first_commutative_argument(), and code_helper::is_tree_code().
Referenced by first_commutative_argument(), fold_stmt_1(), gimple_resimplify3(), gimple_resimplify4(), gimple_resimplify5(), gimple_resimplify6(), gimple_resimplify7(), 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(), get_conditional_internal_fn(), and code_helper::is_tree_code().
Referenced by convert_conditional_op(), convert_scalar_cond_reduction(), 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().
Referenced by check_reduction_path(), factor_out_conditional_operation(), 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, 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(), 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 build2(), gimple_match_op::code, gimple_match_op::cond, do_valueize(), gimple_extract(), gimple_resimplify2(), code_helper::is_internal_fn(), code_helper::is_tree_code(), gimple_match_op::num_ops, gimple_match_op::ops, gimple_match_op::resimplify(), gimple_match_op::reverse, tcc_comparison, TREE_CODE, TREE_CODE_CLASS, TREE_OPERAND, TREE_TYPE, try_conditional_simplification(), and valueize_op().
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, 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_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, COMPARISON_CLASS_P, 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_p(), code_helper::is_tree_code(), make_ssa_name(), maybe_build_generic_op(), 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, TREE_OPERAND, and gimple_match_op::type.
Referenced by factor_out_conditional_operation(), gimple_simplify(), gimple_simplify(), gimple_simplify(), gimple_simplify(), gimple_simplify(), gimple_simplify(), gimple_simplify_phiopt(), 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-2024 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().