aboutsummaryrefslogtreecommitdiff
path: root/gcc/regclass.c
diff options
context:
space:
mode:
authorRichard Sandiford <richard@codesourcery.com>2007-05-22 19:33:37 +0000
committerRichard Sandiford <rsandifo@gcc.gnu.org>2007-05-22 19:33:37 +0000
commit56b138aed218de6e61416f2615424800ff7a0d18 (patch)
treecfa4aaeabd4b1bbd0608b1fb3976bc0540f8ed3a /gcc/regclass.c
parent965ff67081ef58732db2256a1acba5cc3bb986be (diff)
downloadgcc-56b138aed218de6e61416f2615424800ff7a0d18.zip
gcc-56b138aed218de6e61416f2615424800ff7a0d18.tar.gz
gcc-56b138aed218de6e61416f2615424800ff7a0d18.tar.bz2
hard-reg-set.h (GO_IF_HARD_REG_SUBSET, [...]): Delete in favor of...
gcc/ * hard-reg-set.h (GO_IF_HARD_REG_SUBSET, GO_IF_HARD_REG_EQUAL): Delete in favor of... (hard_reg_subset_p, hard_reg_sets_equal_p, hard_reg_sets_intersect_p) (hard_reg_set_empty_p): ...these new functions. * bt-load.c (choose_btr): Use hard_reg_subset_p instead of GO_IF_HARD_REG_SUBSET. * cfgcleanup.c (old_insns_match_p): Use hard_reg_sets_equal_p instead of GO_IF_HARD_REG_EQUAL. * df-problems.c (df_urec_local_compute): Use hard_reg_set_empty_p instead of GO_IF_HARD_REG_EQUAL. * global.c (find_reg): Use hard_reg_set_empty_p instead of GO_IF_HARD_REG_SUBSET. (modify_reg_pav): Use hard_reg_set_empty_p instead of GO_IF_HARD_REG_EQUAL. * local-alloc.c (find_free_reg): Use hard_reg_subset_p instead of GO_IF_HARD_REG_SUBSET. * reg-stack.c (change_stack, convert_regs_1): Use hard_reg_sets_equal_p instead of GO_IF_HARD_REG_EQUAL. * regclass.c (init_reg_sets_1, reg_scan_mark_refs): Use hard_reg_subset_p instead of GO_IF_HARD_REG_SUBSET. (reg_classes_intersect_p): Use hard_reg_sets_intersect_p instead of GO_IF_HARD_REG_SUBSET, * reload1.c (finish_spills): Use hard_reg_subset_p instead of GO_IF_HARD_REG_SUBSET. * struct-equiv.c (death_notes_match_p): Use hard_reg_sets_equal_p instead of GO_IF_HARD_REG_EQUAL. * config/sh/sh.c (push_regs, calc_live_regs): Use hard_reg_sets_intersect_p instead of hard_regs_intersect_p. (hard_regs_intersect_p): Delete. From-SVN: r124954
Diffstat (limited to 'gcc/regclass.c')
-rw-r--r--gcc/regclass.c86
1 files changed, 30 insertions, 56 deletions
diff --git a/gcc/regclass.c b/gcc/regclass.c
index 60af8ac..1067f93 100644
--- a/gcc/regclass.c
+++ b/gcc/regclass.c
@@ -338,20 +338,11 @@ init_reg_sets_1 (void)
COPY_HARD_REG_SET (c, reg_class_contents[i]);
IOR_HARD_REG_SET (c, reg_class_contents[j]);
for (k = 0; k < N_REG_CLASSES; k++)
- {
- GO_IF_HARD_REG_SUBSET (reg_class_contents[k], c,
- subclass1);
- continue;
-
- subclass1:
- /* Keep the largest subclass. */ /* SPEE 900308 */
- GO_IF_HARD_REG_SUBSET (reg_class_contents[k],
- reg_class_contents[(int) reg_class_subunion[i][j]],
- subclass2);
+ if (hard_reg_set_subset_p (reg_class_contents[k], c)
+ && !hard_reg_set_subset_p (reg_class_contents[k],
+ reg_class_contents
+ [(int) reg_class_subunion[i][j]]))
reg_class_subunion[i][j] = (enum reg_class) k;
- subclass2:
- ;
- }
}
}
@@ -369,9 +360,9 @@ init_reg_sets_1 (void)
COPY_HARD_REG_SET (c, reg_class_contents[i]);
IOR_HARD_REG_SET (c, reg_class_contents[j]);
for (k = 0; k < N_REG_CLASSES; k++)
- GO_IF_HARD_REG_SUBSET (c, reg_class_contents[k], superclass);
+ if (hard_reg_set_subset_p (c, reg_class_contents[k]))
+ break;
- superclass:
reg_class_superunion[i][j] = (enum reg_class) k;
}
}
@@ -394,23 +385,21 @@ init_reg_sets_1 (void)
continue;
for (j = i + 1; j < N_REG_CLASSES; j++)
- {
- enum reg_class *p;
-
- GO_IF_HARD_REG_SUBSET (reg_class_contents[i], reg_class_contents[j],
- subclass);
- continue;
- subclass:
- /* Reg class I is a subclass of J.
- Add J to the table of superclasses of I. */
- p = &reg_class_superclasses[i][0];
- while (*p != LIM_REG_CLASSES) p++;
- *p = (enum reg_class) j;
- /* Add I to the table of superclasses of J. */
- p = &reg_class_subclasses[j][0];
- while (*p != LIM_REG_CLASSES) p++;
- *p = (enum reg_class) i;
- }
+ if (hard_reg_set_subset_p (reg_class_contents[i],
+ reg_class_contents[j]))
+ {
+ /* Reg class I is a subclass of J.
+ Add J to the table of superclasses of I. */
+ enum reg_class *p;
+
+ p = &reg_class_superclasses[i][0];
+ while (*p != LIM_REG_CLASSES) p++;
+ *p = (enum reg_class) j;
+ /* Add I to the table of superclasses of J. */
+ p = &reg_class_subclasses[j][0];
+ while (*p != LIM_REG_CLASSES) p++;
+ *p = (enum reg_class) i;
+ }
}
/* Initialize "constant" tables. */
@@ -2502,15 +2491,10 @@ reg_scan_mark_refs (rtx x, rtx insn, int note_flag, unsigned int min_regno)
int
reg_class_subset_p (enum reg_class c1, enum reg_class c2)
{
- if (c1 == c2) return 1;
-
- if (c2 == ALL_REGS)
- win:
- return 1;
- GO_IF_HARD_REG_SUBSET (reg_class_contents[(int) c1],
- reg_class_contents[(int) c2],
- win);
- return 0;
+ return (c1 == c2
+ || c2 == ALL_REGS
+ || hard_reg_set_subset_p (reg_class_contents[(int) c1],
+ reg_class_contents[(int) c2]));
}
/* Return nonzero if there is a register that is in both C1 and C2. */
@@ -2518,21 +2502,11 @@ reg_class_subset_p (enum reg_class c1, enum reg_class c2)
int
reg_classes_intersect_p (enum reg_class c1, enum reg_class c2)
{
- HARD_REG_SET c;
-
- if (c1 == c2) return 1;
-
- if (c1 == ALL_REGS || c2 == ALL_REGS)
- return 1;
-
- COPY_HARD_REG_SET (c, reg_class_contents[(int) c1]);
- AND_HARD_REG_SET (c, reg_class_contents[(int) c2]);
-
- GO_IF_HARD_REG_SUBSET (c, reg_class_contents[(int) NO_REGS], lose);
- return 1;
-
- lose:
- return 0;
+ return (c1 == c2
+ || c1 == ALL_REGS
+ || c2 == ALL_REGS
+ || hard_reg_set_intersect_p (reg_class_contents[(int) c1],
+ reg_class_contents[(int) c2]));
}
#ifdef CANNOT_CHANGE_MODE_CLASS