Commit 35a952ba by Martin Jambor Committed by Martin Jambor

[PR80803 1/2] Streamline SRA access enqueuing

2017-06-13  Martin Jambor  <mjambor@suse.cz>

	* tree-sra.c (add_access_to_work_queue): Only enqueue accesses
	that have a first_link.
	(sort_and_splice_var_accesses): Do not check first_link before
	enquing.
	(subtree_mark_written_and_enqueue): Likewise.
	(propagate_all_subaccesses): Likewise and do not stop at first
	parent with a first_link.

From-SVN: r249153
parent 7aa923e0
2017-06-13 Martin Jambor <mjambor@suse.cz> 2017-06-13 Martin Jambor <mjambor@suse.cz>
* tree-sra.c (add_access_to_work_queue): Only enqueue accesses
that have a first_link.
(sort_and_splice_var_accesses): Do not check first_link before
enquing.
(subtree_mark_written_and_enqueue): Likewise.
(propagate_all_subaccesses): Likewise and do not stop at first
parent with a first_link.
2017-06-13 Martin Jambor <mjambor@suse.cz>
* tree-sra.c (dump_access_tree_1): Fix accidental dumping to stderr * tree-sra.c (dump_access_tree_1): Fix accidental dumping to stderr
instead of f. instead of f.
......
...@@ -627,7 +627,7 @@ relink_to_new_repr (struct access *new_racc, struct access *old_racc) ...@@ -627,7 +627,7 @@ relink_to_new_repr (struct access *new_racc, struct access *old_racc)
static void static void
add_access_to_work_queue (struct access *access) add_access_to_work_queue (struct access *access)
{ {
if (!access->grp_queued) if (access->first_link && !access->grp_queued)
{ {
gcc_assert (!access->next_queued); gcc_assert (!access->next_queued);
access->next_queued = work_queue_head; access->next_queued = work_queue_head;
...@@ -2112,7 +2112,6 @@ sort_and_splice_var_accesses (tree var) ...@@ -2112,7 +2112,6 @@ sort_and_splice_var_accesses (tree var)
access->grp_total_scalarization = total_scalarization; access->grp_total_scalarization = total_scalarization;
access->grp_partial_lhs = grp_partial_lhs; access->grp_partial_lhs = grp_partial_lhs;
access->grp_unscalarizable_region = unscalarizable_region; access->grp_unscalarizable_region = unscalarizable_region;
if (access->first_link)
add_access_to_work_queue (access); add_access_to_work_queue (access);
*prev_acc_ptr = access; *prev_acc_ptr = access;
...@@ -2670,7 +2669,6 @@ subtree_mark_written_and_enqueue (struct access *access) ...@@ -2670,7 +2669,6 @@ subtree_mark_written_and_enqueue (struct access *access)
if (access->grp_write) if (access->grp_write)
return; return;
access->grp_write = true; access->grp_write = true;
if (access->first_link)
add_access_to_work_queue (access); add_access_to_work_queue (access);
struct access *child; struct access *child;
...@@ -2715,11 +2713,7 @@ propagate_all_subaccesses (void) ...@@ -2715,11 +2713,7 @@ propagate_all_subaccesses (void)
if (reque_parents) if (reque_parents)
do do
{ {
if (lacc->first_link)
{
add_access_to_work_queue (lacc); add_access_to_work_queue (lacc);
break;
}
lacc = lacc->parent; lacc = lacc->parent;
} }
while (lacc); while (lacc);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment