From: Zhouyi Zhou <yizhouz...@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 <yizhouz...@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  <yizhouz...@ict.ac.cn>
+
+       * ira-conflicts.c (build_conflict_bit_table): avoid obj self comparing.
+       
 2014-11-16  Jan Hubicka  <hubi...@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

Reply via email to