public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] gcc/ira-conflicts.c: avoid conflict obj compare with itself
@ 2014-11-17  7:16 Zhouyi Zhou
  2014-11-17 22:12 ` Jeff Law
  0 siblings, 1 reply; 2+ messages in thread
From: Zhouyi Zhou @ 2014-11-17  7:16 UTC (permalink / raw)
  To: gcc-patches, vmakarov; +Cc: Zhouyi Zhou

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

In function build_conflict_bit_table, id is set in objects_live before
traversing that sparseset, so the obj is unnessary compared with itself 
during the traversing. 
The comparing of obj with itself can be avoided by means of moving   
sparseset_set_bit (objects_live, id) after the traversing.

I have no write access to gcc repository and I can't provide a testcase
because the improvement has effective compile no output.
 
Bootstraped and regtested in x86_64 Linux 
Signed-off-by: Zhouyi Zhou <yizhouzhou@ict.ac.cn>
---
 gcc/ChangeLog       |    4 ++++
 gcc/ira-conflicts.c |    2 +-
 2 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index d385e33..3f4b14e 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,7 @@
+2014-11-17  Zhouyi Zhou  <yizhouzhou@ict.ac.cn>
+
+	* ira-conflicts.c (build_conflict_bit_table): avoid obj self comparing.
+	
 2014-11-16  Jan Hubicka  <hubicka@ucw.cz>
 
 	* ipa-polymorphic-call.c
diff --git a/gcc/ira-conflicts.c b/gcc/ira-conflicts.c
index 7aaf0cb..cccdb6b 100644
--- a/gcc/ira-conflicts.c
+++ b/gcc/ira-conflicts.c
@@ -177,7 +177,6 @@ build_conflict_bit_table (void)
 	  gcc_assert (id < ira_objects_num);
 
 	  aclass = ALLOCNO_CLASS (allocno);
-	  sparseset_set_bit (objects_live, id);
 	  EXECUTE_IF_SET_IN_SPARSESET (objects_live, j)
 	    {
 	      ira_object_t live_obj = ira_object_id_map[j];
@@ -191,6 +190,7 @@ build_conflict_bit_table (void)
 		  record_object_conflict (obj, live_obj);
 		}
 	    }
+	  sparseset_set_bit (objects_live, id);
 	}
 
       for (r = ira_finish_point_ranges[i]; r != NULL; r = r->finish_next)
-- 
1.7.10.4

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

* Re: [PATCH] gcc/ira-conflicts.c: avoid conflict obj compare with itself
  2014-11-17  7:16 [PATCH] gcc/ira-conflicts.c: avoid conflict obj compare with itself Zhouyi Zhou
@ 2014-11-17 22:12 ` Jeff Law
  0 siblings, 0 replies; 2+ messages in thread
From: Jeff Law @ 2014-11-17 22:12 UTC (permalink / raw)
  To: Zhouyi Zhou, gcc-patches, vmakarov; +Cc: Zhouyi Zhou

On 11/16/14 23:31, Zhouyi Zhou wrote:
> From: Zhouyi Zhou <yizhouzhou@ict.ac.cn>
>
> In function build_conflict_bit_table, id is set in objects_live before
> traversing that sparseset, so the obj is unnessary compared with itself
> during the traversing.
> The comparing of obj with itself can be avoided by means of moving
> sparseset_set_bit (objects_live, id) after the traversing.
>
> I have no write access to gcc repository and I can't provide a testcase
> because the improvement has effective compile no output.
>
> Bootstraped and regtested in x86_64 Linux
> Signed-off-by: Zhouyi Zhou <yizhouzhou@ict.ac.cn>
> ---
>   gcc/ChangeLog       |    4 ++++
>   gcc/ira-conflicts.c |    2 +-
>   2 files changed, 5 insertions(+), 1 deletion(-)
>
> diff --git a/gcc/ChangeLog b/gcc/ChangeLog
> index d385e33..3f4b14e 100644
> --- a/gcc/ChangeLog
> +++ b/gcc/ChangeLog
> @@ -1,3 +1,7 @@
> +2014-11-17  Zhouyi Zhou  <yizhouzhou@ict.ac.cn>
> +
> +	* ira-conflicts.c (build_conflict_bit_table): avoid obj self comparing.
Thanks installed.

jeff

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

end of thread, other threads:[~2014-11-17 22:05 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-11-17  7:16 [PATCH] gcc/ira-conflicts.c: avoid conflict obj compare with itself Zhouyi Zhou
2014-11-17 22:12 ` Jeff Law

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).