aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorSebastian Pop <sebastian.pop@amd.com>2010-07-08 16:37:49 +0000
committerSebastian Pop <spop@gcc.gnu.org>2010-07-08 16:37:49 +0000
commit384a5197cbf0fc6e87e65c2fb21b9bbf7a8eceb4 (patch)
tree1c1c6dee711cac40bee4937265d51a8bbbf086a1 /gcc
parentf8e1995a5bd72a8578902d05841537e7a34c27c0 (diff)
downloadgcc-384a5197cbf0fc6e87e65c2fb21b9bbf7a8eceb4.zip
gcc-384a5197cbf0fc6e87e65c2fb21b9bbf7a8eceb4.tar.gz
gcc-384a5197cbf0fc6e87e65c2fb21b9bbf7a8eceb4.tar.bz2
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
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog7
-rw-r--r--gcc/common.opt4
-rw-r--r--gcc/doc/invoke.texi15
-rw-r--r--gcc/tree-if-conv.c5
4 files changed, 26 insertions, 5 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 7cdc860..d745186 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,10 @@
+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>
* config/i386/i386.c: Use short syntax for function calls
diff --git a/gcc/common.opt b/gcc/common.opt
index 6ca787a..111d7b7 100644
--- a/gcc/common.opt
+++ b/gcc/common.opt
@@ -653,6 +653,10 @@ fif-conversion2
Common Report Var(flag_if_conversion2) Optimization
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.
; This is used only for compiling crtstuff.c,
; and it may be extended to other effects
diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi
index d70f130..4d6a1af 100644
--- a/gcc/doc/invoke.texi
+++ b/gcc/doc/invoke.texi
@@ -342,7 +342,7 @@ Objective-C and Objective-C++ Dialects}.
-fearly-inlining -fipa-sra -fexpensive-optimizations -ffast-math @gol
-ffinite-math-only -ffloat-store -fexcess-precision=@var{style} @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
-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
@@ -352,7 +352,7 @@ Objective-C and Objective-C++ Dialects}.
-fira-loop-pressure -fno-ira-share-save-slots @gol
-fno-ira-share-spill-slots -fira-verbose=@var{n} @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
-fltrans-output-list -fmerge-all-constants -fmerge-constants -fmodulo-sched @gol
-fmodulo-sched-allow-regmoves -fmove-loop-invariants -fmudflap @gol
@@ -382,8 +382,8 @@ Objective-C and Objective-C++ Dialects}.
-fsplit-wide-types -fstack-protector -fstack-protector-all @gol
-fstrict-aliasing -fstrict-overflow -fthread-jumps -ftracer @gol
-ftree-builtin-call-dce -ftree-ccp -ftree-ch -ftree-copy-prop @gol
--ftree-copyrename -ftree-dce @gol
--ftree-dominator-opts -ftree-dse -ftree-forwprop -ftree-fre -ftree-loop-im @gol
+-ftree-copyrename -ftree-dce -ftree-dominator-opts -ftree-dse @gol
+-ftree-forwprop -ftree-fre -ftree-loop-if-convert -ftree-loop-im @gol
-ftree-phiprop -ftree-loop-distribution @gol
-ftree-loop-ivcanon -ftree-loop-linear -ftree-loop-optimize @gol
-ftree-parallelize-loops=@var{n} -ftree-pre -ftree-pta -ftree-reassoc @gol
@@ -6883,6 +6883,13 @@ profitable to parallelize the loops.
Compare the results of several data dependence analyzers. This option
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
Perform loop distribution. This flag can improve cache performance on
big loop bodies and allow further loop optimizations, like
diff --git a/gcc/tree-if-conv.c b/gcc/tree-if-conv.c
index 8d5d226..2dd8aa1 100644
--- a/gcc/tree-if-conv.c
+++ b/gcc/tree-if-conv.c
@@ -1239,10 +1239,13 @@ main_tree_if_conversion (void)
return changed ? TODO_cleanup_cfg : 0;
}
+/* Returns true when the if-conversion pass is enabled. */
+
static bool
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 =