ipa-prop.h (struct ipa_node_params): New flag node_enqued.
2009-07-24 Martin Jambor <mjambor@suse.cz> * ipa-prop.h (struct ipa_node_params): New flag node_enqued. (ipa_push_func_to_list_1): Declare. (ipa_push_func_to_list): New function. * ipa-prop.c (ipa_push_func_to_list_1): New function. (ipa_init_func_list): Call ipa_push_func_to_list_1. (ipa_push_func_to_list): Removed. (ipa_pop_func_from_list): Clear node_enqueued flag. From-SVN: r150053
This commit is contained in:
parent
ff5b964d6e
commit
5b9633c834
|
@ -1,3 +1,14 @@
|
||||||
|
2009-07-24 Martin Jambor <mjambor@suse.cz>
|
||||||
|
|
||||||
|
* ipa-prop.h (struct ipa_node_params): New flag node_enqued.
|
||||||
|
(ipa_push_func_to_list_1): Declare.
|
||||||
|
(ipa_push_func_to_list): New function.
|
||||||
|
|
||||||
|
* ipa-prop.c (ipa_push_func_to_list_1): New function.
|
||||||
|
(ipa_init_func_list): Call ipa_push_func_to_list_1.
|
||||||
|
(ipa_push_func_to_list): Removed.
|
||||||
|
(ipa_pop_func_from_list): Clear node_enqueued flag.
|
||||||
|
|
||||||
2009-07-24 Andreas Krebbel <krebbel1@de.ibm.com>
|
2009-07-24 Andreas Krebbel <krebbel1@de.ibm.com>
|
||||||
|
|
||||||
* config/s390/s390.c (override_options): Default
|
* config/s390/s390.c (override_options): Default
|
||||||
|
|
|
@ -45,6 +45,24 @@ static struct cgraph_node_hook_list *node_removal_hook_holder;
|
||||||
static struct cgraph_2edge_hook_list *edge_duplication_hook_holder;
|
static struct cgraph_2edge_hook_list *edge_duplication_hook_holder;
|
||||||
static struct cgraph_2node_hook_list *node_duplication_hook_holder;
|
static struct cgraph_2node_hook_list *node_duplication_hook_holder;
|
||||||
|
|
||||||
|
/* Add cgraph NODE described by INFO to the worklist WL regardless of whether
|
||||||
|
it is in one or not. It should almost never be used directly, as opposed to
|
||||||
|
ipa_push_func_to_list. */
|
||||||
|
|
||||||
|
void
|
||||||
|
ipa_push_func_to_list_1 (struct ipa_func_list **wl,
|
||||||
|
struct cgraph_node *node,
|
||||||
|
struct ipa_node_params *info)
|
||||||
|
{
|
||||||
|
struct ipa_func_list *temp;
|
||||||
|
|
||||||
|
info->node_enqueued = 1;
|
||||||
|
temp = XCNEW (struct ipa_func_list);
|
||||||
|
temp->node = node;
|
||||||
|
temp->next = *wl;
|
||||||
|
*wl = temp;
|
||||||
|
}
|
||||||
|
|
||||||
/* Initialize worklist to contain all functions. */
|
/* Initialize worklist to contain all functions. */
|
||||||
|
|
||||||
struct ipa_func_list *
|
struct ipa_func_list *
|
||||||
|
@ -57,43 +75,33 @@ ipa_init_func_list (void)
|
||||||
for (node = cgraph_nodes; node; node = node->next)
|
for (node = cgraph_nodes; node; node = node->next)
|
||||||
if (node->analyzed)
|
if (node->analyzed)
|
||||||
{
|
{
|
||||||
|
struct ipa_node_params *info = IPA_NODE_REF (node);
|
||||||
/* Unreachable nodes should have been eliminated before ipcp and
|
/* Unreachable nodes should have been eliminated before ipcp and
|
||||||
inlining. */
|
inlining. */
|
||||||
gcc_assert (node->needed || node->reachable);
|
gcc_assert (node->needed || node->reachable);
|
||||||
ipa_push_func_to_list (&wl, node);
|
ipa_push_func_to_list_1 (&wl, node, info);
|
||||||
}
|
}
|
||||||
|
|
||||||
return wl;
|
return wl;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Add cgraph node MT to the worklist. Set worklist element WL
|
/* Remove a function from the worklist WL and return it. */
|
||||||
to point to MT. */
|
|
||||||
|
|
||||||
void
|
|
||||||
ipa_push_func_to_list (struct ipa_func_list **wl, struct cgraph_node *mt)
|
|
||||||
{
|
|
||||||
struct ipa_func_list *temp;
|
|
||||||
|
|
||||||
temp = XCNEW (struct ipa_func_list);
|
|
||||||
temp->node = mt;
|
|
||||||
temp->next = *wl;
|
|
||||||
*wl = temp;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Remove a function from the worklist. WL points to the first
|
|
||||||
element in the list, which is removed. */
|
|
||||||
|
|
||||||
struct cgraph_node *
|
struct cgraph_node *
|
||||||
ipa_pop_func_from_list (struct ipa_func_list ** wl)
|
ipa_pop_func_from_list (struct ipa_func_list **wl)
|
||||||
{
|
{
|
||||||
|
struct ipa_node_params *info;
|
||||||
struct ipa_func_list *first;
|
struct ipa_func_list *first;
|
||||||
struct cgraph_node *return_func;
|
struct cgraph_node *node;
|
||||||
|
|
||||||
first = *wl;
|
first = *wl;
|
||||||
*wl = (*wl)->next;
|
*wl = (*wl)->next;
|
||||||
return_func = first->node;
|
node = first->node;
|
||||||
free (first);
|
free (first);
|
||||||
return return_func;
|
|
||||||
|
info = IPA_NODE_REF (node);
|
||||||
|
info->node_enqueued = 0;
|
||||||
|
return node;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Return index of the formal whose tree is PTREE in function which corresponds
|
/* Return index of the formal whose tree is PTREE in function which corresponds
|
||||||
|
|
|
@ -167,6 +167,8 @@ struct ipa_node_params
|
||||||
unsigned modification_analysis_done : 1;
|
unsigned modification_analysis_done : 1;
|
||||||
/* Whether the param uses analysis has already been performed. */
|
/* Whether the param uses analysis has already been performed. */
|
||||||
unsigned uses_analysis_done : 1;
|
unsigned uses_analysis_done : 1;
|
||||||
|
/* Whether the function is enqueued in an ipa_func_list. */
|
||||||
|
unsigned node_enqueued : 1;
|
||||||
};
|
};
|
||||||
|
|
||||||
/* ipa_node_params access functions. Please use these to access fields that
|
/* ipa_node_params access functions. Please use these to access fields that
|
||||||
|
@ -369,9 +371,21 @@ struct ipa_func_list
|
||||||
|
|
||||||
/* ipa_func_list interface. */
|
/* ipa_func_list interface. */
|
||||||
struct ipa_func_list *ipa_init_func_list (void);
|
struct ipa_func_list *ipa_init_func_list (void);
|
||||||
void ipa_push_func_to_list (struct ipa_func_list **, struct cgraph_node *);
|
void ipa_push_func_to_list_1 (struct ipa_func_list **, struct cgraph_node *,
|
||||||
|
struct ipa_node_params *);
|
||||||
struct cgraph_node *ipa_pop_func_from_list (struct ipa_func_list **);
|
struct cgraph_node *ipa_pop_func_from_list (struct ipa_func_list **);
|
||||||
|
|
||||||
|
/* Add cgraph NODE to the worklist WL if it is not already in one. */
|
||||||
|
|
||||||
|
static inline void
|
||||||
|
ipa_push_func_to_list (struct ipa_func_list **wl, struct cgraph_node *node)
|
||||||
|
{
|
||||||
|
struct ipa_node_params *info = IPA_NODE_REF (node);
|
||||||
|
|
||||||
|
if (!info->node_enqueued)
|
||||||
|
ipa_push_func_to_list_1 (wl, node, info);
|
||||||
|
}
|
||||||
|
|
||||||
/* Callsite related calculations. */
|
/* Callsite related calculations. */
|
||||||
void ipa_compute_jump_functions (struct cgraph_edge *);
|
void ipa_compute_jump_functions (struct cgraph_edge *);
|
||||||
void ipa_count_arguments (struct cgraph_edge *);
|
void ipa_count_arguments (struct cgraph_edge *);
|
||||||
|
|
Loading…
Reference in New Issue