Commit ee8c1b05 by Zdenek Dvorak Committed by Zdenek Dvorak

loop-unswitch.c (unswitch_loop): Update arguments of duplicate_loop_to_header_edge call.

	* loop-unswitch.c (unswitch_loop): Update arguments of
	duplicate_loop_to_header_edge call.
	* tree-ssa-loop-ivcanon.c (try_unroll_loop_completely): Ditto.
	* loop-unroll.c (peel_loop_completely, unroll_loop_constant_iterations,
	unroll_loop_runtime_iterations, peel_loop_simple, unroll_loop_stupid):
	Ditto.
	* cfgloopmanip.c (loop_version): Ditto.
	(duplicate_loop_to_header_edge): Change
	type of to_remove to VEC(edge), remove n_to_remove argument.
	* tree-ssa-loop-manip.c (tree_duplicate_loop_to_header_edge):
	Change type of to_remove to VEC(edge), remove n_to_remove argument.
	(tree_unroll_loop): Update arguments of
	tree_duplicate_loop_to_header_edge call.
	* cfghooks.c (cfg_hook_duplicate_loop_to_header_edge):
	Change type of to_remove to VEC(edge), remove n_to_remove argument.
	* cfghooks.h (struct cfg_hooks): Type of
	cfg_hook_duplicate_loop_to_header_edge changed.
	(cfg_hook_duplicate_loop_to_header_edge): Declaration changed.
	* cfgloop.h (duplicate_loop_to_header_edge): Ditto.
	* tree-flow.h (tree_duplicate_loop_to_header_edge): Ditto.

