Commit 7b0cab99 by Jan Hubicka Committed by Jan Hubicka

cfglayout.c (copy_bbs): Rename n_edges to num_edges.

	* cfglayout.c (copy_bbs): Rename n_edges to num_edges.
	* cfgloop.c (get_loop_exit_edges): Likewise.
	* cfgloopmanip.c (fix_irreducible_loops): Likewise.
	(unloop): Likewise.
	* loop-unroll.c (analyze_insns_in_loop): Likewise.
	* tree-cfg.c (dump_cfg_status): Likewise.

Co-Authored-By: Steven Bosscher <stevenb@suse.de>

From-SVN: r97903
parent 5b296c8a
2005-04-09 Jan Hubicka <jh@suse.cz>
Steven Bosscher <stevenb@suse.de>
* cfglayout.c (copy_bbs): Rename n_edges to num_edges.
* cfgloop.c (get_loop_exit_edges): Likewise.
* cfgloopmanip.c (fix_irreducible_loops): Likewise.
(unloop): Likewise.
* loop-unroll.c (analyze_insns_in_loop): Likewise.
* tree-cfg.c (dump_cfg_status): Likewise.
2005-04-09 David Edelsohn <edelsohn@gnu.org> 2005-04-09 David Edelsohn <edelsohn@gnu.org>
* config/rs6000/predicates.md (altivec_register_operand): Remove * config/rs6000/predicates.md (altivec_register_operand): Remove
......
...@@ -1228,7 +1228,7 @@ end: ...@@ -1228,7 +1228,7 @@ end:
void void
copy_bbs (basic_block *bbs, unsigned n, basic_block *new_bbs, copy_bbs (basic_block *bbs, unsigned n, basic_block *new_bbs,
edge *edges, unsigned n_edges, edge *new_edges, edge *edges, unsigned num_edges, edge *new_edges,
struct loop *base) struct loop *base)
{ {
unsigned i, j; unsigned i, j;
...@@ -1267,7 +1267,7 @@ copy_bbs (basic_block *bbs, unsigned n, basic_block *new_bbs, ...@@ -1267,7 +1267,7 @@ copy_bbs (basic_block *bbs, unsigned n, basic_block *new_bbs,
} }
/* Redirect edges. */ /* Redirect edges. */
for (j = 0; j < n_edges; j++) for (j = 0; j < num_edges; j++)
new_edges[j] = NULL; new_edges[j] = NULL;
for (i = 0; i < n; i++) for (i = 0; i < n; i++)
{ {
...@@ -1277,7 +1277,7 @@ copy_bbs (basic_block *bbs, unsigned n, basic_block *new_bbs, ...@@ -1277,7 +1277,7 @@ copy_bbs (basic_block *bbs, unsigned n, basic_block *new_bbs,
FOR_EACH_EDGE (e, ei, new_bb->succs) FOR_EACH_EDGE (e, ei, new_bb->succs)
{ {
for (j = 0; j < n_edges; j++) for (j = 0; j < num_edges; j++)
if (edges[j] && edges[j]->src == bb && edges[j]->dest == e->dest) if (edges[j] && edges[j]->src == bb && edges[j]->dest == e->dest)
new_edges[j] = e; new_edges[j] = e;
......
...@@ -926,7 +926,7 @@ get_loop_body_in_bfs_order (const struct loop *loop) ...@@ -926,7 +926,7 @@ get_loop_body_in_bfs_order (const struct loop *loop)
/* Gets exit edges of a LOOP, returning their number in N_EDGES. */ /* Gets exit edges of a LOOP, returning their number in N_EDGES. */
edge * edge *
get_loop_exit_edges (const struct loop *loop, unsigned int *n_edges) get_loop_exit_edges (const struct loop *loop, unsigned int *num_edges)
{ {
edge *edges, e; edge *edges, e;
unsigned i, n; unsigned i, n;
...@@ -942,7 +942,7 @@ get_loop_exit_edges (const struct loop *loop, unsigned int *n_edges) ...@@ -942,7 +942,7 @@ get_loop_exit_edges (const struct loop *loop, unsigned int *n_edges)
if (!flow_bb_inside_loop_p (loop, e->dest)) if (!flow_bb_inside_loop_p (loop, e->dest))
n++; n++;
edges = xmalloc (n * sizeof (edge)); edges = xmalloc (n * sizeof (edge));
*n_edges = n; *num_edges = n;
n = 0; n = 0;
for (i = 0; i < loop->num_nodes; i++) for (i = 0; i < loop->num_nodes; i++)
FOR_EACH_EDGE (e, ei, body[i]->succs) FOR_EACH_EDGE (e, ei, body[i]->succs)
......
...@@ -252,7 +252,7 @@ fix_irreducible_loops (basic_block from) ...@@ -252,7 +252,7 @@ fix_irreducible_loops (basic_block from)
int stack_top; int stack_top;
sbitmap on_stack; sbitmap on_stack;
edge *edges, e; edge *edges, e;
unsigned n_edges, i; unsigned num_edges, i;
if (!(from->flags & BB_IRREDUCIBLE_LOOP)) if (!(from->flags & BB_IRREDUCIBLE_LOOP))
return; return;
...@@ -278,16 +278,16 @@ fix_irreducible_loops (basic_block from) ...@@ -278,16 +278,16 @@ fix_irreducible_loops (basic_block from)
bb->flags &= ~BB_IRREDUCIBLE_LOOP; bb->flags &= ~BB_IRREDUCIBLE_LOOP;
if (bb->loop_father->header == bb) if (bb->loop_father->header == bb)
edges = get_loop_exit_edges (bb->loop_father, &n_edges); edges = get_loop_exit_edges (bb->loop_father, &num_edges);
else else
{ {
n_edges = EDGE_COUNT (bb->succs); num_edges = EDGE_COUNT (bb->succs);
edges = xmalloc (n_edges * sizeof (edge)); edges = xmalloc (num_edges * sizeof (edge));
FOR_EACH_EDGE (e, ei, bb->succs) FOR_EACH_EDGE (e, ei, bb->succs)
edges[ei.index] = e; edges[ei.index] = e;
} }
for (i = 0; i < n_edges; i++) for (i = 0; i < num_edges; i++)
{ {
e = edges[i]; e = edges[i];
...@@ -574,7 +574,7 @@ unloop (struct loops *loops, struct loop *loop) ...@@ -574,7 +574,7 @@ unloop (struct loops *loops, struct loop *loop)
unsigned i, n; unsigned i, n;
basic_block latch = loop->latch; basic_block latch = loop->latch;
edge *edges; edge *edges;
unsigned n_edges; unsigned num_edges;
/* This is relatively straightforward. The dominators are unchanged, as /* This is relatively straightforward. The dominators are unchanged, as
loop header dominates loop latch, so the only thing we have to care of loop header dominates loop latch, so the only thing we have to care of
...@@ -583,7 +583,7 @@ unloop (struct loops *loops, struct loop *loop) ...@@ -583,7 +583,7 @@ unloop (struct loops *loops, struct loop *loop)
its work. */ its work. */
body = get_loop_body (loop); body = get_loop_body (loop);
edges = get_loop_exit_edges (loop, &n_edges); edges = get_loop_exit_edges (loop, &num_edges);
n = loop->num_nodes; n = loop->num_nodes;
for (i = 0; i < n; i++) for (i = 0; i < n; i++)
if (body[i]->loop_father == loop) if (body[i]->loop_father == loop)
...@@ -612,10 +612,10 @@ unloop (struct loops *loops, struct loop *loop) ...@@ -612,10 +612,10 @@ unloop (struct loops *loops, struct loop *loop)
update the irreducible marks inside its body. While it is certainly update the irreducible marks inside its body. While it is certainly
possible to do, it is a bit complicated and this situation should be possible to do, it is a bit complicated and this situation should be
very rare, so we just remark all loops in this case. */ very rare, so we just remark all loops in this case. */
for (i = 0; i < n_edges; i++) for (i = 0; i < num_edges; i++)
if (edges[i]->flags & EDGE_IRREDUCIBLE_LOOP) if (edges[i]->flags & EDGE_IRREDUCIBLE_LOOP)
break; break;
if (i != n_edges) if (i != num_edges)
mark_irreducible_loops (loops); mark_irreducible_loops (loops);
free (edges); free (edges);
} }
......
...@@ -1640,14 +1640,14 @@ static struct opt_info * ...@@ -1640,14 +1640,14 @@ static struct opt_info *
analyze_insns_in_loop (struct loop *loop) analyze_insns_in_loop (struct loop *loop)
{ {
basic_block *body, bb; basic_block *body, bb;
unsigned i, n_edges = 0; unsigned i, num_edges = 0;
struct opt_info *opt_info = xcalloc (1, sizeof (struct opt_info)); struct opt_info *opt_info = xcalloc (1, sizeof (struct opt_info));
rtx insn; rtx insn;
struct iv_to_split *ivts = NULL; struct iv_to_split *ivts = NULL;
struct var_to_expand *ves = NULL; struct var_to_expand *ves = NULL;
PTR *slot1; PTR *slot1;
PTR *slot2; PTR *slot2;
edge *edges = get_loop_exit_edges (loop, &n_edges); edge *edges = get_loop_exit_edges (loop, &num_edges);
bool can_apply = false; bool can_apply = false;
iv_analysis_loop_init (loop); iv_analysis_loop_init (loop);
...@@ -1667,7 +1667,7 @@ analyze_insns_in_loop (struct loop *loop) ...@@ -1667,7 +1667,7 @@ analyze_insns_in_loop (struct loop *loop)
else else
opt_info->loop_preheader = loop_preheader_edge (loop)->src; opt_info->loop_preheader = loop_preheader_edge (loop)->src;
if (n_edges == 1 if (num_edges == 1
&& !(edges[0]->flags & EDGE_COMPLEX)) && !(edges[0]->flags & EDGE_COMPLEX))
{ {
opt_info->loop_exit = loop_split_edge_with (edges[0], NULL_RTX); opt_info->loop_exit = loop_split_edge_with (edges[0], NULL_RTX);
......
...@@ -2551,7 +2551,7 @@ dump_cfg_stats (FILE *file) ...@@ -2551,7 +2551,7 @@ dump_cfg_stats (FILE *file)
{ {
static long max_num_merged_labels = 0; static long max_num_merged_labels = 0;
unsigned long size, total = 0; unsigned long size, total = 0;
int n_edges; long num_edges;
basic_block bb; basic_block bb;
const char * const fmt_str = "%-30s%-13s%12s\n"; const char * const fmt_str = "%-30s%-13s%12s\n";
const char * const fmt_str_1 = "%-30s%13d%11lu%c\n"; const char * const fmt_str_1 = "%-30s%13d%11lu%c\n";
...@@ -2572,12 +2572,12 @@ dump_cfg_stats (FILE *file) ...@@ -2572,12 +2572,12 @@ dump_cfg_stats (FILE *file)
fprintf (file, fmt_str_1, "Basic blocks", n_basic_blocks, fprintf (file, fmt_str_1, "Basic blocks", n_basic_blocks,
SCALE (size), LABEL (size)); SCALE (size), LABEL (size));
n_edges = 0; num_edges = 0;
FOR_EACH_BB (bb) FOR_EACH_BB (bb)
n_edges += EDGE_COUNT (bb->succs); num_edges += EDGE_COUNT (bb->succs);
size = n_edges * sizeof (struct edge_def); size = num_edges * sizeof (struct edge_def);
total += size; total += size;
fprintf (file, fmt_str_1, "Edges", n_edges, SCALE (size), LABEL (size)); fprintf (file, fmt_str_1, "Edges", num_edges, SCALE (size), LABEL (size));
size = n_basic_blocks * sizeof (struct bb_ann_d); size = n_basic_blocks * sizeof (struct bb_ann_d);
total += size; total += size;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment