GCC Middle and Back End API Reference
gimple-match.h File Reference
This graph shows which files directly or indirectly include this file:

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 *)
 

Function Documentation

◆ associative_binary_op_p()

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(), ggc_alloc(), and code_helper::is_tree_code().

Referenced by vectorizable_reduction().

◆ canonicalize_code()

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().

◆ commutative_binary_op_p()

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(), ggc_alloc(), and code_helper::is_tree_code().

Referenced by gimple_resimplify2(), vect_transform_reduction(), and vectorizable_reduction().

◆ commutative_ternary_op_p()

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(), ggc_alloc(), and code_helper::is_tree_code().

◆ first_commutative_argument()

◆ get_conditional_internal_fn()

internal_fn get_conditional_internal_fn ( code_helper code,
tree type )

◆ gimple_extract_op()

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 ggc_alloc(), and gimple_extract().

Referenced by check_reduction_path(), vect_is_simple_reduction(), vect_mark_pattern_stmts(), vect_model_reduction_cost(), vect_transform_reduction(), and vectorizable_reduction().

◆ gimple_simplified_result_is_gimple_val()

◆ gimple_simplify()

bool gimple_simplify ( gimple * stmt,
gimple_match_op * res_op,
gimple_seq * seq,
tree(*)(tree) valueize,
tree(*)(tree) top_valueize )
The main STMT based simplification entry.  It is used by the fold_stmt
and the fold_stmt_to_constant APIs.   

References build2(), do_valueize(), ggc_alloc(), gimple_extract(), gimple_resimplify2(), tcc_comparison, TREE_CODE, TREE_CODE_CLASS, TREE_OPERAND, TREE_TYPE, try_conditional_simplification(), and valueize_op().

◆ maybe_build_generic_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(), ggc_alloc(), and REF_REVERSE_STORAGE_ORDER.

Referenced by maybe_push_res_to_seq(), and replace_stmt_with_simplification().

◆ maybe_push_res_to_seq()

Variable Documentation

◆ mprts_hook

tree(* mprts_hook) (gimple_match_op *) ( gimple_match_op * )
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().