Commit c94583fe by Zdenek Dvorak Committed by Zdenek Dvorak

unroll.c: Removed.

	* unroll.c: Removed.
	* loop.h: Removed.
	* Makefile.in (LOOP_H, unroll.o): Removed.
	(toplev.o, passes.o, stmt.o, integrate.o, loop.o): Remove LOOP_H
	dependency.
	* alias.c (init_alias_analysis): Remove flag_old_unroll_loops
	reference.
	* cfgloop.h (LOOP_PREFETCH, loop_optimize): Moved from loop.h.
	* common.opt (fold-unroll-loops, fold-unroll-all-loops): Removed.
	* loop.c: Do not include loop.h.
	(LOOP_INFO, LOOP_MOVABLES, LOOP_REGS, LOOP_IVS, INSN_LUID,
	REGNO_FIRST_LUID, REGNO_LAST_LUID, enum g_types, struct induction,
	struct iv_class, enum iv_mode, struct iv, REG_IV_TYPE, REG_IV_INFO,
	REG_IV_CLASS, struct loop_ivs, struct loop_mem_info, struct loop_reg,
	struct loop_regs, struct loop_movables, struct loop_info): Moved
	from loop.h.
	(back_branch_in_range_p, fold_rtx_mult_add, biv_total_increment,
	reg_dead_after_loop, final_biv_value, loop_find_equiv_value,
	find_common_reg_term, loop_iterations, final_giv_value): Moved
	from unroll.c.
	(uid_luid, uid_loop, max_uid_for_loop, max_reg_before_loop,
	loop_dump_stream, for_each_insn_in_loop, express_from,
	extend_value_for_giv, loop_iv_add_mult_emit_before,
	loop_iv_add_mult_sink, loop_iv_add_mult_hoist,
	loop_insn_first_p, get_condition_for_loop,
	loop_insn_emit_before, loop_insn_hoist,
	loop_insn_sink): Made static.
	(loop_invariant_p): Made static.  Removed flag_old_unroll_loops
	reference.
	(strength_reduce): Do not call unroller.
	(record_giv): Do not initialize unrolled field.
	(prescan_loop): Do not set loop_info->preconditioned.
	* passes.c: Do not include loop.h.
	(rest_of_handle_loop_optimize): Do not call unroller.
	* predict.c: Do not include loop.h.
	* rtl.h (NOTE_PRECONDITIONED): Removed.
	* stmt.c: Do not include loop.h.
	* toplev.c: Do not include loop.h.
	(process_options): Do not handle flag_old_unroll_loops.

	* doc/invoke.texi (fold-unroll-loops, fold-unroll-all-loops):
	Documentation removed.
	* doc/passes.texi (unroll.c, loop.h): Documentation removed.

