From patchwork Sat Jul 31 15:27:56 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sebastian Pop X-Patchwork-Id: 60434 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) by ozlabs.org (Postfix) with SMTP id 00B17B70A8 for ; Sun, 1 Aug 2010 01:28:49 +1000 (EST) Received: (qmail 2744 invoked by alias); 31 Jul 2010 15:28:39 -0000 Received: (qmail 2590 invoked by uid 22791); 31 Jul 2010 15:28:38 -0000 X-SWARE-Spam-Status: No, hits=-1.9 required=5.0 tests=AWL, BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, TW_IV X-Spam-Check-By: sourceware.org Received: from mail-gw0-f47.google.com (HELO mail-gw0-f47.google.com) (74.125.83.47) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sat, 31 Jul 2010 15:28:33 +0000 Received: by gwb15 with SMTP id 15so1024777gwb.20 for ; Sat, 31 Jul 2010 08:28:31 -0700 (PDT) Received: by 10.150.72.31 with SMTP id u31mr4795007yba.221.1280590111866; Sat, 31 Jul 2010 08:28:31 -0700 (PDT) Received: from napoca (cpe-70-120-196-107.austin.res.rr.com [70.120.196.107]) by mx.google.com with ESMTPS id q25sm3349664ybk.6.2010.07.31.08.28.29 (version=TLSv1/SSLv3 cipher=RC4-MD5); Sat, 31 Jul 2010 08:28:31 -0700 (PDT) Received: by napoca (sSMTP sendmail emulation); Sat, 31 Jul 2010 10:28:28 -0500 From: Sebastian Pop To: Richard Guenther Cc: gcc-patches@gcc.gnu.org, Sebastian Pop Subject: [PATCH 3/3] Add -ftree-loop-distribute-patterns. Date: Sat, 31 Jul 2010 10:27:56 -0500 Message-Id: <1280590076-2581-4-git-send-email-sebpop@gmail.com> In-Reply-To: References: X-IsSubscribed: yes Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org --- gcc/common.opt | 4 ++++ gcc/doc/invoke.texi | 5 +++++ gcc/tree-loop-distribution.c | 3 ++- 3 files changed, 11 insertions(+), 1 deletions(-) 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