ipa-utils.h (ipa_edge_within_scc): Declare.
2013-10-15 Martin Jambor <mjambor@suse.cz> * ipa-utils.h (ipa_edge_within_scc): Declare. * ipa-cp.c (edge_within_scc): Moved... * ipa-utils.c (ipa_edge_within_scc): ...here. Updated all callers. From-SVN: r203607
This commit is contained in:
parent
2e2206faab
commit
4cb1359729
@ -1,3 +1,9 @@
|
|||||||
|
2013-10-15 Martin Jambor <mjambor@suse.cz>
|
||||||
|
|
||||||
|
* ipa-utils.h (ipa_edge_within_scc): Declare.
|
||||||
|
* ipa-cp.c (edge_within_scc): Moved...
|
||||||
|
* ipa-utils.c (ipa_edge_within_scc): ...here. Updated all callers.
|
||||||
|
|
||||||
2013-01-10 Joern Rennecke <joern.rennecke@embecosm.com>
|
2013-01-10 Joern Rennecke <joern.rennecke@embecosm.com>
|
||||||
|
|
||||||
Import from savannah.gnu.org:
|
Import from savannah.gnu.org:
|
||||||
|
30
gcc/ipa-cp.c
30
gcc/ipa-cp.c
@ -287,22 +287,6 @@ ipa_lat_is_single_const (struct ipcp_lattice *lat)
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Return true iff the CS is an edge within a strongly connected component as
|
|
||||||
computed by ipa_reduced_postorder. */
|
|
||||||
|
|
||||||
static inline bool
|
|
||||||
edge_within_scc (struct cgraph_edge *cs)
|
|
||||||
{
|
|
||||||
struct ipa_dfs_info *caller_dfs = (struct ipa_dfs_info *) cs->caller->symbol.aux;
|
|
||||||
struct ipa_dfs_info *callee_dfs;
|
|
||||||
struct cgraph_node *callee = cgraph_function_node (cs->callee, NULL);
|
|
||||||
|
|
||||||
callee_dfs = (struct ipa_dfs_info *) callee->symbol.aux;
|
|
||||||
return (caller_dfs
|
|
||||||
&& callee_dfs
|
|
||||||
&& caller_dfs->scc_no == callee_dfs->scc_no);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Print V which is extracted from a value in a lattice to F. */
|
/* Print V which is extracted from a value in a lattice to F. */
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@ -957,7 +941,7 @@ add_value_to_lattice (struct ipcp_lattice *lat, tree newval,
|
|||||||
for (val = lat->values; val; val = val->next)
|
for (val = lat->values; val; val = val->next)
|
||||||
if (values_equal_for_ipcp_p (val->value, newval))
|
if (values_equal_for_ipcp_p (val->value, newval))
|
||||||
{
|
{
|
||||||
if (edge_within_scc (cs))
|
if (ipa_edge_within_scc (cs))
|
||||||
{
|
{
|
||||||
struct ipcp_value_source *s;
|
struct ipcp_value_source *s;
|
||||||
for (s = val->sources; s ; s = s->next)
|
for (s = val->sources; s ; s = s->next)
|
||||||
@ -1030,7 +1014,7 @@ propagate_vals_accross_pass_through (struct cgraph_edge *cs,
|
|||||||
are arithmetic functions with circular dependencies, there is infinite
|
are arithmetic functions with circular dependencies, there is infinite
|
||||||
number of them and we would just make lattices bottom. */
|
number of them and we would just make lattices bottom. */
|
||||||
if ((ipa_get_jf_pass_through_operation (jfunc) != NOP_EXPR)
|
if ((ipa_get_jf_pass_through_operation (jfunc) != NOP_EXPR)
|
||||||
and edge_within_scc (cs))
|
&& ipa_edge_within_scc (cs))
|
||||||
ret = set_lattice_contains_variable (dest_lat);
|
ret = set_lattice_contains_variable (dest_lat);
|
||||||
else
|
else
|
||||||
for (src_val = src_lat->values; src_val; src_val = src_val->next)
|
for (src_val = src_lat->values; src_val; src_val = src_val->next)
|
||||||
@ -1061,7 +1045,7 @@ propagate_vals_accross_ancestor (struct cgraph_edge *cs,
|
|||||||
struct ipcp_value *src_val;
|
struct ipcp_value *src_val;
|
||||||
bool ret = false;
|
bool ret = false;
|
||||||
|
|
||||||
if (edge_within_scc (cs))
|
if (ipa_edge_within_scc (cs))
|
||||||
return set_lattice_contains_variable (dest_lat);
|
return set_lattice_contains_variable (dest_lat);
|
||||||
|
|
||||||
for (src_val = src_lat->values; src_val; src_val = src_val->next)
|
for (src_val = src_lat->values; src_val; src_val = src_val->next)
|
||||||
@ -2137,7 +2121,7 @@ propagate_constants_topo (struct topo_info *topo)
|
|||||||
struct cgraph_edge *cs;
|
struct cgraph_edge *cs;
|
||||||
|
|
||||||
for (cs = v->callees; cs; cs = cs->next_callee)
|
for (cs = v->callees; cs; cs = cs->next_callee)
|
||||||
if (edge_within_scc (cs)
|
if (ipa_edge_within_scc (cs)
|
||||||
&& propagate_constants_accross_call (cs))
|
&& propagate_constants_accross_call (cs))
|
||||||
push_node_to_stack (topo, cs->callee);
|
push_node_to_stack (topo, cs->callee);
|
||||||
v = pop_node_from_stack (topo);
|
v = pop_node_from_stack (topo);
|
||||||
@ -2154,7 +2138,7 @@ propagate_constants_topo (struct topo_info *topo)
|
|||||||
estimate_local_effects (v);
|
estimate_local_effects (v);
|
||||||
add_all_node_vals_to_toposort (v);
|
add_all_node_vals_to_toposort (v);
|
||||||
for (cs = v->callees; cs; cs = cs->next_callee)
|
for (cs = v->callees; cs; cs = cs->next_callee)
|
||||||
if (!edge_within_scc (cs))
|
if (!ipa_edge_within_scc (cs))
|
||||||
propagate_constants_accross_call (cs);
|
propagate_constants_accross_call (cs);
|
||||||
}
|
}
|
||||||
cycle_nodes.release ();
|
cycle_nodes.release ();
|
||||||
@ -3470,7 +3454,7 @@ spread_undeadness (struct cgraph_node *node)
|
|||||||
struct cgraph_edge *cs;
|
struct cgraph_edge *cs;
|
||||||
|
|
||||||
for (cs = node->callees; cs; cs = cs->next_callee)
|
for (cs = node->callees; cs; cs = cs->next_callee)
|
||||||
if (edge_within_scc (cs))
|
if (ipa_edge_within_scc (cs))
|
||||||
{
|
{
|
||||||
struct cgraph_node *callee;
|
struct cgraph_node *callee;
|
||||||
struct ipa_node_params *info;
|
struct ipa_node_params *info;
|
||||||
@ -3501,7 +3485,7 @@ has_undead_caller_from_outside_scc_p (struct cgraph_node *node,
|
|||||||
has_undead_caller_from_outside_scc_p,
|
has_undead_caller_from_outside_scc_p,
|
||||||
NULL, true))
|
NULL, true))
|
||||||
return true;
|
return true;
|
||||||
else if (!edge_within_scc (cs)
|
else if (!ipa_edge_within_scc (cs)
|
||||||
&& !IPA_NODE_REF (cs->caller)->node_dead)
|
&& !IPA_NODE_REF (cs->caller)->node_dead)
|
||||||
return true;
|
return true;
|
||||||
return false;
|
return false;
|
||||||
|
@ -253,6 +253,22 @@ ipa_get_nodes_in_cycle (struct cgraph_node *node)
|
|||||||
return v;
|
return v;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Return true iff the CS is an edge within a strongly connected component as
|
||||||
|
computed by ipa_reduced_postorder. */
|
||||||
|
|
||||||
|
bool
|
||||||
|
ipa_edge_within_scc (struct cgraph_edge *cs)
|
||||||
|
{
|
||||||
|
struct ipa_dfs_info *caller_dfs = (struct ipa_dfs_info *) cs->caller->symbol.aux;
|
||||||
|
struct ipa_dfs_info *callee_dfs;
|
||||||
|
struct cgraph_node *callee = cgraph_function_node (cs->callee, NULL);
|
||||||
|
|
||||||
|
callee_dfs = (struct ipa_dfs_info *) callee->symbol.aux;
|
||||||
|
return (caller_dfs
|
||||||
|
&& callee_dfs
|
||||||
|
&& caller_dfs->scc_no == callee_dfs->scc_no);
|
||||||
|
}
|
||||||
|
|
||||||
struct postorder_stack
|
struct postorder_stack
|
||||||
{
|
{
|
||||||
struct cgraph_node *node;
|
struct cgraph_node *node;
|
||||||
|
@ -42,6 +42,7 @@ int ipa_reduced_postorder (struct cgraph_node **, bool, bool,
|
|||||||
bool (*ignore_edge) (struct cgraph_edge *));
|
bool (*ignore_edge) (struct cgraph_edge *));
|
||||||
void ipa_free_postorder_info (void);
|
void ipa_free_postorder_info (void);
|
||||||
vec<cgraph_node_ptr> ipa_get_nodes_in_cycle (struct cgraph_node *);
|
vec<cgraph_node_ptr> ipa_get_nodes_in_cycle (struct cgraph_node *);
|
||||||
|
bool ipa_edge_within_scc (struct cgraph_edge *);
|
||||||
int ipa_reverse_postorder (struct cgraph_node **);
|
int ipa_reverse_postorder (struct cgraph_node **);
|
||||||
tree get_base_var (tree);
|
tree get_base_var (tree);
|
||||||
void ipa_merge_profiles (struct cgraph_node *dst,
|
void ipa_merge_profiles (struct cgraph_node *dst,
|
||||||
|
Loading…
Reference in New Issue
Block a user