aboutsummaryrefslogtreecommitdiff
path: root/gcc/ipa-predicate.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/ipa-predicate.c')
-rw-r--r--gcc/ipa-predicate.c101
1 files changed, 50 insertions, 51 deletions
diff --git a/gcc/ipa-predicate.c b/gcc/ipa-predicate.c
index e4b11ec..48318cc 100644
--- a/gcc/ipa-predicate.c
+++ b/gcc/ipa-predicate.c
@@ -69,7 +69,7 @@ expr_eval_ops_equal_p (expr_eval_ops ops1, expr_eval_ops ops2)
sane. */
void
-predicate::add_clause (conditions conditions, clause_t new_clause)
+ipa_predicate::add_clause (conditions conditions, clause_t new_clause)
{
int i;
int i2;
@@ -81,7 +81,7 @@ predicate::add_clause (conditions conditions, clause_t new_clause)
return;
/* False clause makes the whole predicate false. Kill the other variants. */
- if (new_clause == (1 << predicate::false_condition))
+ if (new_clause == (1 << ipa_predicate::false_condition))
{
*this = false;
return;
@@ -90,7 +90,7 @@ predicate::add_clause (conditions conditions, clause_t new_clause)
return;
/* No one should be silly enough to add false into nontrivial clauses. */
- gcc_checking_assert (!(new_clause & (1 << predicate::false_condition)));
+ gcc_checking_assert (!(new_clause & (1 << ipa_predicate::false_condition)));
/* Look where to insert the new_clause. At the same time prune out
new_clauses of P that are implied by the new new_clause and thus
@@ -123,13 +123,13 @@ predicate::add_clause (conditions conditions, clause_t new_clause)
/* Look for clauses that are obviously true. I.e.
op0 == 5 || op0 != 5. */
if (conditions)
- for (c1 = predicate::first_dynamic_condition;
+ for (c1 = ipa_predicate::first_dynamic_condition;
c1 < num_conditions; c1++)
{
condition *cc1;
if (!(new_clause & (1 << c1)))
continue;
- cc1 = &(*conditions)[c1 - predicate::first_dynamic_condition];
+ cc1 = &(*conditions)[c1 - ipa_predicate::first_dynamic_condition];
/* We have no way to represent !changed and !is_not_constant
and thus there is no point for looking for them. */
if (cc1->code == changed || cc1->code == is_not_constant)
@@ -138,7 +138,7 @@ predicate::add_clause (conditions conditions, clause_t new_clause)
if (new_clause & (1 << c2))
{
condition *cc2 =
- &(*conditions)[c2 - predicate::first_dynamic_condition];
+ &(*conditions)[c2 - ipa_predicate::first_dynamic_condition];
if (cc1->operand_num == cc2->operand_num
&& vrp_operand_equal_p (cc1->val, cc2->val)
&& cc2->code != is_not_constant
@@ -170,8 +170,8 @@ predicate::add_clause (conditions conditions, clause_t new_clause)
/* Do THIS &= P. */
-predicate &
-predicate::operator &= (const predicate &p)
+ipa_predicate &
+ipa_predicate::operator &= (const ipa_predicate &p)
{
/* Avoid busy work. */
if (p == false || *this == true)
@@ -184,13 +184,13 @@ predicate::operator &= (const predicate &p)
int i;
- /* See how far predicates match. */
+ /* See how far ipa_predicates match. */
for (i = 0; m_clause[i] && m_clause[i] == p.m_clause[i]; i++)
{
gcc_checking_assert (i < max_clauses);
}
- /* Combine the predicates rest. */
+ /* Combine the ipa_predicates rest. */
for (; p.m_clause[i]; i++)
{
gcc_checking_assert (i < max_clauses);
@@ -203,9 +203,9 @@ predicate::operator &= (const predicate &p)
/* Return THIS | P2. */
-predicate
-predicate::or_with (conditions conditions,
- const predicate &p) const
+ipa_predicate
+ipa_predicate::or_with (conditions conditions,
+ const ipa_predicate &p) const
{
/* Avoid busy work. */
if (p == false || *this == true || *this == p)
@@ -214,7 +214,7 @@ predicate::or_with (conditions conditions,
return p;
/* OK, combine the predicates. */
- predicate out = true;
+ ipa_predicate out = true;
for (int i = 0; m_clause[i]; i++)
for (int j = 0; p.m_clause[j]; j++)
@@ -230,7 +230,7 @@ predicate::or_with (conditions conditions,
if predicate P is known to be false. */
bool
-predicate::evaluate (clause_t possible_truths) const
+ipa_predicate::evaluate (clause_t possible_truths) const
{
int i;
@@ -238,7 +238,7 @@ predicate::evaluate (clause_t possible_truths) const
if (*this == true)
return true;
- gcc_assert (!(possible_truths & (1 << predicate::false_condition)));
+ gcc_assert (!(possible_truths & (1 << ipa_predicate::false_condition)));
/* See if we can find clause we can disprove. */
for (i = 0; m_clause[i]; i++)
@@ -254,7 +254,7 @@ predicate::evaluate (clause_t possible_truths) const
instruction will be recomputed per invocation of the inlined call. */
int
-predicate::probability (conditions conds,
+ipa_predicate::probability (conditions conds,
clause_t possible_truths,
vec<inline_param_summary> inline_param_summary) const
{
@@ -268,7 +268,7 @@ predicate::probability (conditions conds,
if (*this == false)
return 0;
- gcc_assert (!(possible_truths & (1 << predicate::false_condition)));
+ gcc_assert (!(possible_truths & (1 << ipa_predicate::false_condition)));
/* See if we can find clause we can disprove. */
for (i = 0; m_clause[i]; i++)
@@ -285,11 +285,11 @@ predicate::probability (conditions conds,
for (i2 = 0; i2 < num_conditions; i2++)
if ((m_clause[i] & possible_truths) & (1 << i2))
{
- if (i2 >= predicate::first_dynamic_condition)
+ if (i2 >= ipa_predicate::first_dynamic_condition)
{
condition *c =
- &(*conds)[i2 - predicate::first_dynamic_condition];
- if (c->code == predicate::changed
+ &(*conds)[i2 - ipa_predicate::first_dynamic_condition];
+ if (c->code == ipa_predicate::changed
&& (c->operand_num <
(int) inline_param_summary.length ()))
{
@@ -318,13 +318,13 @@ void
dump_condition (FILE *f, conditions conditions, int cond)
{
condition *c;
- if (cond == predicate::false_condition)
+ if (cond == ipa_predicate::false_condition)
fprintf (f, "false");
- else if (cond == predicate::not_inlined_condition)
+ else if (cond == ipa_predicate::not_inlined_condition)
fprintf (f, "not inlined");
else
{
- c = &(*conditions)[cond - predicate::first_dynamic_condition];
+ c = &(*conditions)[cond - ipa_predicate::first_dynamic_condition];
fprintf (f, "op%i", c->operand_num);
if (c->agg_contents)
fprintf (f, "[%soffset: " HOST_WIDE_INT_PRINT_DEC "]",
@@ -406,12 +406,12 @@ dump_condition (FILE *f, conditions conditions, int cond)
fprintf (f, ")");
}
- if (c->code == predicate::is_not_constant)
+ if (c->code == ipa_predicate::is_not_constant)
{
fprintf (f, " not constant");
return;
}
- if (c->code == predicate::changed)
+ if (c->code == ipa_predicate::changed)
{
fprintf (f, " changed");
return;
@@ -432,7 +432,7 @@ dump_clause (FILE *f, conditions conds, clause_t clause)
fprintf (f, "(");
if (!clause)
fprintf (f, "true");
- for (i = 0; i < predicate::num_conditions; i++)
+ for (i = 0; i < ipa_predicate::num_conditions; i++)
if (clause & (1 << i))
{
if (found)
@@ -445,10 +445,10 @@ dump_clause (FILE *f, conditions conds, clause_t clause)
/* Dump THIS to F. CONDS a vector of conditions used when evaluating
- predicates. When NL is true new line is output at the end of dump. */
+ ipa_predicates. When NL is true new line is output at the end of dump. */
void
-predicate::dump (FILE *f, conditions conds, bool nl) const
+ipa_predicate::dump (FILE *f, conditions conds, bool nl) const
{
int i;
if (*this == true)
@@ -466,7 +466,7 @@ predicate::dump (FILE *f, conditions conds, bool nl) const
void
-predicate::debug (conditions conds) const
+ipa_predicate::debug (conditions conds) const
{
dump (stderr, conds);
}
@@ -476,11 +476,11 @@ predicate::debug (conditions conds) const
POSSIBLE_TRUTHS is clause of possible truths in the duplicated node,
INFO is inline summary of the duplicated node. */
-predicate
-predicate::remap_after_duplication (clause_t possible_truths)
+ipa_predicate
+ipa_predicate::remap_after_duplication (clause_t possible_truths)
{
int j;
- predicate out = true;
+ ipa_predicate out = true;
for (j = 0; m_clause[j]; j++)
if (!(possible_truths & m_clause[j]))
return false;
@@ -503,26 +503,26 @@ predicate::remap_after_duplication (clause_t possible_truths)
because they might not be preserved (and should be considered offset zero
for other purposes). */
-predicate
-predicate::remap_after_inlining (class ipa_fn_summary *info,
+ipa_predicate
+ipa_predicate::remap_after_inlining (class ipa_fn_summary *info,
class ipa_node_params *params_summary,
class ipa_fn_summary *callee_info,
const vec<int> &operand_map,
const vec<HOST_WIDE_INT> &offset_map,
clause_t possible_truths,
- const predicate &toplev_predicate)
+ const ipa_predicate &toplev_predicate)
{
int i;
- predicate out = true;
+ ipa_predicate out = true;
- /* True predicate is easy. */
+ /* True ipa_predicate is easy. */
if (*this == true)
return toplev_predicate;
for (i = 0; m_clause[i]; i++)
{
clause_t clause = m_clause[i];
int cond;
- predicate clause_predicate = false;
+ ipa_predicate clause_predicate = false;
gcc_assert (i < max_clauses);
@@ -530,16 +530,15 @@ predicate::remap_after_inlining (class ipa_fn_summary *info,
/* Do we have condition we can't disprove? */
if (clause & possible_truths & (1 << cond))
{
- predicate cond_predicate;
+ ipa_predicate cond_predicate;
/* Work out if the condition can translate to predicate in the
inlined function. */
- if (cond >= predicate::first_dynamic_condition)
+ if (cond >= ipa_predicate::first_dynamic_condition)
{
struct condition *c;
- c = &(*callee_info->conds)[cond
- -
- predicate::first_dynamic_condition];
+ int index = cond - ipa_predicate::first_dynamic_condition;
+ c = &(*callee_info->conds)[index];
/* See if we can remap condition operand to caller's operand.
Otherwise give up. */
if (!operand_map.exists ()
@@ -576,7 +575,7 @@ predicate::remap_after_inlining (class ipa_fn_summary *info,
/* Fixed conditions remains same, construct single
condition predicate. */
else
- cond_predicate = predicate::predicate_testing_cond (cond);
+ cond_predicate = ipa_predicate::predicate_testing_cond (cond);
clause_predicate = clause_predicate.or_with (info->conds,
cond_predicate);
}
@@ -590,7 +589,7 @@ predicate::remap_after_inlining (class ipa_fn_summary *info,
/* Read predicate from IB. */
void
-predicate::stream_in (class lto_input_block *ib)
+ipa_predicate::stream_in (class lto_input_block *ib)
{
clause_t clause;
int k = 0;
@@ -611,7 +610,7 @@ predicate::stream_in (class lto_input_block *ib)
/* Write predicate P to OB. */
void
-predicate::stream_out (struct output_block *ob)
+ipa_predicate::stream_out (struct output_block *ob)
{
int j;
for (j = 0; m_clause[j]; j++)
@@ -629,7 +628,7 @@ predicate::stream_out (struct output_block *ob)
aggregate it is. It can be NULL, which means this not a load from an
aggregate. */
-predicate
+ipa_predicate
add_condition (class ipa_fn_summary *summary,
class ipa_node_params *params_summary,
int operand_num,
@@ -669,10 +668,10 @@ add_condition (class ipa_fn_summary *summary,
&& c->agg_contents == agg_contents
&& expr_eval_ops_equal_p (c->param_ops, param_ops)
&& (!agg_contents || (c->offset == offset && c->by_ref == by_ref)))
- return predicate::predicate_testing_cond (i);
+ return ipa_predicate::predicate_testing_cond (i);
}
/* Too many conditions. Give up and return constant true. */
- if (i == predicate::num_conditions - predicate::first_dynamic_condition)
+ if (i == ipa_predicate::num_conditions - ipa_predicate::first_dynamic_condition)
return true;
new_cond.operand_num = operand_num;
@@ -694,5 +693,5 @@ add_condition (class ipa_fn_summary *summary,
vec_safe_push (summary->conds, new_cond);
- return predicate::predicate_testing_cond (i);
+ return ipa_predicate::predicate_testing_cond (i);
}