Commit f37a4f14 by Revital Eres Committed by Mostafa Hagog

Makefile.in (loop-unroll.o): Add VARRAY_H dependency.

2004-10-18  Revital Eres  <eres@il.ibm.com>

        * Makefile.in (loop-unroll.o): Add VARRAY_H dependency.
        * loop-unroll.c: Include varray.h.
        (struct var_to_expand, struct opt_info): Rename split_ivs_info to
        opt_info and expand it to support variable expansion.
        (analyze_insns_in_loop): Rename analyze_ivs_to_split and
        expand it to support variable expansion.
        (pt_info_start_duplication): Rename si_info_start_duplication.
        (apply_opt_in_copies): Rename split_ivs_in_copies and add support
        to the variable expansion optimization.
        (free_opt_info): Rename free_si_info.
        (analyze_insn_to_expand_var, referenced_in_one_insn_in_loop_p,
        expand_var_during_unrolling, insert_var_expansion_initialization,
        combine_var_copies_in_loop_exit, release_var_copies,
        get_expansion): New functions.
        (peel_loop_completely, unroll_loop_constant_iterations,
        unroll_loop_runtime_iterations, peel_loop_simple,
        unroll_loop_stupid): Change uses of struct si_info
        to struct opt_info
        and add uses of fvariable-expansion-in-unroller flag.
        * params.def: Add parameter to restrict the number of expansions.
        * params.h: (MAX_VARIABLE_EXPANSIONS): New define to restrict
        the number of expansions.
        * common.opt: (fvariable-expansion-in-unroller): New flag.
        * doc/invoke.texi: (fvariable-expansion-in-unroller): Document.

