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 (conditions, 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 > &, 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 (conditions conditions, 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().
|
inline |
References gcc_unreachable.
|
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, not_sra_candidate, num_conditions, condition::operand_num, condition::param_ops, condition::type, types_compatible_p(), 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(), estimate_calls_size_and_time_1(), and ipa_call_context::estimate_size_and_time().
|
inlinestatic |
References not_inlined_condition, and set_to_cond().
Referenced by analyze_function_body(), and compute_fn_summary().
|
inline |
|
inline |
ipa_predicate & ipa_predicate::operator&= | ( | const ipa_predicate & | p | ) |
Do THIS &= P.
References add_clause(), gcc_checking_assert, i, m_clause, max_clauses, and NULL.
References false_condition, gcc_checking_assert, and m_clause.
|
inline |
References gcc_checking_assert, i, 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, m_clause, and max_clauses.
Referenced by compute_bb_predicates(), predicate_for_phi_result(), remap_after_inlining(), set_switch_stmt_execution_predicate(), will_be_nonconstant_expr_predicate(), and will_be_nonconstant_predicate().
|
inlinestatic |
References first_dynamic_condition, i, 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, condition::code, false_condition, first_dynamic_condition, gcc_assert, gcc_checking_assert, i, i2, m_clause, MAX, max_clauses, MIN, num_conditions, condition::operand_num, and REG_BR_PROB_BASE.
Referenced by ipa_call_context::estimate_size_and_time(), and ipa_merge_fn_summary_after_inlining().
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(), 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, | ||
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, negative offset means that conditions relying on values passed by reference have to be discarded because they might not be preserved (and should be considered offset zero for other purposes).
References add_condition(), condition::agg_contents, ap, condition::by_ref, condition::code, ipa_fn_summary::conds, first_dynamic_condition, gcc_assert, gcc_checking_assert, i, m_clause, max_clauses, num_conditions, condition::offset, condition::operand_num, or_with(), condition::param_ops, predicate_testing_cond(), condition::type, and condition::val.
Referenced by ipa_merge_fn_summary_after_inlining(), 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().