This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH] gcc/ira-color.c: save a init statement
- From: Zhouyi Zhou <zhouzhouyi at gmail dot com>
- To: gcc-patches at gcc dot gnu dot org
- Cc: Zhouyi Zhou <yizhouzhou at ict dot ac dot cn>
- Date: Mon, 9 Feb 2015 15:57:07 +0800
- Subject: [PATCH] gcc/ira-color.c: save a init statement
- Authentication-results: sourceware.org; auth=none
In function setup_left_conflict_sizes_p, init assignment
conflict_size = 0 could be eliminated for the tidiness.
I have no write access to gcc repository and I can't
provide a testcase because the improvement has effective
compiler no output.
Bootstraped and regtested in x86_64 Linux
Signed-off-by: Zhouyi Zhou <yizhouzhou@ict.ac.cn>
---
gcc/ChangeLog | 3 +++
gcc/ira-color.c | 3 +--
2 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index bd74326..577b57e 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,6 @@
+2015-02-09 Zhouyi Zhou <yizhouzhou@ict.ac.cn>
+ * ira-color.c (setup_left_conflict_sizes_p): save a init statement.
+
2015-02-08 Andrew Pinski <apinski@cavium.com>
* config/aarch64/aarch64.c (gty_dummy): Delete.
diff --git a/gcc/ira-color.c b/gcc/ira-color.c
index d04be29..5591637 100644
--- a/gcc/ira-color.c
+++ b/gcc/ira-color.c
@@ -858,7 +858,6 @@ setup_left_conflict_sizes_p (ira_allocno_t a)
HARD_REG_SET node_set;
nobj = ALLOCNO_NUM_OBJECTS (a);
- conflict_size = 0;
data = ALLOCNO_COLOR_DATA (a);
subnodes = allocno_hard_regs_subnodes + data->hard_regs_subnodes_start;
COPY_HARD_REG_SET (profitable_hard_regs, data->profitable_hard_regs);
@@ -959,7 +958,7 @@ setup_left_conflict_sizes_p (ira_allocno_t a)
}
left_conflict_subnodes_size = subnodes[0].left_conflict_subnodes_size;
conflict_size
- += (left_conflict_subnodes_size
+ = (left_conflict_subnodes_size
+ MIN (subnodes[0].max_node_impact - left_conflict_subnodes_size,
subnodes[0].left_conflict_size));
conflict_size += ira_reg_class_max_nregs[ALLOCNO_CLASS (a)][ALLOCNO_MODE (a)];
--
1.7.10.4