From-SVN: r89197
parent 535306d0
2004-10-18 Revital Eres <eres@il.ibm.com>
* Makefile.in (loop-unroll.o): Add VARRAY_H dependency.
* loop-unroll.c: Include varray.h.
(struct var_to_expand, struct opt_info): Rename split_ivs_info to
opt_info and expand it to support variable expansion.
(analyze_insns_in_loop): Rename analyze_ivs_to_split and
expand it to support variable expansion.
(pt_info_start_duplication): Rename si_info_start_duplication.
(apply_opt_in_copies): Rename split_ivs_in_copies and add support
to the variable expansion optimization.
(free_opt_info): Rename free_si_info.
(analyze_insn_to_expand_var, referenced_in_one_insn_in_loop_p,
expand_var_during_unrolling, insert_var_expansion_initialization,
combine_var_copies_in_loop_exit, release_var_copies,
get_expansion): New functions.
(peel_loop_completely, unroll_loop_constant_iterations,
unroll_loop_runtime_iterations, peel_loop_simple,
unroll_loop_stupid): Change uses of struct si_info
to struct opt_info
and add uses of fvariable-expansion-in-unroller flag.
* params.def: Add parameter to restrict the number of expansions.
* params.h: (MAX_VARIABLE_EXPANSIONS): New define to restrict
the number of expansions.
* common.opt: (fvariable-expansion-in-unroller): New flag.
* doc/invoke.texi: (fvariable-expansion-in-unroller): Document.
2004-10-18 Danny Smith <dannysmith@users.sourceforge.net> 2004-10-18 Danny Smith <dannysmith@users.sourceforge.net>
* config/i386/cygming.h (TARGET_OS_CPP_BUILTINS): Define * config/i386/cygming.h (TARGET_OS_CPP_BUILTINS): Define
......
...@@ -2037,7 +2037,7 @@ loop-unswitch.o : loop-unswitch.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) $(TM_H) \ ...@@ -2037,7 +2037,7 @@ loop-unswitch.o : loop-unswitch.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) $(TM_H) \
output.h $(EXPR_H) coretypes.h $(TM_H) output.h $(EXPR_H) coretypes.h $(TM_H)
loop-unroll.o: loop-unroll.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) $(TM_H) \ loop-unroll.o: loop-unroll.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) $(TM_H) \
$(BASIC_BLOCK_H) hard-reg-set.h $(CFGLOOP_H) $(CFGLAYOUT_H) $(PARAMS_H) \ $(BASIC_BLOCK_H) hard-reg-set.h $(CFGLOOP_H) $(CFGLAYOUT_H) $(PARAMS_H) \
output.h $(EXPR_H) coretypes.h $(TM_H) $(HASHTAB_H) $(RECOG_H) output.h $(EXPR_H) coretypes.h $(TM_H) $(HASHTAB_H) $(RECOG_H) $(VARRAY_H)
dominance.o : dominance.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \ dominance.o : dominance.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \
hard-reg-set.h $(BASIC_BLOCK_H) et-forest.h hard-reg-set.h $(BASIC_BLOCK_H) et-forest.h
et-forest.o : et-forest.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) et-forest.h alloc-pool.h et-forest.o : et-forest.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) et-forest.h alloc-pool.h
......
...@@ -748,6 +748,10 @@ fsplit-ivs-in-unroller ...@@ -748,6 +748,10 @@ fsplit-ivs-in-unroller
Common Report Var(flag_split_ivs_in_unroller) Init(1) Common Report Var(flag_split_ivs_in_unroller) Init(1)
Split lifetimes of induction variables when loops are unrolled. Split lifetimes of induction variables when loops are unrolled.
fvariable-expansion-in-unroller
Common Report Var(flag_variable_expansion_in_unroller)
Apply variable expansion when loops are unrolled.
; Emit code to probe the stack, to help detect stack overflow; also ; Emit code to probe the stack, to help detect stack overflow; also
; may cause large objects to be allocated dynamically. ; may cause large objects to be allocated dynamically.
fstack-check fstack-check
......
...@@ -316,6 +316,7 @@ Objective-C and Objective-C++ Dialects}. ...@@ -316,6 +316,7 @@ Objective-C and Objective-C++ Dialects}.
-fstrength-reduce -fstrict-aliasing -ftracer -fthread-jumps @gol -fstrength-reduce -fstrict-aliasing -ftracer -fthread-jumps @gol
-funroll-all-loops -funroll-loops -fpeel-loops @gol -funroll-all-loops -funroll-loops -fpeel-loops @gol
-fsplit-ivs-in-unroller -funswitch-loops @gol -fsplit-ivs-in-unroller -funswitch-loops @gol
-fvariable-expansion-in-unroller @gol
-ftree-pre -ftree-ccp -ftree-dce -ftree-loop-optimize @gol -ftree-pre -ftree-ccp -ftree-dce -ftree-loop-optimize @gol
-ftree-loop-linear -ftree-loop-im -ftree-loop-ivcanon -fivopts @gol -ftree-loop-linear -ftree-loop-im -ftree-loop-ivcanon -fivopts @gol
-ftree-dominator-opts -ftree-dse -ftree-copyrename @gol -ftree-dominator-opts -ftree-dse -ftree-copyrename @gol
...@@ -4728,6 +4729,11 @@ on some of the architectures due to restrictions in the CSE pass. ...@@ -4728,6 +4729,11 @@ on some of the architectures due to restrictions in the CSE pass.
This optimization is enabled by default. This optimization is enabled by default.
@item -fvariable-expansion-in-unroller
@opindex -fvariable-expansion-in-unroller
With this option, the compiler will create multiple copies of some
local variables when unrolling a loop which can result in superior code.
@item -fprefetch-loop-arrays @item -fprefetch-loop-arrays
@opindex fprefetch-loop-arrays @opindex fprefetch-loop-arrays
If supported by the target machine, generate instructions to prefetch If supported by the target machine, generate instructions to prefetch
......
...@@ -95,6 +95,15 @@ DEFPARAM (PARAM_MAX_INLINE_INSNS_RTL, ...@@ -95,6 +95,15 @@ DEFPARAM (PARAM_MAX_INLINE_INSNS_RTL,
"The maximum number of instructions for the RTL inliner", "The maximum number of instructions for the RTL inliner",
600) 600)
/* Limit the number of expansions created by the variable expansion
optimization to avoid register pressure. */
DEFPARAM (PARAM_MAX_VARIABLE_EXPANSIONS,
"max-variable-expansions-in-unroller",
"If -fvariable-expansion-in-unroller is used, the maximum number of \
times that an individual variable will be expanded \
during loop unrolling",
1)
/* The maximum number of instructions to consider when looking for an /* The maximum number of instructions to consider when looking for an
instruction to fill a delay slot. If more than this arbitrary instruction to fill a delay slot. If more than this arbitrary
number of instructions is searched, the time savings from filling number of instructions is searched, the time savings from filling
......
...@@ -94,6 +94,8 @@ typedef enum compiler_param ...@@ -94,6 +94,8 @@ typedef enum compiler_param
PARAM_VALUE (PARAM_MAX_INLINE_INSNS_AUTO) PARAM_VALUE (PARAM_MAX_INLINE_INSNS_AUTO)
#define MAX_INLINE_INSNS_RTL \ #define MAX_INLINE_INSNS_RTL \
PARAM_VALUE (PARAM_MAX_INLINE_INSNS_RTL) PARAM_VALUE (PARAM_MAX_INLINE_INSNS_RTL)
#define MAX_VARIABLE_EXPANSIONS \
PARAM_VALUE (PARAM_MAX_VARIABLE_EXPANSIONS)
#define MAX_DELAY_SLOT_INSN_SEARCH \ #define MAX_DELAY_SLOT_INSN_SEARCH \
PARAM_VALUE (PARAM_MAX_DELAY_SLOT_INSN_SEARCH) PARAM_VALUE (PARAM_MAX_DELAY_SLOT_INSN_SEARCH)
#define MAX_DELAY_SLOT_LIVE_SEARCH \ #define MAX_DELAY_SLOT_LIVE_SEARCH \
......
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