diff options
author | Vladimir Makarov <vmakarov@redhat.com> | 2015-09-24 20:40:30 +0000 |
---|---|---|
committer | Vladimir Makarov <vmakarov@gcc.gnu.org> | 2015-09-24 20:40:30 +0000 |
commit | 86f0bef37378a05ef620a6120b95698c3f113db8 (patch) | |
tree | a25a56cc9d84014637dade6e7835f7c12d69eb5b | |
parent | 3563212292d643dee54ff75771032ea92fe34e78 (diff) | |
download | gcc-86f0bef37378a05ef620a6120b95698c3f113db8.zip gcc-86f0bef37378a05ef620a6120b95698c3f113db8.tar.gz gcc-86f0bef37378a05ef620a6120b95698c3f113db8.tar.bz2 |
re PR target/61578 (Code size increase for ARM thumb compared to 4.8.x when compiling with -Os)
2015-09-24 Vladimir Makarov <vmakarov@redhat.com>
PR target/61578
* ira-color.c (update_allocno_cost): Add parameter.
(update_costs_from_allocno): Decrease conflict cost. Pass the new
parameter.
From-SVN: r228097
-rw-r--r-- | gcc/ChangeLog | 7 | ||||
-rw-r--r-- | gcc/ira-color.c | 25 |
2 files changed, 25 insertions, 7 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index d0893001..e951934 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,10 @@ +2015-09-24 Vladimir Makarov <vmakarov@redhat.com> + + PR target/61578 + * ira-color.c (update_allocno_cost): Add parameter. + (update_costs_from_allocno): Decrease conflict cost. Pass the new + parameter. + 2015-09-24 Manuel López-Ibáñez <manu@gcc.gnu.org> PR driver/67640 diff --git a/gcc/ira-color.c b/gcc/ira-color.c index e6533c6..a4820fb 100644 --- a/gcc/ira-color.c +++ b/gcc/ira-color.c @@ -1311,10 +1311,12 @@ get_next_update_cost (ira_allocno_t *allocno, ira_allocno_t *from, int *divisor) return true; } -/* Increase costs of HARD_REGNO by UPDATE_COST for ALLOCNO. Return - true if we really modified the cost. */ +/* Increase costs of HARD_REGNO by UPDATE_COST and conflict cost by + UPDATE_CONFLICT_COST for ALLOCNO. Return true if we really + modified the cost. */ static bool -update_allocno_cost (ira_allocno_t allocno, int hard_regno, int update_cost) +update_allocno_cost (ira_allocno_t allocno, int hard_regno, + int update_cost, int update_conflict_cost) { int i; enum reg_class aclass = ALLOCNO_CLASS (allocno); @@ -1330,7 +1332,7 @@ update_allocno_cost (ira_allocno_t allocno, int hard_regno, int update_cost) (&ALLOCNO_UPDATED_CONFLICT_HARD_REG_COSTS (allocno), aclass, 0, ALLOCNO_CONFLICT_HARD_REG_COSTS (allocno)); ALLOCNO_UPDATED_HARD_REG_COSTS (allocno)[i] += update_cost; - ALLOCNO_UPDATED_CONFLICT_HARD_REG_COSTS (allocno)[i] += update_cost; + ALLOCNO_UPDATED_CONFLICT_HARD_REG_COSTS (allocno)[i] += update_conflict_cost; return true; } @@ -1342,7 +1344,7 @@ static void update_costs_from_allocno (ira_allocno_t allocno, int hard_regno, int divisor, bool decr_p, bool record_p) { - int cost, update_cost; + int cost, update_cost, update_conflict_cost; machine_mode mode; enum reg_class rclass, aclass; ira_allocno_t another_allocno, from = NULL; @@ -1383,11 +1385,20 @@ update_costs_from_allocno (ira_allocno_t allocno, int hard_regno, if (decr_p) cost = -cost; - update_cost = cp->freq * cost / divisor; + update_conflict_cost = update_cost = cp->freq * cost / divisor; + + if (ALLOCNO_COLOR_DATA (another_allocno) != NULL + && (ALLOCNO_COLOR_DATA (allocno)->first_thread_allocno + != ALLOCNO_COLOR_DATA (another_allocno)->first_thread_allocno)) + /* Decrease conflict cost of ANOTHER_ALLOCNO if it is not + in the same allocation thread. */ + update_conflict_cost /= COST_HOP_DIVISOR; + if (update_cost == 0) continue; - if (! update_allocno_cost (another_allocno, hard_regno, update_cost)) + if (! update_allocno_cost (another_allocno, hard_regno, + update_cost, update_conflict_cost)) continue; queue_update_cost (another_allocno, allocno, divisor * COST_HOP_DIVISOR); if (record_p && ALLOCNO_COLOR_DATA (another_allocno) != NULL) |