diff mbox

[3/3] Add -ftree-loop-distribute-patterns.

Message ID 1280590076-2581-4-git-send-email-sebpop@gmail.com
State New
Headers show

Commit Message

Sebastian Pop July 31, 2010, 3:27 p.m. UTC
---
 gcc/common.opt               |    4 ++++
 gcc/doc/invoke.texi          |    5 +++++
 gcc/tree-loop-distribution.c |    3 ++-
 3 files changed, 11 insertions(+), 1 deletions(-)
diff mbox

Patch

diff --git a/gcc/common.opt b/gcc/common.opt
index 77cf58e..a9fcdd2 100644
--- a/gcc/common.opt
+++ b/gcc/common.opt
@@ -1341,6 +1341,10 @@  ftree-loop-distribute-memset-zero
 Common Report Var(flag_tree_loop_distribute_memset_zero) Optimization
 Enable loop distribution of initialization loops using memset zero
 
+ftree-loop-distribute-patterns
+Common Report Var(flag_tree_loop_distribute_patterns) Optimization
+Enable loop distribution of patterns code generated with calls to a library
+
 ftree-loop-im
 Common Report Var(flag_tree_loop_im) Init(1) Optimization
 Enable loop invariant motion on trees
diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi
index ca3238c..b9b8b22 100644
--- a/gcc/doc/invoke.texi
+++ b/gcc/doc/invoke.texi
@@ -385,6 +385,7 @@  Objective-C and Objective-C++ Dialects}.
 -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 -ftree-loop-distribute-memset-zero @gol
+-ftree-loop-distribute-patterns @gol
 -ftree-loop-ivcanon -ftree-loop-linear -ftree-loop-optimize @gol
 -ftree-parallelize-loops=@var{n} -ftree-pre -ftree-pta -ftree-reassoc @gol
 -ftree-sink -ftree-sra -ftree-switch-conversion @gol
@@ -6946,6 +6947,10 @@  ENDDO
 and the initialization loop is transformed into a call to memset zero.
 This flag is enabled by default at @option{-O3}.
 
+@item -ftree-loop-distribute-patterns
+Perform loop distribution of patterns that can be code generated with
+calls to a library.  This enables @option{-ftree-loop-distribute-memset-zero}.
+
 @item -ftree-loop-im
 @opindex ftree-loop-im
 Perform loop invariant motion on trees.  This pass moves only invariants that
diff --git a/gcc/tree-loop-distribution.c b/gcc/tree-loop-distribution.c
index 920f744..c677ecb 100644
--- a/gcc/tree-loop-distribution.c
+++ b/gcc/tree-loop-distribution.c
@@ -1187,7 +1187,8 @@  tree_loop_distribution (void)
       /* If both flag_tree_loop_distribute_memset_zero and
 	 flag_tree_loop_distribution are set, then only memset_zero is
 	 executed.  */
-      if (flag_tree_loop_distribute_memset_zero)
+      if (flag_tree_loop_distribute_memset_zero
+	  || flag_tree_loop_distribute_patterns)
 	{
 	  /* With the following working list, we're asking
 	     distribute_loop to separate from the rest of the loop the