From 894594776523606d933e9598d76784df03b53392 Mon Sep 17 00:00:00 2001 From: vmakarov Date: Fri, 4 Apr 2008 19:10:49 +0000 Subject: [PATCH] 2008-04-04 Vladimir Makarov * ira-costs.c: Use GPL3 in the header. (find_allocno_class_costs): Use all important classes on the 1st iteration. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/ira@133907 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/ChangeLog | 6 ++++++ gcc/ira-costs.c | 49 +++++++++++++++++-------------------------------- 2 files changed, 23 insertions(+), 32 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 46db3da91a1..6af773b8737 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2008-04-04 Vladimir Makarov + + * ira-costs.c: Use GPL3 in the header. + (find_allocno_class_costs): Use all important + classes on the 1st iteration. + 2008-04-03 Vladimir Makarov PR rtl-optimization/35817 diff --git a/gcc/ira-costs.c b/gcc/ira-costs.c index d0b13b67e27..d3568b55675 100644 --- a/gcc/ira-costs.c +++ b/gcc/ira-costs.c @@ -7,7 +7,7 @@ This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free -Software Foundation; either version 2, or (at your option) any later +Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, but WITHOUT ANY @@ -16,9 +16,8 @@ FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License -along with GCC; see the file COPYING. If not, write to the Free -Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA -02110-1301, USA. */ +along with GCC; see the file COPYING3. If not see +. */ #include "config.h" #include "system.h" @@ -1137,36 +1136,22 @@ find_allocno_class_costs (void) if (internal_flag_ira_verbose > 0 && ira_dump_file) fprintf (ira_dump_file, "\nPass %i for finding allocno costs\n\n", pass); - if (pass != flag_expensive_optimizations) + /* We could use only cover classes on the 1st iteration. + Unfortunately it does not work well for some targets where + some subclass of cover class is costly and wrong cover class + is chosen on the first iteration and it can not be fixed on + the 2nd iteration. */ + for (cost_classes_num = 0; + cost_classes_num < important_classes_num; + cost_classes_num++) { - /* On the 1st iteration we calculates costs only for cover - classes. */ - for (cost_classes_num = 0; - cost_classes_num < reg_class_cover_size; - cost_classes_num++) - { - cost_classes [cost_classes_num] - = reg_class_cover [cost_classes_num]; - cost_class_nums [cost_classes [cost_classes_num]] - = cost_classes_num; - } - struct_costs_size - = sizeof (struct costs) + sizeof (int) * (cost_classes_num - 1); - } - else - { - for (cost_classes_num = 0; - cost_classes_num < important_classes_num; - cost_classes_num++) - { - cost_classes [cost_classes_num] - = important_classes [cost_classes_num]; - cost_class_nums [cost_classes [cost_classes_num]] - = cost_classes_num; - } - struct_costs_size - = sizeof (struct costs) + sizeof (int) * (cost_classes_num - 1); + cost_classes [cost_classes_num] + = important_classes [cost_classes_num]; + cost_class_nums [cost_classes [cost_classes_num]] + = cost_classes_num; } + struct_costs_size + = sizeof (struct costs) + sizeof (int) * (cost_classes_num - 1); /* Zero out our accumulation of the cost of each class for each allocno. */ memset (total_costs, 0, allocnos_num * struct_costs_size); -- 2.11.4.GIT