summaryrefslogtreecommitdiff
path: root/gcc/ira.c
diff options
context:
space:
mode:
authorrsandifo <rsandifo@138bc75d-0d04-0410-961f-82ee72b054a4>2008-09-20 09:15:43 +0000
committerrsandifo <rsandifo@138bc75d-0d04-0410-961f-82ee72b054a4>2008-09-20 09:15:43 +0000
commitd9595a8c1634960fcbeb19ac539d65a17baaa4e6 (patch)
treea9c18e21b19d7e54614cb457343b3cedb422d6bd /gcc/ira.c
parent333f0c1df127e1619402dade6ccbb3751db0367b (diff)
downloadgcc-d9595a8c1634960fcbeb19ac539d65a17baaa4e6.tar.gz
gcc/
* doc/tm.texi (TARGET_IRA_COVER_CLASSES): Define. (IRA_COVER_CLASSES): Refer to TARGET_IRA_COVER_CLASSES. * target.h (gcc_target): Add ira_cover_classes. * ira.c: Remove IRA_COVER_CLASSES guards. (setup_cover_and_important_classes): Use targetm.ira_cover_classes instead of IRA_COVER_CLASSES. (setup_cover_and_important_classes): Remove IRA_COVER_CLASSES guard. (setup_class_translate): Likewise. (setup_reg_class_intersect_union): Likewise. (find_reg_class_closure): Replace IRA_COVER_CLASSES guard with a test of targetm.ira_cover_classes. * opts.c (decode_options): Use targetm.ira_cover_classes instead of IRA_COVER_CLASSES. * target-def.h (TARGET_IRA_COVER_CLASSES): Define. (TARGET_INITIALIZER): Include it. * targhooks.h (default_ira_cover_classes): Declare. * targhooks.c (default_ira_cover_classes): New function. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@140512 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ira.c')
-rw-r--r--gcc/ira.c24
1 files changed, 8 insertions, 16 deletions
diff --git a/gcc/ira.c b/gcc/ira.c
index dfaf34fa4aa..f4d399cb491 100644
--- a/gcc/ira.c
+++ b/gcc/ira.c
@@ -714,8 +714,6 @@ enum reg_class ira_important_classes[N_REG_CLASSES];
classes. */
int ira_important_class_nums[N_REG_CLASSES];
-#ifdef IRA_COVER_CLASSES
-
/* Check IRA_COVER_CLASSES and sets the four global variables defined
above. */
static void
@@ -723,9 +721,10 @@ setup_cover_and_important_classes (void)
{
int i, j;
enum reg_class cl;
- static enum reg_class classes[] = IRA_COVER_CLASSES;
+ const enum reg_class *classes;
HARD_REG_SET temp_hard_regset2;
+ classes = targetm.ira_cover_classes ();
ira_reg_class_cover_size = 0;
for (i = 0; (cl = classes[i]) != LIM_REG_CLASSES; i++)
{
@@ -761,15 +760,12 @@ setup_cover_and_important_classes (void)
}
}
}
-#endif
/* Map of all register classes to corresponding cover class containing
the given class. If given class is not a subset of a cover class,
we translate it into the cheapest cover class. */
enum reg_class ira_class_translate[N_REG_CLASSES];
-#ifdef IRA_COVER_CLASSES
-
/* Set up array IRA_CLASS_TRANSLATE. */
static void
setup_class_translate (void)
@@ -837,7 +833,6 @@ setup_class_translate (void)
ira_class_translate[cl] = best_class;
}
}
-#endif
/* The biggest important reg_class inside of intersection of the two
reg_classes (that is calculated taking only hard registers
@@ -856,8 +851,6 @@ enum reg_class ira_reg_class_intersect[N_REG_CLASSES][N_REG_CLASSES];
reg_class_subunion value. */
enum reg_class ira_reg_class_union[N_REG_CLASSES][N_REG_CLASSES];
-#ifdef IRA_COVER_CLASSES
-
/* Set up IRA_REG_CLASS_INTERSECT and IRA_REG_CLASS_UNION. */
static void
setup_reg_class_intersect_union (void)
@@ -943,8 +936,6 @@ setup_reg_class_intersect_union (void)
}
}
-#endif
-
/* Output all cover classes and the translation map into file F. */
static void
print_class_cover (FILE *f)
@@ -975,11 +966,12 @@ static void
find_reg_class_closure (void)
{
setup_reg_subclasses ();
-#ifdef IRA_COVER_CLASSES
- setup_cover_and_important_classes ();
- setup_class_translate ();
- setup_reg_class_intersect_union ();
-#endif
+ if (targetm.ira_cover_classes)
+ {
+ setup_cover_and_important_classes ();
+ setup_class_translate ();
+ setup_reg_class_intersect_union ();
+ }
}