From-SVN: r87485
parent 03261822
2004-09-14 Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz>
* unroll.c: Removed.
* loop.h: Removed.
* Makefile.in (LOOP_H, unroll.o): Removed.
(toplev.o, passes.o, stmt.o, integrate.o, loop.o): Remove LOOP_H
dependency.
* alias.c (init_alias_analysis): Remove flag_old_unroll_loops
reference.
* cfgloop.h (LOOP_PREFETCH, loop_optimize): Moved from loop.h.
* common.opt (fold-unroll-loops, fold-unroll-all-loops): Removed.
* loop.c: Do not include loop.h.
(LOOP_INFO, LOOP_MOVABLES, LOOP_REGS, LOOP_IVS, INSN_LUID,
REGNO_FIRST_LUID, REGNO_LAST_LUID, enum g_types, struct induction,
struct iv_class, enum iv_mode, struct iv, REG_IV_TYPE, REG_IV_INFO,
REG_IV_CLASS, struct loop_ivs, struct loop_mem_info, struct loop_reg,
struct loop_regs, struct loop_movables, struct loop_info): Moved
from loop.h.
(back_branch_in_range_p, fold_rtx_mult_add, biv_total_increment,
reg_dead_after_loop, final_biv_value, loop_find_equiv_value,
find_common_reg_term, loop_iterations, final_giv_value): Moved
from unroll.c.
(uid_luid, uid_loop, max_uid_for_loop, max_reg_before_loop,
loop_dump_stream, for_each_insn_in_loop, express_from,
extend_value_for_giv, loop_iv_add_mult_emit_before,
loop_iv_add_mult_sink, loop_iv_add_mult_hoist,
loop_insn_first_p, get_condition_for_loop,
loop_insn_emit_before, loop_insn_hoist,
loop_insn_sink): Made static.
(loop_invariant_p): Made static. Removed flag_old_unroll_loops
reference.
(strength_reduce): Do not call unroller.
(record_giv): Do not initialize unrolled field.
(prescan_loop): Do not set loop_info->preconditioned.
* passes.c: Do not include loop.h.
(rest_of_handle_loop_optimize): Do not call unroller.
* predict.c: Do not include loop.h.
* rtl.h (NOTE_PRECONDITIONED): Removed.
* stmt.c: Do not include loop.h.
* toplev.c: Do not include loop.h.
(process_options): Do not handle flag_old_unroll_loops.
* doc/invoke.texi (fold-unroll-loops, fold-unroll-all-loops):
Documentation removed.
* doc/passes.texi (unroll.c, loop.h): Documentation removed.
2004-09-14 Nathan Sidwell <nathan@codesourcery.com>
* Makefile.in (STAGE1_CHECKING): New variable.
......
......@@ -701,7 +701,6 @@ RA_H = ra.h bitmap.h sbitmap.h hard-reg-set.h insn-modes.h
RESOURCE_H = resource.h hard-reg-set.h
SCHED_INT_H = sched-int.h $(INSN_ATTR_H) $(BASIC_BLOCK_H) $(RTL_H)
INTEGRATE_H = integrate.h varray.h
LOOP_H = loop.h varray.h bitmap.h
CFGLAYOUT_H = cfglayout.h $(BASIC_BLOCK_H)
CFGLOOP_H = cfgloop.h $(BASIC_BLOCK_H) $(RTL_H)
CGRAPH_H = cgraph.h bitmap.h tree.h $(HASHTAB_H)
......@@ -921,7 +920,7 @@ OBJS-common = \
reload.o reload1.o reorg.o resource.o rtl.o rtlanal.o rtl-error.o \
sbitmap.o sched-deps.o sched-ebb.o sched-rgn.o sched-vis.o sdbout.o \
simplify-rtx.o sreal.o stmt.o stor-layout.o stringpool.o \
targhooks.o timevar.o toplev.o tracer.o tree.o tree-dump.o unroll.o \
targhooks.o timevar.o toplev.o tracer.o tree.o tree-dump.o \
varasm.o varray.o vec.o version.o vmsdbgout.o xcoffout.o alloc-pool.o \
et-forest.o cfghooks.o bt-load.o pretty-print.o $(GGC) web.o passes.o \
rtl-profile.o tree-profile.o rtlhooks.o cfgexpand.o lambda-mat.o \
......@@ -1719,7 +1718,7 @@ tree-ssa-loop-manip.o : tree-ssa-loop-manip.c $(TREE_FLOW_H) $(CONFIG_H) \
tree-ssa-loop-im.o : tree-ssa-loop-im.c $(TREE_FLOW_H) $(CONFIG_H) \
$(SYSTEM_H) $(RTL_H) $(TREE_H) $(TM_P_H) $(CFGLOOP_H) domwalk.h $(PARAMS_H)\
output.h diagnostic.h $(TIMEVAR_H) $(TM_H) coretypes.h $(TREE_DUMP_H) \
tree-pass.h flags.h
tree-pass.h flags.h $(HASHTAB_H)
tree-ssa-alias.o : tree-ssa-alias.c $(TREE_FLOW_H) $(CONFIG_H) $(SYSTEM_H) \
$(RTL_H) $(TREE_H) $(TM_P_H) $(EXPR_H) $(GGC_H) tree-inline.h $(FLAGS_H) \
function.h $(TIMEVAR_H) convert.h $(TM_H) coretypes.h \
......@@ -1793,7 +1792,7 @@ toplev.o : toplev.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) versio
function.h $(FLAGS_H) xcoffout.h input.h $(INSN_ATTR_H) output.h $(DIAGNOSTIC_H) \
debug.h insn-config.h intl.h $(RECOG_H) Makefile toplev.h \
dwarf2out.h sdbout.h dbxout.h $(EXPR_H) hard-reg-set.h $(BASIC_BLOCK_H) \
graph.h $(LOOP_H) except.h $(REGS_H) $(TIMEVAR_H) value-prof.h \
graph.h except.h $(REGS_H) $(TIMEVAR_H) value-prof.h \
$(PARAMS_H) $(TM_P_H) reload.h dwarf2asm.h $(TARGET_H) \
langhooks.h insn-flags.h $(CFGLAYOUT_H) real.h $(CFGLOOP_H) \
hosthooks.h $(LANGHOOKS_DEF_H) $(CGRAPH_H) $(COVERAGE_H) alloc-pool.h
......@@ -1805,7 +1804,7 @@ passes.o : passes.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) \
$(RTL_H) function.h $(FLAGS_H) xcoffout.h input.h $(INSN_ATTR_H) output.h \
$(DIAGNOSTIC_H) debug.h insn-config.h intl.h $(RECOG_H) toplev.h \
dwarf2out.h sdbout.h dbxout.h $(EXPR_H) hard-reg-set.h $(BASIC_BLOCK_H) \
graph.h $(LOOP_H) except.h $(REGS_H) $(TIMEVAR_H) value-prof.h \
graph.h except.h $(REGS_H) $(TIMEVAR_H) value-prof.h \
$(PARAMS_H) $(TM_P_H) reload.h dwarf2asm.h $(TARGET_H) \
langhooks.h insn-flags.h $(CFGLAYOUT_H) real.h $(CFGLOOP_H) \
hosthooks.h $(LANGHOOKS_DEF_H) $(CGRAPH_H) $(COVERAGE_H) alloc-pool.h \
......@@ -1839,7 +1838,7 @@ function.o : function.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \
$(TM_P_H) langhooks.h gt-function.h $(TARGET_H) basic-block.h
stmt.o : stmt.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) $(TREE_H) $(FLAGS_H) \
function.h insn-config.h hard-reg-set.h $(EXPR_H) libfuncs.h except.h \
$(LOOP_H) $(RECOG_H) toplev.h output.h varray.h $(GGC_H) $(TM_P_H) \
$(RECOG_H) toplev.h output.h varray.h $(GGC_H) $(TM_P_H) \
langhooks.h $(PREDICT_H) $(OPTABS_H) $(TARGET_H)
except.o : except.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \
$(TREE_H) $(FLAGS_H) except.h function.h $(EXPR_H) libfuncs.h $(INTEGRATE_H) \
......@@ -1900,7 +1899,7 @@ emit-rtl.o : emit-rtl.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) $(T
real.o : real.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) toplev.h $(TM_P_H)
integrate.o : integrate.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) $(TREE_H) \
$(FLAGS_H) debug.h $(INTEGRATE_H) insn-config.h $(EXPR_H) real.h $(REGS_H) \
intl.h function.h output.h $(RECOG_H) except.h toplev.h $(LOOP_H) \
intl.h function.h output.h $(RECOG_H) except.h toplev.h \
$(PARAMS_H) $(TM_P_H) $(TARGET_H) langhooks.h gt-integrate.h
jump.o : jump.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) $(FLAGS_H) \
hard-reg-set.h $(REGS_H) insn-config.h $(RECOG_H) $(EXPR_H) real.h except.h function.h \
......@@ -1977,17 +1976,13 @@ rtl-profile.o : tree-profile.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \
value-prof.o : value-prof.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \
$(BASIC_BLOCK_H) hard-reg-set.h value-prof.h $(EXPR_H) output.h $(FLAGS_H) \
$(RECOG_H) insn-config.h $(OPTABS_H) $(REGS_H) $(GGC_H)
loop.o : loop.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) $(FLAGS_H) $(LOOP_H) \
loop.o : loop.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) $(FLAGS_H) \
insn-config.h $(REGS_H) hard-reg-set.h $(RECOG_H) $(EXPR_H) \
real.h $(PREDICT_H) $(BASIC_BLOCK_H) function.h $(CFGLOOP_H) \
toplev.h varray.h except.h cselib.h $(OPTABS_H) $(TM_P_H) $(GGC_H)
loop-doloop.o : loop-doloop.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \
$(RTL_H) $(FLAGS_H) $(EXPR_H) hard-reg-set.h $(BASIC_BLOCK_H) $(TM_P_H) \
toplev.h $(CFGLOOP_H) output.h $(PARAMS_H)
unroll.o : unroll.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) insn-config.h \
function.h $(INTEGRATE_H) $(REGS_H) $(RECOG_H) $(FLAGS_H) $(EXPR_H) $(LOOP_H) toplev.h \
hard-reg-set.h varray.h $(BASIC_BLOCK_H) $(TM_P_H) $(PREDICT_H) $(PARAMS_H) \
$(CFGLOOP_H)
alloc-pool.o : alloc-pool.c $(CONFIG_H) $(SYSTEM_H) alloc-pool.h $(HASHTAB_H)
flow.o : flow.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) $(TREE_H) \
$(FLAGS_H) insn-config.h $(BASIC_BLOCK_H) $(REGS_H) hard-reg-set.h output.h toplev.h \
......
......@@ -2763,11 +2763,6 @@ init_alias_analysis (void)
new_reg_base_value = xmalloc (maxreg * sizeof (rtx));
reg_seen = xmalloc (maxreg);
if (! reload_completed && flag_old_unroll_loops)
{
alias_invariant = ggc_calloc (maxreg, sizeof (rtx));
alias_invariant_size = maxreg;
}
/* The basic idea is that each pass through this loop will use the
"constant" information from the previous pass to propagate alias
......
......@@ -458,4 +458,11 @@ extern void unroll_and_peel_loops (struct loops *, int);
extern void doloop_optimize_loops (struct loops *);
extern void move_loop_invariants (struct loops *);
/* Old loop optimizer interface. */
/* Flags passed to loop_optimize. */
#define LOOP_PREFETCH 1
extern void loop_optimize (rtx, FILE *, int);
#endif /* GCC_CFGLOOP_H */
......@@ -551,14 +551,6 @@ fnon-call-exceptions
Common Report Var(flag_non_call_exceptions)
Support synchronous non-call exceptions
fold-unroll-loops
Common Report Var(flag_old_unroll_loops)
Perform loop unrolling when iteration count is known
fold-unroll-all-loops
Common Report Var(flag_old_unroll_all_loops)
Perform loop unrolling for all loops
fomit-frame-pointer
Common Report Var(flag_omit_frame_pointer)
When possible do not generate stack frames
......
......@@ -315,7 +315,7 @@ Objective-C and Objective-C++ Dialects}.
-fsignaling-nans -fsingle-precision-constant -fspeculative-prefetching @gol
-fstrength-reduce -fstrict-aliasing -ftracer -fthread-jumps @gol
-funroll-all-loops -funroll-loops -fpeel-loops @gol
-funswitch-loops -fold-unroll-loops -fold-unroll-all-loops @gol
-funswitch-loops @gol
-ftree-pre -ftree-ccp -ftree-dce -ftree-loop-optimize @gol
-ftree-loop-linear -ftree-loop-im -ftree-loop-ivcanon -fivopts @gol
-ftree-dominator-opts -ftree-dse -ftree-copyrename @gol
......@@ -4423,8 +4423,7 @@ redundant spilling.
@item -floop-optimize
@opindex floop-optimize
Perform loop optimizations: move constant expressions out of loops, simplify
exit test conditions and optionally do strength-reduction and loop unrolling as
well.
exit test conditions and optionally do strength-reduction as well.
Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
......@@ -5222,22 +5221,6 @@ at level @option{-O1}
Move branches with loop invariant conditions out of the loop, with duplicates
of the loop on both branches (modified according to result of the condition).
@item -fold-unroll-loops
@opindex fold-unroll-loops
Unroll loops whose number of iterations can be determined at compile
time or upon entry to the loop, using the old loop unroller whose loop
recognition is based on notes from frontend. @option{-fold-unroll-loops} implies
both @option{-fstrength-reduce} and @option{-frerun-cse-after-loop}. This
option makes code larger, and may or may not make it run faster.
@item -fold-unroll-all-loops
@opindex fold-unroll-all-loops
Unroll all loops, even if their number of iterations is uncertain when
the loop is entered. This is done using the old loop unroller whose loop
recognition is based on notes from frontend. This usually makes programs run more slowly.
@option{-fold-unroll-all-loops} implies the same options as
@option{-fold-unroll-loops}.
@item -fprefetch-loop-arrays
@opindex fprefetch-loop-arrays
If supported by the target machine, generate instructions to prefetch
......
......@@ -540,11 +540,8 @@ are in @file{lcm.c}.
@item Loop optimization
This pass moves constant expressions out of loops,
and optionally does strength-reduction and loop unrolling as well.
Its source files are @file{loop.c} and @file{unroll.c}, plus the header
@file{loop.h} used for communication between them. Loop unrolling uses
some functions in @file{integrate.c} and the header @file{integrate.h}.
This pass moves constant expressions out of loops, and optionally does
strength-reduction as well. The pass is located in @file{loop.c}.
Loop dependency analysis routines are contained in @file{dependence.c}.
This pass is seriously out-of-date and is supposed to be replaced by
a new one described below in near future.
......
......@@ -60,7 +60,6 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#include "intl.h"
#include "ggc.h"
#include "graph.h"
#include "loop.h"
#include "regs.h"
#include "timevar.h"
#include "diagnostic.h"
......@@ -1130,7 +1129,7 @@ rest_of_handle_gcse (void)
static void
rest_of_handle_loop_optimize (void)
{
int do_unroll, do_prefetch;
int do_prefetch;
timevar_push (TV_LOOP);
delete_dead_jumptables ();
......@@ -1140,10 +1139,6 @@ rest_of_handle_loop_optimize (void)
/* CFG is no longer maintained up-to-date. */
free_bb_for_insn ();
if (flag_unroll_loops)
do_unroll = LOOP_AUTO_UNROLL; /* Having two unrollers is useless. */
else
do_unroll = flag_old_unroll_loops ? LOOP_UNROLL : LOOP_AUTO_UNROLL;
do_prefetch = flag_prefetch_loop_arrays ? LOOP_PREFETCH : 0;
if (flag_rerun_loop_opt)
......@@ -1151,8 +1146,7 @@ rest_of_handle_loop_optimize (void)
cleanup_barriers ();
/* We only want to perform unrolling once. */
loop_optimize (get_insns (), dump_file, do_unroll);
do_unroll = 0;
loop_optimize (get_insns (), dump_file, 0);
/* The first call to loop_optimize makes some instructions
trivially dead. We delete those instructions now in the
......@@ -1165,7 +1159,7 @@ rest_of_handle_loop_optimize (void)
reg_scan (get_insns (), max_reg_num (), 1);
}
cleanup_barriers ();
loop_optimize (get_insns (), dump_file, do_unroll | do_prefetch);
loop_optimize (get_insns (), dump_file, do_prefetch);
/* Loop can create trivially dead instructions. */
delete_trivially_dead_insns (get_insns (), max_reg_num ());
......
......@@ -51,7 +51,6 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#include "sreal.h"
#include "params.h"
#include "target.h"
#include "loop.h"
#include "cfgloop.h"
#include "tree-flow.h"
#include "ggc.h"
......
......@@ -788,7 +788,6 @@ extern const char * const reg_note_name[];
#define NOTE_BASIC_BLOCK(INSN) XCBBDEF (INSN, 4, NOTE)
#define NOTE_EXPECTED_VALUE(INSN) XCEXP (INSN, 4, NOTE)
#define NOTE_PREDICTION(INSN) XCINT (INSN, 4, NOTE)
#define NOTE_PRECONDITIONED(INSN) XCINT (INSN, 4, NOTE)
#define NOTE_VAR_LOCATION(INSN) XCEXP (INSN, 4, NOTE)
/* In a NOTE that is a line number, this is the line number.
......
......@@ -39,7 +39,6 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#include "expr.h"
#include "libfuncs.h"
#include "hard-reg-set.h"
#include "loop.h"
#include "recog.h"
#include "machmode.h"
#include "toplev.h"
......
......@@ -61,7 +61,6 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#include "intl.h"
#include "ggc.h"
#include "graph.h"
#include "loop.h"
#include "regs.h"
#include "timevar.h"
#include "diagnostic.h"
......@@ -1684,24 +1683,7 @@ process_options (void)
if (flag_unroll_all_loops)
flag_unroll_loops = 1;
if (flag_unroll_loops)
{
flag_old_unroll_loops = 0;
flag_old_unroll_all_loops = 0;
}
if (flag_old_unroll_all_loops)
flag_old_unroll_loops = 1;
/* Old loop unrolling requires that strength_reduction be on also. Silently
turn on strength reduction here if it isn't already on. Also, the loop
unrolling code assumes that cse will be run after loop, so that must
be turned on also. */
if (flag_old_unroll_loops)
{
flag_strength_reduce = 1;
flag_rerun_cse_after_loop = 1;
}
/* The loop unrolling code assumes that cse will be run after loop. */
if (flag_unroll_loops || flag_peel_loops)
flag_rerun_cse_after_loop = 1;
......
This source diff could not be displayed because it is too large. You can view the blob instead.
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