public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH ] IRA: Speed up setup_left_conflict_sizes_p
@ 2015-03-11  2:39 Zhouyi Zhou
  2015-03-11 10:37 ` Richard Biener
  0 siblings, 1 reply; 2+ messages in thread
From: Zhouyi Zhou @ 2015-03-11  2:39 UTC (permalink / raw)
  To: gcc-patches; +Cc: Zhouyi Zhou

From: Zhouyi Zhou <yizhouzhou@ict.ac.cn>

In function setup_left_conflict_sizes_p, left conflict subnodes sizes
are computed in a down-to-up fashion through the regnodes foreast.

Speed up the process from prevent node itself to involve in this 
computation. 


Bootstrap and regtest scheduled on x86_64 GNU/Linux
Signed-off-by: Zhouyi Zhou <yizhouzhou@ict.ac.cn>
---
 gcc/ChangeLog   |    5 +++++
 gcc/ira-color.c |    8 +++-----
 2 files changed, 8 insertions(+), 5 deletions(-)

diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index b77fb5e..7688eda 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,8 @@
+2015-03-11  Zhouyi Zhou  <yizhouzhou@ict.ac.cn> 
+
+	* ira-color.c (setup_left_conflict_sizes_p): Prevent node itself
+	from computing left conflict subnodes size.
+	
 2015-03-10  Jakub Jelinek  <jakub@redhat.com>
 
 	PR target/65368
diff --git a/gcc/ira-color.c b/gcc/ira-color.c
index ff1fe8a..3e5c33a 100644
--- a/gcc/ira-color.c
+++ b/gcc/ira-color.c
@@ -938,7 +938,7 @@ setup_left_conflict_sizes_p (ira_allocno_t a)
       subnodes[i].left_conflict_subnodes_size = 0;
     }
   start = node_preorder_num * allocno_hard_regs_nodes_num;
-  for (i = data->hard_regs_subnodes_num - 1; i >= 0; i--)
+  for (i = data->hard_regs_subnodes_num - 1; i > 0; i--)
     {
       int size, parent_i;
       allocno_hard_regs_node_t parent;
@@ -948,12 +948,10 @@ setup_left_conflict_sizes_p (ira_allocno_t a)
 		     - subnodes[i].left_conflict_subnodes_size,
 		     subnodes[i].left_conflict_size));
       parent = allocno_hard_regs_nodes[i + node_preorder_num]->parent;
-      if (parent == NULL)
-	continue;
+      gcc_assert (parent);
       parent_i
 	= allocno_hard_regs_subnode_index[start + parent->preorder_num];
-      if (parent_i < 0)
-	continue;
+      gcc_assert (parent_i >= 0);
       subnodes[parent_i].left_conflict_subnodes_size += size;
     }
   left_conflict_subnodes_size = subnodes[0].left_conflict_subnodes_size;
-- 
1.7.10.4

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH ] IRA: Speed up setup_left_conflict_sizes_p
  2015-03-11  2:39 [PATCH ] IRA: Speed up setup_left_conflict_sizes_p Zhouyi Zhou
@ 2015-03-11 10:37 ` Richard Biener
  0 siblings, 0 replies; 2+ messages in thread
From: Richard Biener @ 2015-03-11 10:37 UTC (permalink / raw)
  To: Zhouyi Zhou; +Cc: GCC Patches, Zhouyi Zhou

On Wed, Mar 11, 2015 at 3:39 AM, Zhouyi Zhou <zhouzhouyi@gmail.com> wrote:
> From: Zhouyi Zhou <yizhouzhou@ict.ac.cn>
>
> In function setup_left_conflict_sizes_p, left conflict subnodes sizes
> are computed in a down-to-up fashion through the regnodes foreast.
>
> Speed up the process from prevent node itself to involve in this
> computation.

Please use gcc_checking_assert()s.

>
> Bootstrap and regtest scheduled on x86_64 GNU/Linux
> Signed-off-by: Zhouyi Zhou <yizhouzhou@ict.ac.cn>
> ---
>  gcc/ChangeLog   |    5 +++++
>  gcc/ira-color.c |    8 +++-----
>  2 files changed, 8 insertions(+), 5 deletions(-)
>
> diff --git a/gcc/ChangeLog b/gcc/ChangeLog
> index b77fb5e..7688eda 100644
> --- a/gcc/ChangeLog
> +++ b/gcc/ChangeLog
> @@ -1,3 +1,8 @@
> +2015-03-11  Zhouyi Zhou  <yizhouzhou@ict.ac.cn>
> +
> +       * ira-color.c (setup_left_conflict_sizes_p): Prevent node itself
> +       from computing left conflict subnodes size.
> +
>  2015-03-10  Jakub Jelinek  <jakub@redhat.com>
>
>         PR target/65368
> diff --git a/gcc/ira-color.c b/gcc/ira-color.c
> index ff1fe8a..3e5c33a 100644
> --- a/gcc/ira-color.c
> +++ b/gcc/ira-color.c
> @@ -938,7 +938,7 @@ setup_left_conflict_sizes_p (ira_allocno_t a)
>        subnodes[i].left_conflict_subnodes_size = 0;
>      }
>    start = node_preorder_num * allocno_hard_regs_nodes_num;
> -  for (i = data->hard_regs_subnodes_num - 1; i >= 0; i--)
> +  for (i = data->hard_regs_subnodes_num - 1; i > 0; i--)
>      {
>        int size, parent_i;
>        allocno_hard_regs_node_t parent;
> @@ -948,12 +948,10 @@ setup_left_conflict_sizes_p (ira_allocno_t a)
>                      - subnodes[i].left_conflict_subnodes_size,
>                      subnodes[i].left_conflict_size));
>        parent = allocno_hard_regs_nodes[i + node_preorder_num]->parent;
> -      if (parent == NULL)
> -       continue;
> +      gcc_assert (parent);
>        parent_i
>         = allocno_hard_regs_subnode_index[start + parent->preorder_num];
> -      if (parent_i < 0)
> -       continue;
> +      gcc_assert (parent_i >= 0);
>        subnodes[parent_i].left_conflict_subnodes_size += size;
>      }
>    left_conflict_subnodes_size = subnodes[0].left_conflict_subnodes_size;
> --
> 1.7.10.4
>

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-03-11 10:37 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-03-11  2:39 [PATCH ] IRA: Speed up setup_left_conflict_sizes_p Zhouyi Zhou
2015-03-11 10:37 ` Richard Biener

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).