aboutsummaryrefslogtreecommitdiff
path: root/gcc/ira.c
diff options
context:
space:
mode:
authorRichard Sandiford <rdsandiford@googlemail.com>2012-10-02 19:34:49 +0000
committerRichard Sandiford <rsandifo@gcc.gnu.org>2012-10-02 19:34:49 +0000
commita2c19e9343706412d3320e3b6b2688d01ace96a5 (patch)
tree431668293bd4a0018f9e8856e4c146862a0c276d /gcc/ira.c
parentc9d74da68c27d7af5c5c2edef7f723190ab461d2 (diff)
downloadgcc-a2c19e9343706412d3320e3b6b2688d01ace96a5.zip
gcc-a2c19e9343706412d3320e3b6b2688d01ace96a5.tar.gz
gcc-a2c19e9343706412d3320e3b6b2688d01ace96a5.tar.bz2
ira-int.h (target_ira_int): Add x_ira_useful_class_mode_regs.
gcc/ * ira-int.h (target_ira_int): Add x_ira_useful_class_mode_regs. (ira_useful_class_mode_regs): New macro. * ira.c (clarify_prohibited_class_mode_regs): Set up ira_useful_class_mode_regs. * ira-color.c (setup_profitable_hard_regs): Use it to initialise profitable_hard_regs. From-SVN: r191996
Diffstat (limited to 'gcc/ira.c')
-rw-r--r--gcc/ira.c45
1 files changed, 26 insertions, 19 deletions
diff --git a/gcc/ira.c b/gcc/ira.c
index 8436f60..4a7dcb5 100644
--- a/gcc/ira.c
+++ b/gcc/ira.c
@@ -1495,29 +1495,36 @@ clarify_prohibited_class_mode_regs (void)
for (cl = (int) N_REG_CLASSES - 1; cl >= 0; cl--)
for (j = 0; j < NUM_MACHINE_MODES; j++)
- for (k = ira_class_hard_regs_num[cl] - 1; k >= 0; k--)
- {
- hard_regno = ira_class_hard_regs[cl][k];
- if (TEST_HARD_REG_BIT (ira_prohibited_class_mode_regs[cl][j], hard_regno))
- continue;
- nregs = hard_regno_nregs[hard_regno][j];
- if (hard_regno + nregs > FIRST_PSEUDO_REGISTER)
- {
- SET_HARD_REG_BIT (ira_prohibited_class_mode_regs[cl][j],
- hard_regno);
- continue;
- }
- pclass = ira_pressure_class_translate[REGNO_REG_CLASS (hard_regno)];
- for (nregs-- ;nregs >= 0; nregs--)
- if (((enum reg_class) pclass
- != ira_pressure_class_translate[REGNO_REG_CLASS
- (hard_regno + nregs)]))
+ {
+ CLEAR_HARD_REG_SET (ira_useful_class_mode_regs[cl][j]);
+ for (k = ira_class_hard_regs_num[cl] - 1; k >= 0; k--)
+ {
+ hard_regno = ira_class_hard_regs[cl][k];
+ if (TEST_HARD_REG_BIT (ira_prohibited_class_mode_regs[cl][j], hard_regno))
+ continue;
+ nregs = hard_regno_nregs[hard_regno][j];
+ if (hard_regno + nregs > FIRST_PSEUDO_REGISTER)
{
SET_HARD_REG_BIT (ira_prohibited_class_mode_regs[cl][j],
hard_regno);
- break;
+ continue;
}
- }
+ pclass = ira_pressure_class_translate[REGNO_REG_CLASS (hard_regno)];
+ for (nregs-- ;nregs >= 0; nregs--)
+ if (((enum reg_class) pclass
+ != ira_pressure_class_translate[REGNO_REG_CLASS
+ (hard_regno + nregs)]))
+ {
+ SET_HARD_REG_BIT (ira_prohibited_class_mode_regs[cl][j],
+ hard_regno);
+ break;
+ }
+ if (!TEST_HARD_REG_BIT (ira_prohibited_class_mode_regs[cl][j],
+ hard_regno))
+ add_to_hard_reg_set (&ira_useful_class_mode_regs[cl][j],
+ (enum machine_mode) j, hard_regno);
+ }
+ }
}
/* Allocate and initialize IRA_REGISTER_MOVE_COST, IRA_MAY_MOVE_IN_COST