|
GCC Middle and Back End API Reference
|
#include <ipa-predicate.h>
Public Types | |
| enum | predicate_conditions { false_condition = 0 , not_inlined_condition = 1 , first_dynamic_condition = 2 } |
Public Member Functions | |
| ipa_predicate (bool p=true) | |
| ipa_predicate (ipa_predicate *) | |
| ipa_predicate & | operator&= (const ipa_predicate &) |
| ipa_predicate | operator& (const ipa_predicate &p) const |
| ipa_predicate | or_with (conditionsconditions, const ipa_predicate &) const |
| bool | operator== (const ipa_predicate &p2) const |
| bool | operator== (const bool cond) const |
| bool | operator!= (const ipa_predicate &p2) const |
| bool | operator!= (const bool cond) const |
| bool | evaluate (clause_t) const |
| int | probability (conditions, clause_t, vec< inline_param_summary >) const |
| void | dump (FILE *f, conditions, bool nl=true) const |
| void DEBUG_FUNCTION | debug (conditions) const |
| ipa_predicate | remap_after_duplication (clause_t) |
| ipa_predicate | remap_after_inlining (class ipa_fn_summary *, ipa_node_params *params_summary, ipa_fn_summary *, const vec< int > &, const vec< HOST_WIDE_INT > &, const vec< bool > &, clause_t, const ipa_predicate &) |
| void | stream_in (lto_input_block *) |
| void | stream_out (output_block *) |
Static Public Member Functions | |
| static ipa_predicate | predicate_testing_cond (int i) |
| static ipa_predicate | not_inlined (void) |
Static Public Attributes | |
| static const int | num_conditions = 32 |
| static const tree_code | is_not_constant = ERROR_MARK |
| static const tree_code | changed = IDENTIFIER_NODE |
| static const tree_code | not_sra_candidate = TREE_LIST |
Private Member Functions | |
| void | set_to_cond (int cond) |
| void | add_clause (conditionsconditions conditionsconditions, clause_t) |
Private Attributes | |
| clause_t | m_clause [max_clauses+1] |
Static Private Attributes | |
| static const int | max_clauses = 8 |
References false_condition, m_clause, and set_to_cond().
Referenced by ipa_predicate(), not_inlined(), operator!=(), operator&(), operator&=(), operator==(), or_with(), predicate_testing_cond(), remap_after_duplication(), and remap_after_inlining().
|
inline |
References gcc_unreachable, and ipa_predicate().
|
private |
Add clause CLAUSE into the predicate P. When CONDITIONS is NULL do not perform checking whether NEW_CLAUSE is obviously true. This is useful only when NEW_CLAUSE is known to be sane.
References condition::agg_contents, condition::by_ref, changed, condition::code, expr_eval_ops_equal_p(), false_condition, first_dynamic_condition, gcc_checking_assert, HONOR_NANS(), i, i2, invert_tree_comparison(), is_not_constant, m_clause, max_clauses, condition::maybe_modified, not_sra_candidate, num_conditions, condition::offset, condition::operand_num, condition::param_ops, condition::type, types_compatible_p(), condition::unknown_offset, condition::val, and vrp_operand_equal_p().
Referenced by operator&=(), or_with(), and remap_after_duplication().
| void ipa_predicate::debug | ( | conditions | conds | ) | const |
References dump().
| void ipa_predicate::dump | ( | FILE * | f, |
| conditions | conds, | ||
| bool | nl = true ) const |
Dump THIS to F. CONDS a vector of conditions used when evaluating ipa_predicates. When NL is true new line is output at the end of dump.
References dump_clause(), i, and m_clause.
Referenced by ipa_fn_summary::account_size_time(), debug(), dump_ipa_call_summary(), ipa_dump_fn_summary(), and predicate_for_phi_result().
Having partial truth assignment in POSSIBLE_TRUTHS, return false if predicate P is known to be false.
References false_condition, gcc_assert, gcc_checking_assert, i, m_clause, and max_clauses.
Referenced by estimate_calls_size_and_time_1(), and ipa_call_context::estimate_size_and_time().
|
inlinestatic |
References ipa_predicate(), not_inlined_condition, and set_to_cond().
Referenced by analyze_function_body(), and compute_fn_summary().
|
inline |
References ipa_predicate().
|
inline |
References ipa_predicate().
| ipa_predicate & ipa_predicate::operator&= | ( | const ipa_predicate & | p | ) |
Do THIS &= P.
References add_clause(), gcc_checking_assert, i, ipa_predicate(), m_clause, max_clauses, and NULL.
References false_condition, gcc_checking_assert, and m_clause.
|
inline |
References gcc_checking_assert, i, ipa_predicate(), m_clause, and max_clauses.
| ipa_predicate ipa_predicate::or_with | ( | conditions | conditions, |
| const ipa_predicate & | p ) const |
Return THIS | P2.
References add_clause(), gcc_checking_assert, i, ipa_predicate(), m_clause, and max_clauses.
Referenced by compute_bb_predicates(), compute_switch_edge_predicates(), predicate_for_phi_result(), remap_after_inlining(), will_be_nonconstant_expr_predicate(), and will_be_nonconstant_predicate().
|
inlinestatic |
References first_dynamic_condition, i, ipa_predicate(), and set_to_cond().
Referenced by add_condition(), and remap_after_inlining().
| int ipa_predicate::probability | ( | conditions | conds, |
| clause_t | possible_truths, | ||
| vec< inline_param_summary > | inline_param_summary ) const |
Return the probability in range 0...REG_BR_PROB_BASE that the predicated instruction will be recomputed per invocation of the inlined call.
References inline_param_summary::change_prob, changed, false_condition, first_dynamic_condition, gcc_assert, gcc_checking_assert, i, i2, m_clause, MAX, max_clauses, MIN, num_conditions, and REG_BR_PROB_BASE.
| ipa_predicate ipa_predicate::remap_after_duplication | ( | clause_t | possible_truths | ) |
Remap predicate THIS of former function to be predicate of duplicated function. POSSIBLE_TRUTHS is clause of possible truths in the duplicated node, INFO is inline summary of the duplicated node.
References add_clause(), ipa_predicate(), m_clause, and NULL.
Referenced by ipa_fn_summary_t::duplicate(), and remap_freqcounting_preds_after_dup().
| ipa_predicate ipa_predicate::remap_after_inlining | ( | class ipa_fn_summary * | info, |
| ipa_node_params * | params_summary, | ||
| ipa_fn_summary * | callee_info, | ||
| const vec< int > & | operand_map, | ||
| const vec< HOST_WIDE_INT > & | offset_map, | ||
| const vec< bool > & | agg_preserved_map, | ||
| clause_t | possible_truths, | ||
| const ipa_predicate & | toplev_predicate ) |
Translate all conditions from callee representation into caller representation and symbolically evaluate predicate THIS into new predicate. INFO is ipa_fn_summary of function we are adding predicate into, CALLEE_INFO is summary of function predicate P is from. OPERAND_MAP is array giving callee formal IDs the caller formal IDs. POSSSIBLE_TRUTHS is clause of all callee conditions that may be true in caller context. TOPLEV_PREDICATE is predicate under which callee is executed. OFFSET_MAP is an array of offsets that need to be added to conditions. AGG_PRESERVED_MAP indicates whether memory referenced by each parameter is guaranteed to be preserved until the call; when false for a by-reference condition, maybe_modified is set on the remapped condition.
References add_condition(), ap, ipa_fn_summary::conds, first_dynamic_condition, wi::fits_shwi_p(), gcc_assert, gcc_checking_assert, i, ipa_predicate(), m_clause, max_clauses, num_conditions, or_with(), and predicate_testing_cond().
Referenced by remap_edge_summaries(), and remap_freqcounting_predicate().
|
inlineprivate |
References m_clause.
Referenced by ipa_predicate(), not_inlined(), and predicate_testing_cond().
| void ipa_predicate::stream_in | ( | lto_input_block * | ib | ) |
Read predicate from IB.
References gcc_assert, m_clause, max_clauses, and streamer_read_uhwi().
Referenced by inline_read_section(), and read_ipa_call_summary().
| void ipa_predicate::stream_out | ( | output_block * | ob | ) |
Write predicate P to OB.
References gcc_assert, m_clause, max_clauses, and streamer_write_uhwi().
Referenced by ipa_fn_summary_write(), and write_ipa_call_summary().
|
static |
|
static |
Referenced by add_clause(), dump_condition(), evaluate_conditions_for_known_args(), and set_cond_stmt_execution_predicate().
|
private |
|
staticprivate |
Referenced by add_clause(), evaluate(), operator&=(), operator==(), or_with(), probability(), remap_after_inlining(), stream_in(), and stream_out().
|
static |
Referenced by add_clause(), analyze_function_body(), dump_condition(), and evaluate_conditions_for_known_args().
|
static |
Referenced by add_clause(), add_condition(), dump_clause(), probability(), and remap_after_inlining().