Commit 384a5197 by Sebastian Pop Committed by Sebastian Pop

Add the -ftree-loop-if-convert flag.

2010-07-08  Sebastian Pop  <sebastian.pop@amd.com>

	* common.opt (ftree-loop-if-convert): New flag.
	* doc/invoke.texi (ftree-loop-if-convert): Documented.
	* tree-if-conv.c (gate_tree_if_conversion): Enable if-conversion
	when flag_tree_loop_if_convert is set.

From-SVN: r161963
parent f8e1995a
2010-07-08 Sebastian Pop <sebastian.pop@amd.com>
* common.opt (ftree-loop-if-convert): New flag.
* doc/invoke.texi (ftree-loop-if-convert): Documented.
* tree-if-conv.c (gate_tree_if_conversion): Enable if-conversion
when flag_tree_loop_if_convert is set.
2010-07-08 Uros Bizjak <ubizjak@gmail.com> 2010-07-08 Uros Bizjak <ubizjak@gmail.com>
* config/i386/i386.c: Use short syntax for function calls * config/i386/i386.c: Use short syntax for function calls
......
...@@ -653,6 +653,10 @@ fif-conversion2 ...@@ -653,6 +653,10 @@ fif-conversion2
Common Report Var(flag_if_conversion2) Optimization Common Report Var(flag_if_conversion2) Optimization
Perform conversion of conditional jumps to conditional execution Perform conversion of conditional jumps to conditional execution
ftree-loop-if-convert
Common Report Var(flag_tree_loop_if_convert) Init(-1) Optimization
Convert conditional jumps in innermost loops to branchless equivalents
; -finhibit-size-directive inhibits output of .size for ELF. ; -finhibit-size-directive inhibits output of .size for ELF.
; This is used only for compiling crtstuff.c, ; This is used only for compiling crtstuff.c,
; and it may be extended to other effects ; and it may be extended to other effects
......
...@@ -342,7 +342,7 @@ Objective-C and Objective-C++ Dialects}. ...@@ -342,7 +342,7 @@ Objective-C and Objective-C++ Dialects}.
-fearly-inlining -fipa-sra -fexpensive-optimizations -ffast-math @gol -fearly-inlining -fipa-sra -fexpensive-optimizations -ffast-math @gol
-ffinite-math-only -ffloat-store -fexcess-precision=@var{style} @gol -ffinite-math-only -ffloat-store -fexcess-precision=@var{style} @gol
-fforward-propagate -ffunction-sections @gol -fforward-propagate -ffunction-sections @gol
-fgcse -fgcse-after-reload -fgcse-las -fgcse-lm @gol -fgcse -fgcse-after-reload -fgcse-las -fgcse-lm -fgraphite-identity @gol
-fgcse-sm -fif-conversion -fif-conversion2 -findirect-inlining @gol -fgcse-sm -fif-conversion -fif-conversion2 -findirect-inlining @gol
-finline-functions -finline-functions-called-once -finline-limit=@var{n} @gol -finline-functions -finline-functions-called-once -finline-limit=@var{n} @gol
-finline-small-functions -fipa-cp -fipa-cp-clone -fipa-matrix-reorg -fipa-pta @gol -finline-small-functions -fipa-cp -fipa-cp-clone -fipa-matrix-reorg -fipa-pta @gol
...@@ -352,7 +352,7 @@ Objective-C and Objective-C++ Dialects}. ...@@ -352,7 +352,7 @@ Objective-C and Objective-C++ Dialects}.
-fira-loop-pressure -fno-ira-share-save-slots @gol -fira-loop-pressure -fno-ira-share-save-slots @gol
-fno-ira-share-spill-slots -fira-verbose=@var{n} @gol -fno-ira-share-spill-slots -fira-verbose=@var{n} @gol
-fivopts -fkeep-inline-functions -fkeep-static-consts @gol -fivopts -fkeep-inline-functions -fkeep-static-consts @gol
-floop-block -floop-interchange -floop-strip-mine -fgraphite-identity @gol -floop-block -floop-interchange -floop-strip-mine @gol
-floop-parallelize-all -flto -flto-compression-level -flto-report -fltrans @gol -floop-parallelize-all -flto -flto-compression-level -flto-report -fltrans @gol
-fltrans-output-list -fmerge-all-constants -fmerge-constants -fmodulo-sched @gol -fltrans-output-list -fmerge-all-constants -fmerge-constants -fmodulo-sched @gol
-fmodulo-sched-allow-regmoves -fmove-loop-invariants -fmudflap @gol -fmodulo-sched-allow-regmoves -fmove-loop-invariants -fmudflap @gol
...@@ -382,8 +382,8 @@ Objective-C and Objective-C++ Dialects}. ...@@ -382,8 +382,8 @@ Objective-C and Objective-C++ Dialects}.
-fsplit-wide-types -fstack-protector -fstack-protector-all @gol -fsplit-wide-types -fstack-protector -fstack-protector-all @gol
-fstrict-aliasing -fstrict-overflow -fthread-jumps -ftracer @gol -fstrict-aliasing -fstrict-overflow -fthread-jumps -ftracer @gol
-ftree-builtin-call-dce -ftree-ccp -ftree-ch -ftree-copy-prop @gol -ftree-builtin-call-dce -ftree-ccp -ftree-ch -ftree-copy-prop @gol
-ftree-copyrename -ftree-dce @gol -ftree-copyrename -ftree-dce -ftree-dominator-opts -ftree-dse @gol
-ftree-dominator-opts -ftree-dse -ftree-forwprop -ftree-fre -ftree-loop-im @gol -ftree-forwprop -ftree-fre -ftree-loop-if-convert -ftree-loop-im @gol
-ftree-phiprop -ftree-loop-distribution @gol -ftree-phiprop -ftree-loop-distribution @gol
-ftree-loop-ivcanon -ftree-loop-linear -ftree-loop-optimize @gol -ftree-loop-ivcanon -ftree-loop-linear -ftree-loop-optimize @gol
-ftree-parallelize-loops=@var{n} -ftree-pre -ftree-pta -ftree-reassoc @gol -ftree-parallelize-loops=@var{n} -ftree-pre -ftree-pta -ftree-reassoc @gol
...@@ -6883,6 +6883,13 @@ profitable to parallelize the loops. ...@@ -6883,6 +6883,13 @@ profitable to parallelize the loops.
Compare the results of several data dependence analyzers. This option Compare the results of several data dependence analyzers. This option
is used for debugging the data dependence analyzers. is used for debugging the data dependence analyzers.
@item -ftree-loop-if-convert
Attempt to transform conditional jumps in the innermost loops to
branch-less equivalents. The intent is to remove control-flow from
the innermost loops in order to improve the ability of the
vectorization pass to handle these loops. This is enabled by default
if vectorization is enabled.
@item -ftree-loop-distribution @item -ftree-loop-distribution
Perform loop distribution. This flag can improve cache performance on Perform loop distribution. This flag can improve cache performance on
big loop bodies and allow further loop optimizations, like big loop bodies and allow further loop optimizations, like
......
...@@ -1239,10 +1239,13 @@ main_tree_if_conversion (void) ...@@ -1239,10 +1239,13 @@ main_tree_if_conversion (void)
return changed ? TODO_cleanup_cfg : 0; return changed ? TODO_cleanup_cfg : 0;
} }
/* Returns true when the if-conversion pass is enabled. */
static bool static bool
gate_tree_if_conversion (void) gate_tree_if_conversion (void)
{ {
return flag_tree_vectorize != 0; return ((flag_tree_vectorize && flag_tree_loop_if_convert != 0)
|| flag_tree_loop_if_convert == 1);
} }
struct gimple_opt_pass pass_if_conversion = struct gimple_opt_pass pass_if_conversion =
......
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