From d8817c59ec135b0894ab067559da788048cc409f Mon Sep 17 00:00:00 2001 From: hubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4> Date: Fri, 17 Dec 1999 13:19:41 +0000 Subject: [PATCH] * regclass.c (regclass): Do not use flowgraph when not optimizing. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@30993 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/ChangeLog | 2 ++ gcc/regclass.c | 43 ++++++++++++++++++++++++------------------- 2 files changed, 26 insertions(+), 19 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 1728e84f13e8..8c3831ea61eb 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,5 +1,7 @@ Fri Dec 17 12:08:11 MET 1999 Jan Hubicka <hubicka@freesoftr.cz> + * regclass.c (regclass): Do not use flowgraph when not optimizing. + * gcse.c (try_replace_reg): Do replacements in REG_EQUAL/REG_EQUIV notes too, create one when replacement failed, attempt to simplify resulting notes. diff --git a/gcc/regclass.c b/gcc/regclass.c index 3c28580496c8..1ae876a6d3f0 100644 --- a/gcc/regclass.c +++ b/gcc/regclass.c @@ -1070,30 +1070,35 @@ regclass (f, nregs, dump) bzero (in_inc_dec, nregs); #endif - loop_cost = 1; - /* Scan the instructions and record each time it would save code to put a certain register in a certain class. */ - for (index = 0; index < n_basic_blocks; index++) + if (!optimize) { - basic_block bb = BASIC_BLOCK (index); - - /* Show that an insn inside a loop is likely to be executed three - times more than insns outside a loop. This is much more aggressive - than the assumptions made elsewhere and is being tried as an - experiment. */ - if (optimize_size) - loop_cost = 1; - else - loop_cost = 1 << (2 * MIN (bb->loop_depth - 1, 5)); - for (insn = bb->head; ; insn = NEXT_INSN (insn)) - { - insn = scan_one_insn (insn, pass); - if (insn == bb->end) - break; - } + loop_cost = 1; + for (insn = f; insn; insn = NEXT_INSN (insn)) + insn = scan_one_insn (insn, pass); } + else + for (index = 0; index < n_basic_blocks; index++) + { + basic_block bb = BASIC_BLOCK (index); + + /* Show that an insn inside a loop is likely to be executed three + times more than insns outside a loop. This is much more aggressive + than the assumptions made elsewhere and is being tried as an + experiment. */ + if (optimize_size) + loop_cost = 1; + else + loop_cost = 1 << (2 * MIN (bb->loop_depth - 1, 5)); + for (insn = bb->head; ; insn = NEXT_INSN (insn)) + { + insn = scan_one_insn (insn, pass); + if (insn == bb->end) + break; + } + } /* Now for each register look at how desirable each class is and find which class is preferred. Store that in -- GitLab