summaryrefslogtreecommitdiff
path: root/gcc/ira.c
diff options
context:
space:
mode:
authorrsandifo <rsandifo@138bc75d-0d04-0410-961f-82ee72b054a4>2012-10-02 19:34:38 +0000
committerrsandifo <rsandifo@138bc75d-0d04-0410-961f-82ee72b054a4>2012-10-02 19:34:38 +0000
commitc259678fdd8088668cb71fe2d6c00920ea24f815 (patch)
treedb8ded671097465c0fd2ce2c9d3774344bcda7fc /gcc/ira.c
parent61e26f31fae6b504f618bed1f6eb41018572ecc3 (diff)
downloadgcc-c259678fdd8088668cb71fe2d6c00920ea24f815.tar.gz
gcc/
* ira.h (target_ira): Add x_ira_class_singleton. (ira_class_singleton): New macro. * ira.c (setup_prohibited_class_mode_regs): Set up ira_class_singleton. * ira-build.c (update_conflict_hard_reg_costs): Use ira_class_singleton to check for classes with a single allocatable register. * ira-lives.c (ira_implicitly_set_insn_hard_regs): Likewise. (single_reg_class): Likewise. When more than one class is specified, check whether they have the same singleton register. (process_single_reg_class_operands): Require single_reg_class to return NO_REGS or a class with a single allocatable register. Obtain that register from ira_class_singleton. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@191995 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ira.c')
-rw-r--r--gcc/ira.c16
1 files changed, 14 insertions, 2 deletions
diff --git a/gcc/ira.c b/gcc/ira.c
index ad0ae0a8e6e..8436f606d97 100644
--- a/gcc/ira.c
+++ b/gcc/ira.c
@@ -1451,16 +1451,21 @@ setup_reg_class_nregs (void)
-/* Set up IRA_PROHIBITED_CLASS_MODE_REGS. */
+/* Set up IRA_PROHIBITED_CLASS_MODE_REGS and IRA_CLASS_SINGLETON.
+ This function is called once IRA_CLASS_HARD_REGS has been initialized. */
static void
setup_prohibited_class_mode_regs (void)
{
- int j, k, hard_regno, cl;
+ int j, k, hard_regno, cl, last_hard_regno, count;
for (cl = (int) N_REG_CLASSES - 1; cl >= 0; cl--)
{
+ COPY_HARD_REG_SET (temp_hard_regset, reg_class_contents[cl]);
+ AND_COMPL_HARD_REG_SET (temp_hard_regset, no_unit_alloc_regs);
for (j = 0; j < NUM_MACHINE_MODES; j++)
{
+ count = 0;
+ last_hard_regno = -1;
CLEAR_HARD_REG_SET (ira_prohibited_class_mode_regs[cl][j]);
for (k = ira_class_hard_regs_num[cl] - 1; k >= 0; k--)
{
@@ -1468,7 +1473,14 @@ setup_prohibited_class_mode_regs (void)
if (! HARD_REGNO_MODE_OK (hard_regno, (enum machine_mode) j))
SET_HARD_REG_BIT (ira_prohibited_class_mode_regs[cl][j],
hard_regno);
+ else if (in_hard_reg_set_p (temp_hard_regset,
+ (enum machine_mode) j, hard_regno))
+ {
+ last_hard_regno = hard_regno;
+ count++;
+ }
}
+ ira_class_singleton[cl][j] = (count == 1 ? last_hard_regno : -1);
}
}
}