diff options
author | Ken Raeburn <raeburn@cygnus.com> | 1998-02-26 13:45:45 +0000 |
---|---|---|
committer | Ken Raeburn <raeburn@gcc.gnu.org> | 1998-02-26 13:45:45 +0000 |
commit | acbce66755fe7b7e252103c12102ef5d8b193321 (patch) | |
tree | e06f7acdfdfbfffc61e840bf158051154cca6816 | |
parent | 5cd4989aa1eb12c71d7d8555ccdf59a1ff974e6a (diff) | |
download | gcc-acbce66755fe7b7e252103c12102ef5d8b193321.zip gcc-acbce66755fe7b7e252103c12102ef5d8b193321.tar.gz gcc-acbce66755fe7b7e252103c12102ef5d8b193321.tar.bz2 |
regclass.c (init_reg_sets): Move init of move cost tables...
* regclass.c (init_reg_sets): Move init of move cost tables...
(init_reg_sets_1): ...to here.
From-SVN: r18273
-rw-r--r-- | gcc/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/regclass.c | 66 |
2 files changed, 38 insertions, 33 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index a8f9195..ccd60ef 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +1998-02-26 Ken Raeburn <raeburn@cygnus.com> + + * regclass.c (init_reg_sets): Move init of move cost tables... + (init_reg_sets_1): ...to here. + Thu Feb 26 00:13:21 1998 Ian Lance Taylor <ian@cygnus.com> * choose-temp.c: Fix handling of sys/file.h to work in libiberty. diff --git a/gcc/regclass.c b/gcc/regclass.c index 1f369a7..d43940d 100644 --- a/gcc/regclass.c +++ b/gcc/regclass.c @@ -318,38 +318,6 @@ init_reg_sets () } } - /* Initialize the move cost table. Find every subset of each class - and take the maximum cost of moving any subset to any other. */ - - for (i = 0; i < N_REG_CLASSES; i++) - for (j = 0; j < N_REG_CLASSES; j++) - { - int cost = i == j ? 2 : REGISTER_MOVE_COST (i, j); - enum reg_class *p1, *p2; - - for (p2 = ®_class_subclasses[j][0]; *p2 != LIM_REG_CLASSES; p2++) - if (*p2 != i) - cost = MAX (cost, REGISTER_MOVE_COST (i, *p2)); - - for (p1 = ®_class_subclasses[i][0]; *p1 != LIM_REG_CLASSES; p1++) - { - if (*p1 != j) - cost = MAX (cost, REGISTER_MOVE_COST (*p1, j)); - - for (p2 = ®_class_subclasses[j][0]; - *p2 != LIM_REG_CLASSES; p2++) - if (*p1 != *p2) - cost = MAX (cost, REGISTER_MOVE_COST (*p1, *p2)); - } - - move_cost[i][j] = cost; - - if (reg_class_subset_p (i, j)) - cost = 0; - - may_move_cost[i][j] = cost; - } - /* Do any additional initialization regsets may need */ INIT_ONCE_REG_SET (); } @@ -360,7 +328,7 @@ init_reg_sets () static void init_reg_sets_1 () { - register int i; + register int i, j; /* This macro allows the fixed or call-used registers to depend on target flags. */ @@ -393,6 +361,38 @@ init_reg_sets_1 () if (CLASS_LIKELY_SPILLED_P (REGNO_REG_CLASS (i))) SET_HARD_REG_BIT (losing_caller_save_reg_set, i); } + + /* Initialize the move cost table. Find every subset of each class + and take the maximum cost of moving any subset to any other. */ + + for (i = 0; i < N_REG_CLASSES; i++) + for (j = 0; j < N_REG_CLASSES; j++) + { + int cost = i == j ? 2 : REGISTER_MOVE_COST (i, j); + enum reg_class *p1, *p2; + + for (p2 = ®_class_subclasses[j][0]; *p2 != LIM_REG_CLASSES; p2++) + if (*p2 != i) + cost = MAX (cost, REGISTER_MOVE_COST (i, *p2)); + + for (p1 = ®_class_subclasses[i][0]; *p1 != LIM_REG_CLASSES; p1++) + { + if (*p1 != j) + cost = MAX (cost, REGISTER_MOVE_COST (*p1, j)); + + for (p2 = ®_class_subclasses[j][0]; + *p2 != LIM_REG_CLASSES; p2++) + if (*p1 != *p2) + cost = MAX (cost, REGISTER_MOVE_COST (*p1, *p2)); + } + + move_cost[i][j] = cost; + + if (reg_class_subset_p (i, j)) + cost = 0; + + may_move_cost[i][j] = cost; + } } /* Compute the table of register modes. |