From-SVN: r120074
parent c882a2c2
2006-12-20 Zdenek Dvorak <dvorakz@suse.cz>
* loop-unswitch.c (unswitch_loop): Update arguments of
duplicate_loop_to_header_edge call.
* tree-ssa-loop-ivcanon.c (try_unroll_loop_completely): Ditto.
* loop-unroll.c (peel_loop_completely, unroll_loop_constant_iterations,
unroll_loop_runtime_iterations, peel_loop_simple, unroll_loop_stupid):
Ditto.
* cfgloopmanip.c (loop_version): Ditto.
(duplicate_loop_to_header_edge): Change
type of to_remove to VEC(edge), remove n_to_remove argument.
* tree-ssa-loop-manip.c (tree_duplicate_loop_to_header_edge):
Change type of to_remove to VEC(edge), remove n_to_remove argument.
(tree_unroll_loop): Update arguments of
tree_duplicate_loop_to_header_edge call.
* cfghooks.c (cfg_hook_duplicate_loop_to_header_edge):
Change type of to_remove to VEC(edge), remove n_to_remove argument.
* cfghooks.h (struct cfg_hooks): Type of
cfg_hook_duplicate_loop_to_header_edge changed.
(cfg_hook_duplicate_loop_to_header_edge): Declaration changed.
* cfgloop.h (duplicate_loop_to_header_edge): Ditto.
* tree-flow.h (tree_duplicate_loop_to_header_edge): Ditto.
2006-12-20 Dorit Nuzman <dorit@il.ibm.com> 2006-12-20 Dorit Nuzman <dorit@il.ibm.com>
* config/spu/spu.md (vec_widen_umult_hi_v8hi): New. * config/spu/spu.md (vec_widen_umult_hi_v8hi): New.
......
...@@ -939,14 +939,14 @@ bool ...@@ -939,14 +939,14 @@ bool
cfg_hook_duplicate_loop_to_header_edge (struct loop *loop, edge e, cfg_hook_duplicate_loop_to_header_edge (struct loop *loop, edge e,
unsigned int ndupl, unsigned int ndupl,
sbitmap wont_exit, edge orig, sbitmap wont_exit, edge orig,
edge *to_remove, VEC (edge, heap) **to_remove,
unsigned int *n_to_remove, int flags) int flags)
{ {
gcc_assert (cfg_hooks->cfg_hook_duplicate_loop_to_header_edge); gcc_assert (cfg_hooks->cfg_hook_duplicate_loop_to_header_edge);
return cfg_hooks->cfg_hook_duplicate_loop_to_header_edge (loop, e, return cfg_hooks->cfg_hook_duplicate_loop_to_header_edge (loop, e,
ndupl, wont_exit, ndupl, wont_exit,
orig, to_remove, orig, to_remove,
n_to_remove, flags); flags);
} }
/* Conditional jumps are represented differently in trees and RTL, /* Conditional jumps are represented differently in trees and RTL,
......
...@@ -111,12 +111,10 @@ struct cfg_hooks ...@@ -111,12 +111,10 @@ struct cfg_hooks
/* A hook for duplicating loop in CFG, currently this is used /* A hook for duplicating loop in CFG, currently this is used
in loop versioning. */ in loop versioning. */
bool (*cfg_hook_duplicate_loop_to_header_edge) (struct loop *loop, edge e, bool (*cfg_hook_duplicate_loop_to_header_edge) (struct loop *, edge,
unsigned int ndupl, unsigned, sbitmap,
sbitmap wont_exit, edge, VEC (edge, heap) **,
edge orig, edge *to_remove, int);
unsigned int *n_to_remove,
int flags);
/* Add condition to new basic block and update CFG used in loop /* Add condition to new basic block and update CFG used in loop
versioning. */ versioning. */
...@@ -165,8 +163,8 @@ extern void execute_on_shrinking_pred (edge); ...@@ -165,8 +163,8 @@ extern void execute_on_shrinking_pred (edge);
extern bool cfg_hook_duplicate_loop_to_header_edge (struct loop *loop, edge, extern bool cfg_hook_duplicate_loop_to_header_edge (struct loop *loop, edge,
unsigned int ndupl, unsigned int ndupl,
sbitmap wont_exit, sbitmap wont_exit,
edge orig, edge *to_remove, edge orig,
unsigned int *n_to_remove, VEC (edge, heap) **to_remove,
int flags); int flags);
extern void lv_flush_pending_stmts (edge); extern void lv_flush_pending_stmts (edge);
......
...@@ -251,8 +251,8 @@ extern bool can_duplicate_loop_p (struct loop *loop); ...@@ -251,8 +251,8 @@ extern bool can_duplicate_loop_p (struct loop *loop);
extern struct loop * duplicate_loop (struct loop *, struct loop *); extern struct loop * duplicate_loop (struct loop *, struct loop *);
extern bool duplicate_loop_to_header_edge (struct loop *, edge, extern bool duplicate_loop_to_header_edge (struct loop *, edge,
unsigned, sbitmap, edge, edge *, unsigned, sbitmap, edge,
unsigned *, int); VEC (edge, heap) **, int);
extern struct loop *loopify (edge, edge, extern struct loop *loopify (edge, edge,
basic_block, edge, edge, bool); basic_block, edge, edge, bool);
struct loop * loop_version (struct loop *, void *, struct loop * loop_version (struct loop *, void *,
......
...@@ -814,11 +814,12 @@ update_single_exit_for_duplicated_loops (struct loop *orig_loops[], unsigned n) ...@@ -814,11 +814,12 @@ update_single_exit_for_duplicated_loops (struct loop *orig_loops[], unsigned n)
original LOOP body, the other copies are numbered in order given by control original LOOP body, the other copies are numbered in order given by control
flow through them) into TO_REMOVE array. Returns false if duplication is flow through them) into TO_REMOVE array. Returns false if duplication is
impossible. */ impossible. */
bool bool
duplicate_loop_to_header_edge (struct loop *loop, edge e, duplicate_loop_to_header_edge (struct loop *loop, edge e,
unsigned int ndupl, sbitmap wont_exit, unsigned int ndupl, sbitmap wont_exit,
edge orig, edge *to_remove, edge orig, VEC (edge, heap) **to_remove,
unsigned int *n_to_remove, int flags) int flags)
{ {
struct loop *target, *aloop; struct loop *target, *aloop;
struct loop **orig_loops; struct loop **orig_loops;
...@@ -966,10 +967,6 @@ duplicate_loop_to_header_edge (struct loop *loop, edge e, ...@@ -966,10 +967,6 @@ duplicate_loop_to_header_edge (struct loop *loop, edge e,
if (current_loops->state & LOOPS_HAVE_MARKED_SINGLE_EXITS) if (current_loops->state & LOOPS_HAVE_MARKED_SINGLE_EXITS)
update_single_exits_after_duplication (bbs, n, target); update_single_exits_after_duplication (bbs, n, target);
/* Record exit edge in original loop body. */
if (orig && TEST_BIT (wont_exit, 0))
to_remove[(*n_to_remove)++] = orig;
spec_edges[SE_ORIG] = orig; spec_edges[SE_ORIG] = orig;
spec_edges[SE_LATCH] = latch_edge; spec_edges[SE_LATCH] = latch_edge;
...@@ -1043,7 +1040,10 @@ duplicate_loop_to_header_edge (struct loop *loop, edge e, ...@@ -1043,7 +1040,10 @@ duplicate_loop_to_header_edge (struct loop *loop, edge e,
/* Record exit edge in this copy. */ /* Record exit edge in this copy. */
if (orig && TEST_BIT (wont_exit, j + 1)) if (orig && TEST_BIT (wont_exit, j + 1))
to_remove[(*n_to_remove)++] = new_spec_edges[SE_ORIG]; {
if (to_remove)
VEC_safe_push (edge, heap, *to_remove, new_spec_edges[SE_ORIG]);
}
/* Record the first copy in the control flow order if it is not /* Record the first copy in the control flow order if it is not
the original loop (i.e. in case of peeling). */ the original loop (i.e. in case of peeling). */
...@@ -1063,6 +1063,13 @@ duplicate_loop_to_header_edge (struct loop *loop, edge e, ...@@ -1063,6 +1063,13 @@ duplicate_loop_to_header_edge (struct loop *loop, edge e,
free (new_bbs); free (new_bbs);
free (orig_loops); free (orig_loops);
/* Record the exit edge in the original loop body, and update the frequencies. */
if (orig && TEST_BIT (wont_exit, 0))
{
if (to_remove)
VEC_safe_push (edge, heap, *to_remove, orig);
}
/* Update the original loop. */ /* Update the original loop. */
if (!is_latch) if (!is_latch)
set_immediate_dominator (CDI_DOMINATORS, e->dest, e->src); set_immediate_dominator (CDI_DOMINATORS, e->dest, e->src);
...@@ -1302,7 +1309,7 @@ loop_version (struct loop *loop, ...@@ -1302,7 +1309,7 @@ loop_version (struct loop *loop,
/* Duplicate loop. */ /* Duplicate loop. */
if (!cfg_hook_duplicate_loop_to_header_edge (loop, entry, 1, if (!cfg_hook_duplicate_loop_to_header_edge (loop, entry, 1,
NULL, NULL, NULL, NULL, 0)) NULL, NULL, NULL, 0))
return NULL; return NULL;
/* After duplication entry edge now points to new loop head block. /* After duplication entry edge now points to new loop head block.
......
...@@ -446,8 +446,9 @@ peel_loop_completely (struct loop *loop) ...@@ -446,8 +446,9 @@ peel_loop_completely (struct loop *loop)
{ {
sbitmap wont_exit; sbitmap wont_exit;
unsigned HOST_WIDE_INT npeel; unsigned HOST_WIDE_INT npeel;
unsigned n_remove_edges, i; unsigned i;
edge *remove_edges, ein; VEC (edge, heap) *remove_edges;
edge ein;
struct niter_desc *desc = get_simple_loop_desc (loop); struct niter_desc *desc = get_simple_loop_desc (loop);
struct opt_info *opt_info = NULL; struct opt_info *opt_info = NULL;
...@@ -463,8 +464,7 @@ peel_loop_completely (struct loop *loop) ...@@ -463,8 +464,7 @@ peel_loop_completely (struct loop *loop)
if (desc->noloop_assumptions) if (desc->noloop_assumptions)
RESET_BIT (wont_exit, 1); RESET_BIT (wont_exit, 1);
remove_edges = XCNEWVEC (edge, npeel); remove_edges = NULL;
n_remove_edges = 0;
if (flag_split_ivs_in_unroller) if (flag_split_ivs_in_unroller)
opt_info = analyze_insns_in_loop (loop); opt_info = analyze_insns_in_loop (loop);
...@@ -473,7 +473,7 @@ peel_loop_completely (struct loop *loop) ...@@ -473,7 +473,7 @@ peel_loop_completely (struct loop *loop)
ok = duplicate_loop_to_header_edge (loop, loop_preheader_edge (loop), ok = duplicate_loop_to_header_edge (loop, loop_preheader_edge (loop),
npeel, npeel,
wont_exit, desc->out_edge, wont_exit, desc->out_edge,
remove_edges, &n_remove_edges, &remove_edges,
DLTHE_FLAG_UPDATE_FREQ DLTHE_FLAG_UPDATE_FREQ
| DLTHE_FLAG_COMPLETTE_PEEL | DLTHE_FLAG_COMPLETTE_PEEL
| (opt_info | (opt_info
...@@ -489,9 +489,9 @@ peel_loop_completely (struct loop *loop) ...@@ -489,9 +489,9 @@ peel_loop_completely (struct loop *loop)
} }
/* Remove the exit edges. */ /* Remove the exit edges. */
for (i = 0; i < n_remove_edges; i++) for (i = 0; VEC_iterate (edge, remove_edges, i, ein); i++)
remove_path (remove_edges[i]); remove_path (ein);
free (remove_edges); VEC_free (edge, heap, remove_edges);
} }
ein = desc->in_edge; ein = desc->in_edge;
...@@ -630,8 +630,9 @@ unroll_loop_constant_iterations (struct loop *loop) ...@@ -630,8 +630,9 @@ unroll_loop_constant_iterations (struct loop *loop)
unsigned HOST_WIDE_INT niter; unsigned HOST_WIDE_INT niter;
unsigned exit_mod; unsigned exit_mod;
sbitmap wont_exit; sbitmap wont_exit;
unsigned n_remove_edges, i; unsigned i;
edge *remove_edges; VEC (edge, heap) *remove_edges;
edge e;
unsigned max_unroll = loop->lpt_decision.times; unsigned max_unroll = loop->lpt_decision.times;
struct niter_desc *desc = get_simple_loop_desc (loop); struct niter_desc *desc = get_simple_loop_desc (loop);
bool exit_at_end = loop_exit_at_end_p (loop); bool exit_at_end = loop_exit_at_end_p (loop);
...@@ -648,8 +649,7 @@ unroll_loop_constant_iterations (struct loop *loop) ...@@ -648,8 +649,7 @@ unroll_loop_constant_iterations (struct loop *loop)
wont_exit = sbitmap_alloc (max_unroll + 1); wont_exit = sbitmap_alloc (max_unroll + 1);
sbitmap_ones (wont_exit); sbitmap_ones (wont_exit);
remove_edges = XCNEWVEC (edge, max_unroll + exit_mod + 1); remove_edges = NULL;
n_remove_edges = 0;
if (flag_split_ivs_in_unroller if (flag_split_ivs_in_unroller
|| flag_variable_expansion_in_unroller) || flag_variable_expansion_in_unroller)
opt_info = analyze_insns_in_loop (loop); opt_info = analyze_insns_in_loop (loop);
...@@ -674,7 +674,7 @@ unroll_loop_constant_iterations (struct loop *loop) ...@@ -674,7 +674,7 @@ unroll_loop_constant_iterations (struct loop *loop)
ok = duplicate_loop_to_header_edge (loop, loop_preheader_edge (loop), ok = duplicate_loop_to_header_edge (loop, loop_preheader_edge (loop),
exit_mod, exit_mod,
wont_exit, desc->out_edge, wont_exit, desc->out_edge,
remove_edges, &n_remove_edges, &remove_edges,
DLTHE_FLAG_UPDATE_FREQ DLTHE_FLAG_UPDATE_FREQ
| (opt_info && exit_mod > 1 | (opt_info && exit_mod > 1
? DLTHE_RECORD_COPY_NUMBER ? DLTHE_RECORD_COPY_NUMBER
...@@ -713,7 +713,7 @@ unroll_loop_constant_iterations (struct loop *loop) ...@@ -713,7 +713,7 @@ unroll_loop_constant_iterations (struct loop *loop)
ok = duplicate_loop_to_header_edge (loop, loop_preheader_edge (loop), ok = duplicate_loop_to_header_edge (loop, loop_preheader_edge (loop),
exit_mod + 1, exit_mod + 1,
wont_exit, desc->out_edge, wont_exit, desc->out_edge,
remove_edges, &n_remove_edges, &remove_edges,
DLTHE_FLAG_UPDATE_FREQ DLTHE_FLAG_UPDATE_FREQ
| (opt_info && exit_mod > 0 | (opt_info && exit_mod > 0
? DLTHE_RECORD_COPY_NUMBER ? DLTHE_RECORD_COPY_NUMBER
...@@ -740,7 +740,7 @@ unroll_loop_constant_iterations (struct loop *loop) ...@@ -740,7 +740,7 @@ unroll_loop_constant_iterations (struct loop *loop)
ok = duplicate_loop_to_header_edge (loop, loop_latch_edge (loop), ok = duplicate_loop_to_header_edge (loop, loop_latch_edge (loop),
max_unroll, max_unroll,
wont_exit, desc->out_edge, wont_exit, desc->out_edge,
remove_edges, &n_remove_edges, &remove_edges,
DLTHE_FLAG_UPDATE_FREQ DLTHE_FLAG_UPDATE_FREQ
| (opt_info | (opt_info
? DLTHE_RECORD_COPY_NUMBER ? DLTHE_RECORD_COPY_NUMBER
...@@ -777,9 +777,9 @@ unroll_loop_constant_iterations (struct loop *loop) ...@@ -777,9 +777,9 @@ unroll_loop_constant_iterations (struct loop *loop)
desc->niter_expr = GEN_INT (desc->niter); desc->niter_expr = GEN_INT (desc->niter);
/* Remove the edges. */ /* Remove the edges. */
for (i = 0; i < n_remove_edges; i++) for (i = 0; VEC_iterate (edge, remove_edges, i, e); i++)
remove_path (remove_edges[i]); remove_path (e);
free (remove_edges); VEC_free (edge, heap, remove_edges);
if (dump_file) if (dump_file)
fprintf (dump_file, fprintf (dump_file,
...@@ -923,8 +923,9 @@ unroll_loop_runtime_iterations (struct loop *loop) ...@@ -923,8 +923,9 @@ unroll_loop_runtime_iterations (struct loop *loop)
unsigned n_dom_bbs; unsigned n_dom_bbs;
sbitmap wont_exit; sbitmap wont_exit;
int may_exit_copy; int may_exit_copy;
unsigned n_peel, n_remove_edges; unsigned n_peel;
edge *remove_edges, e; VEC (edge, heap) *remove_edges;
edge e;
bool extra_zero_check, last_may_exit; bool extra_zero_check, last_may_exit;
unsigned max_unroll = loop->lpt_decision.times; unsigned max_unroll = loop->lpt_decision.times;
struct niter_desc *desc = get_simple_loop_desc (loop); struct niter_desc *desc = get_simple_loop_desc (loop);
...@@ -995,8 +996,7 @@ unroll_loop_runtime_iterations (struct loop *loop) ...@@ -995,8 +996,7 @@ unroll_loop_runtime_iterations (struct loop *loop)
/* Precondition the loop. */ /* Precondition the loop. */
split_edge_and_insert (loop_preheader_edge (loop), init_code); split_edge_and_insert (loop_preheader_edge (loop), init_code);
remove_edges = XCNEWVEC (edge, max_unroll + n_peel + 1); remove_edges = NULL;
n_remove_edges = 0;
wont_exit = sbitmap_alloc (max_unroll + 2); wont_exit = sbitmap_alloc (max_unroll + 2);
...@@ -1011,7 +1011,7 @@ unroll_loop_runtime_iterations (struct loop *loop) ...@@ -1011,7 +1011,7 @@ unroll_loop_runtime_iterations (struct loop *loop)
ezc_swtch = loop_preheader_edge (loop)->src; ezc_swtch = loop_preheader_edge (loop)->src;
ok = duplicate_loop_to_header_edge (loop, loop_preheader_edge (loop), ok = duplicate_loop_to_header_edge (loop, loop_preheader_edge (loop),
1, wont_exit, desc->out_edge, 1, wont_exit, desc->out_edge,
remove_edges, &n_remove_edges, &remove_edges,
DLTHE_FLAG_UPDATE_FREQ); DLTHE_FLAG_UPDATE_FREQ);
gcc_assert (ok); gcc_assert (ok);
...@@ -1026,7 +1026,7 @@ unroll_loop_runtime_iterations (struct loop *loop) ...@@ -1026,7 +1026,7 @@ unroll_loop_runtime_iterations (struct loop *loop)
SET_BIT (wont_exit, 1); SET_BIT (wont_exit, 1);
ok = duplicate_loop_to_header_edge (loop, loop_preheader_edge (loop), ok = duplicate_loop_to_header_edge (loop, loop_preheader_edge (loop),
1, wont_exit, desc->out_edge, 1, wont_exit, desc->out_edge,
remove_edges, &n_remove_edges, &remove_edges,
DLTHE_FLAG_UPDATE_FREQ); DLTHE_FLAG_UPDATE_FREQ);
gcc_assert (ok); gcc_assert (ok);
...@@ -1082,7 +1082,7 @@ unroll_loop_runtime_iterations (struct loop *loop) ...@@ -1082,7 +1082,7 @@ unroll_loop_runtime_iterations (struct loop *loop)
ok = duplicate_loop_to_header_edge (loop, loop_latch_edge (loop), ok = duplicate_loop_to_header_edge (loop, loop_latch_edge (loop),
max_unroll, max_unroll,
wont_exit, desc->out_edge, wont_exit, desc->out_edge,
remove_edges, &n_remove_edges, &remove_edges,
DLTHE_FLAG_UPDATE_FREQ DLTHE_FLAG_UPDATE_FREQ
| (opt_info | (opt_info
? DLTHE_RECORD_COPY_NUMBER ? DLTHE_RECORD_COPY_NUMBER
...@@ -1116,9 +1116,9 @@ unroll_loop_runtime_iterations (struct loop *loop) ...@@ -1116,9 +1116,9 @@ unroll_loop_runtime_iterations (struct loop *loop)
} }
/* Remove the edges. */ /* Remove the edges. */
for (i = 0; i < n_remove_edges; i++) for (i = 0; VEC_iterate (edge, remove_edges, i, e); i++)
remove_path (remove_edges[i]); remove_path (e);
free (remove_edges); VEC_free (edge, heap, remove_edges);
/* We must be careful when updating the number of iterations due to /* We must be careful when updating the number of iterations due to
preconditioning and the fact that the value must be valid at entry preconditioning and the fact that the value must be valid at entry
...@@ -1264,8 +1264,7 @@ peel_loop_simple (struct loop *loop) ...@@ -1264,8 +1264,7 @@ peel_loop_simple (struct loop *loop)
opt_info_start_duplication (opt_info); opt_info_start_duplication (opt_info);
ok = duplicate_loop_to_header_edge (loop, loop_preheader_edge (loop), ok = duplicate_loop_to_header_edge (loop, loop_preheader_edge (loop),
npeel, wont_exit, npeel, wont_exit, NULL,
NULL, NULL,
NULL, DLTHE_FLAG_UPDATE_FREQ NULL, DLTHE_FLAG_UPDATE_FREQ
| (opt_info | (opt_info
? DLTHE_RECORD_COPY_NUMBER ? DLTHE_RECORD_COPY_NUMBER
...@@ -1416,7 +1415,7 @@ unroll_loop_stupid (struct loop *loop) ...@@ -1416,7 +1415,7 @@ unroll_loop_stupid (struct loop *loop)
ok = duplicate_loop_to_header_edge (loop, loop_latch_edge (loop), ok = duplicate_loop_to_header_edge (loop, loop_latch_edge (loop),
nunroll, wont_exit, nunroll, wont_exit,
NULL, NULL, NULL, NULL, NULL,
DLTHE_FLAG_UPDATE_FREQ DLTHE_FLAG_UPDATE_FREQ
| (opt_info | (opt_info
? DLTHE_RECORD_COPY_NUMBER ? DLTHE_RECORD_COPY_NUMBER
......
...@@ -410,14 +410,9 @@ unswitch_loop (struct loop *loop, basic_block unswitch_on, rtx cond, rtx cinsn) ...@@ -410,14 +410,9 @@ unswitch_loop (struct loop *loop, basic_block unswitch_on, rtx cond, rtx cinsn)
irred_flag = entry->flags & EDGE_IRREDUCIBLE_LOOP; irred_flag = entry->flags & EDGE_IRREDUCIBLE_LOOP;
entry->flags &= ~EDGE_IRREDUCIBLE_LOOP; entry->flags &= ~EDGE_IRREDUCIBLE_LOOP;
zero_bitmap = sbitmap_alloc (2); zero_bitmap = sbitmap_alloc (2);
sbitmap_zero (zero_bitmap);
if (!duplicate_loop_to_header_edge (loop, entry, 1, if (!duplicate_loop_to_header_edge (loop, entry, 1,
zero_bitmap, NULL, NULL, NULL, 0)) NULL, NULL, NULL, 0))
{ return NULL;
sbitmap_free (zero_bitmap);
return NULL;
}
sbitmap_free (zero_bitmap);
entry->flags |= irred_flag; entry->flags |= irred_flag;
/* Record the block with condition we unswitch on. */ /* Record the block with condition we unswitch on. */
......
...@@ -882,8 +882,8 @@ basic_block ip_end_pos (struct loop *); ...@@ -882,8 +882,8 @@ basic_block ip_end_pos (struct loop *);
basic_block ip_normal_pos (struct loop *); basic_block ip_normal_pos (struct loop *);
bool tree_duplicate_loop_to_header_edge (struct loop *, edge, bool tree_duplicate_loop_to_header_edge (struct loop *, edge,
unsigned int, sbitmap, unsigned int, sbitmap,
edge, edge *, edge, VEC (edge, heap) **,
unsigned int *, int); int);
struct loop *tree_ssa_loop_version (struct loop *, tree, struct loop *tree_ssa_loop_version (struct loop *, tree,
basic_block *); basic_block *);
tree expand_simple_operations (tree); tree expand_simple_operations (tree);
......
...@@ -223,8 +223,6 @@ try_unroll_loop_completely (struct loop *loop, ...@@ -223,8 +223,6 @@ try_unroll_loop_completely (struct loop *loop,
if (n_unroll) if (n_unroll)
{ {
sbitmap wont_exit; sbitmap wont_exit;
edge *edges_to_remove = XNEWVEC (edge, n_unroll);
unsigned int n_to_remove = 0;
old_cond = COND_EXPR_COND (cond); old_cond = COND_EXPR_COND (cond);
COND_EXPR_COND (cond) = dont_exit; COND_EXPR_COND (cond) = dont_exit;
...@@ -237,8 +235,7 @@ try_unroll_loop_completely (struct loop *loop, ...@@ -237,8 +235,7 @@ try_unroll_loop_completely (struct loop *loop,
if (!tree_duplicate_loop_to_header_edge (loop, loop_preheader_edge (loop), if (!tree_duplicate_loop_to_header_edge (loop, loop_preheader_edge (loop),
n_unroll, wont_exit, n_unroll, wont_exit,
exit, edges_to_remove, exit, NULL,
&n_to_remove,
DLTHE_FLAG_UPDATE_FREQ DLTHE_FLAG_UPDATE_FREQ
| DLTHE_FLAG_COMPLETTE_PEEL)) | DLTHE_FLAG_COMPLETTE_PEEL))
{ {
...@@ -246,11 +243,9 @@ try_unroll_loop_completely (struct loop *loop, ...@@ -246,11 +243,9 @@ try_unroll_loop_completely (struct loop *loop,
update_stmt (cond); update_stmt (cond);
free_original_copy_tables (); free_original_copy_tables ();
free (wont_exit); free (wont_exit);
free (edges_to_remove);
return false; return false;
} }
free (wont_exit); free (wont_exit);
free (edges_to_remove);
free_original_copy_tables (); free_original_copy_tables ();
} }
......
...@@ -562,8 +562,8 @@ copy_phi_node_args (unsigned first_new_block) ...@@ -562,8 +562,8 @@ copy_phi_node_args (unsigned first_new_block)
bool bool
tree_duplicate_loop_to_header_edge (struct loop *loop, edge e, tree_duplicate_loop_to_header_edge (struct loop *loop, edge e,
unsigned int ndupl, sbitmap wont_exit, unsigned int ndupl, sbitmap wont_exit,
edge orig, edge *to_remove, edge orig, VEC (edge, heap) **to_remove,
unsigned int *n_to_remove, int flags) int flags)
{ {
unsigned first_new_block; unsigned first_new_block;
...@@ -578,7 +578,7 @@ tree_duplicate_loop_to_header_edge (struct loop *loop, edge e, ...@@ -578,7 +578,7 @@ tree_duplicate_loop_to_header_edge (struct loop *loop, edge e,
first_new_block = last_basic_block; first_new_block = last_basic_block;
if (!duplicate_loop_to_header_edge (loop, e, ndupl, wont_exit, if (!duplicate_loop_to_header_edge (loop, e, ndupl, wont_exit,
orig, to_remove, n_to_remove, flags)) orig, to_remove, flags))
return false; return false;
/* Readd the removed phi args for e. */ /* Readd the removed phi args for e. */
...@@ -853,7 +853,7 @@ tree_unroll_loop (struct loop *loop, unsigned factor, ...@@ -853,7 +853,7 @@ tree_unroll_loop (struct loop *loop, unsigned factor,
sbitmap_ones (wont_exit); sbitmap_ones (wont_exit);
ok = tree_duplicate_loop_to_header_edge ok = tree_duplicate_loop_to_header_edge
(loop, loop_latch_edge (loop), factor - 1, (loop, loop_latch_edge (loop), factor - 1,
wont_exit, NULL, NULL, NULL, DLTHE_FLAG_UPDATE_FREQ); wont_exit, exit, NULL, DLTHE_FLAG_UPDATE_FREQ);
free (wont_exit); free (wont_exit);
gcc_assert (ok); gcc_assert (ok);
update_ssa (TODO_update_ssa); update_ssa (TODO_update_ssa);
......
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