OSDN Git Service
(root)
/
pf3gnuchains
/
gcc-fork.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
* function.h (struct function): Remove calls_longjmp.
[pf3gnuchains/gcc-fork.git]
/
gcc
/
loop-init.c
diff --git
a/gcc/loop-init.c
b/gcc/loop-init.c
index
6cae157
..
5aa0db1
100644
(file)
--- a/
gcc/loop-init.c
+++ b/
gcc/loop-init.c
@@
-1,5
+1,5
@@
/* Loop optimizer initialization routines.
/* Loop optimizer initialization routines.
- Copyright (C) 2002, 2003 Free Software Foundation, Inc.
+ Copyright (C) 2002, 2003
, 2004
Free Software Foundation, Inc.
This file is part of GCC.
This file is part of GCC.
@@
-24,6
+24,7
@@
Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#include "tm.h"
#include "rtl.h"
#include "hard-reg-set.h"
#include "tm.h"
#include "rtl.h"
#include "hard-reg-set.h"
+#include "obstack.h"
#include "basic-block.h"
#include "cfgloop.h"
#include "cfglayout.h"
#include "basic-block.h"
#include "cfgloop.h"
#include "cfglayout.h"
@@
-31,17
+32,27
@@
Software Foundation, 59 Temple Place - Suite 330, Boston, MA
/* Initialize loop optimizer. */
struct loops *
/* Initialize loop optimizer. */
struct loops *
-loop_optimizer_init (dumpfile)
- FILE *dumpfile;
+loop_optimizer_init (FILE *dumpfile)
{
struct loops *loops = xcalloc (1, sizeof (struct loops));
edge e;
{
struct loops *loops = xcalloc (1, sizeof (struct loops));
edge e;
+ edge_iterator ei;
+ static bool first_time = true;
+
+ if (first_time)
+ {
+ first_time = false;
+ init_set_costs ();
+ }
/* Avoid annoying special cases of edges going to exit
block. */
/* Avoid annoying special cases of edges going to exit
block. */
- for (e = EXIT_BLOCK_PTR->pred; e; e = e->pred_next)
- if ((e->flags & EDGE_FALLTHRU) && e->src->succ->succ_next)
+
+ for (ei = ei_start (EXIT_BLOCK_PTR->preds); (e = ei_safe_edge (ei)); )
+ if ((e->flags & EDGE_FALLTHRU) && EDGE_COUNT (e->src->succs) > 1)
split_edge (e);
split_edge (e);
+ else
+ ei_next (&ei);
/* Find the loops. */
/* Find the loops. */
@@
-50,6
+61,7
@@
loop_optimizer_init (dumpfile)
/* No loops. */
flow_loops_free (loops);
free (loops);
/* No loops. */
flow_loops_free (loops);
free (loops);
+
return NULL;
}
return NULL;
}
@@
-59,11
+71,8
@@
loop_optimizer_init (dumpfile)
free (loops->cfg.dfs_order);
loops->cfg.dfs_order = NULL;
free (loops->cfg.dfs_order);
loops->cfg.dfs_order = NULL;
- /* Initialize structures for layout changes. */
- cfg_layout_initialize (loops);
-
/* Create pre-headers. */
/* Create pre-headers. */
- create_preheaders (loops, CP_SIMPLE_PREHEADERS
| CP_INSIDE_CFGLAYOUT
);
+ create_preheaders (loops, CP_SIMPLE_PREHEADERS);
/* Force all latches to have only single successor. */
force_single_succ_latches (loops);
/* Force all latches to have only single successor. */
force_single_succ_latches (loops);
@@
-75,7
+84,7
@@
loop_optimizer_init (dumpfile)
flow_loops_dump (loops, dumpfile, NULL, 1);
#ifdef ENABLE_CHECKING
flow_loops_dump (loops, dumpfile, NULL, 1);
#ifdef ENABLE_CHECKING
- verify_dominators (
loops->cfg.dom
);
+ verify_dominators (
CDI_DOMINATORS
);
verify_loop_structure (loops);
#endif
verify_loop_structure (loops);
#endif
@@
-84,17
+93,16
@@
loop_optimizer_init (dumpfile)
/* Finalize loop optimizer. */
void
/* Finalize loop optimizer. */
void
-loop_optimizer_finalize (loops, dumpfile)
- struct loops *loops;
- FILE *dumpfile;
+loop_optimizer_finalize (struct loops *loops, FILE *dumpfile)
{
{
-
basic_block bb
;
+
unsigned i
;
- /* Finalize layout changes. */
- /* Make chain. */
- FOR_EACH_BB (bb)
- if (bb->next_bb != EXIT_BLOCK_PTR)
- RBI (bb)->next = bb->next_bb;
+ if (!loops)
+ return;
+
+ for (i = 1; i < loops->num; i++)
+ if (loops->parray[i])
+ free_simple_loop_desc (loops->parray[i]);
/* Another dump. */
flow_loops_dump (loops, dumpfile, NULL, 1);
/* Another dump. */
flow_loops_dump (loops, dumpfile, NULL, 1);
@@
-102,13
+110,9
@@
loop_optimizer_finalize (loops, dumpfile)
/* Clean up. */
flow_loops_free (loops);
free (loops);
/* Clean up. */
flow_loops_free (loops);
free (loops);
-
- /* Finalize changes. */
- cfg_layout_finalize ();
/* Checking. */
#ifdef ENABLE_CHECKING
verify_flow_info ();
#endif
}
/* Checking. */
#ifdef ENABLE_CHECKING
verify_flow_info ();
#endif
}
-