From patchwork Thu Oct 3 14:44:54 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew MacLeod X-Patchwork-Id: 280348 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]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 085F62C007A for ; Fri, 4 Oct 2013 00:45:04 +1000 (EST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :message-id:date:from:mime-version:to:subject:references :in-reply-to:content-type; q=dns; s=default; b=Zm7Wxp2tc/LBoDNst ytwIR7Pp/6c7cvCvGKzFKL+J6bx/qi5oDeUblFqENMPzm2ixmPiziTxCmjZFEfXv UpiT2GaNxBq0XqqcAcz2xUbj0xI61dyhBKoTGTfF6OIzH1ewztAVxd5l96eE8gxI pvgihTPvtI7etK/wwgXR2cUG6k= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :message-id:date:from:mime-version:to:subject:references :in-reply-to:content-type; s=default; bh=dQOSVyJusDzDQDJi83Iki3H rxCE=; b=UbjkfuLhJExzyEQLkSY1foXiGTWgWmilsREqSe8aB+ujZWYW4vGMgQj WgTVVMZTFjdJzS//0lHrOg0ezymOuLemZU5qv6SVdyn66cVp/mGxx7X+sNFP+/ut 6Hegby3qS0y0cjJOMa4LeVlheW6oZAgFO3uN4I+azYJhGmas1Oh8= Received: (qmail 15474 invoked by alias); 3 Oct 2013 14:44:58 -0000 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 Received: (qmail 15461 invoked by uid 89); 3 Oct 2013 14:44:57 -0000 Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 03 Oct 2013 14:44:57 +0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.3 required=5.0 tests=AWL, BAYES_00, RP_MATCHES_RCVD autolearn=ham version=3.3.2 X-HELO: mx1.redhat.com Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r93Eitlf004460 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Thu, 3 Oct 2013 10:44:55 -0400 Received: from [10.10.54.154] (vpn-54-154.rdu2.redhat.com [10.10.54.154]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id r93EisFW003947; Thu, 3 Oct 2013 10:44:54 -0400 Message-ID: <524D82E6.9080902@redhat.com> Date: Thu, 03 Oct 2013 10:44:54 -0400 From: Andrew MacLeod User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130805 Thunderbird/17.0.8 MIME-Version: 1.0 To: gcc-patches , Richard Biener Subject: Re: [patch] Add tree-ssa-loop.h and friends. References: <524CD236.1010009@redhat.com> In-Reply-To: <524CD236.1010009@redhat.com> X-IsSubscribed: yes On 10/02/2013 10:11 PM, Andrew MacLeod wrote: > this patch consolidates tree-ssa-loop*.c files with new .h files as > required (8 in total) > > A number of the prototypes were in tree-flow.h, but there were also a > few in cfgloop.h. tree-ssa-loop.h was created to contain a couple of > common structs and act as the gathering file for any generally > applicable tree-ssa-loop includes. tree-flow.h includes this file for > now. > > There is a bit of a criss-cross mess between the cfg-* and > tree-ssa-loop* routines, but I'm not touching that for now. Some of > that might have to get resolved when I try to remove tree-flow.h as a > standard include file from the .c files.. we'll see. > > In particular, tree-ssa-loop-niter.h exports a lot of more generally > used routines. loop-iv.c, loop-unroll.c and loop-unswitch.c needed to > include it. > > A few routines werent referenced outside their file so I made those > static, and there was one routine stmt_invariant_in_loop_p wich was > actually unused. > > bootstraps on x86_64-unknown-linux-gnu and passes with no new > regressions. OK? > > Andrew > And a quick followup to that patch which does 2 things.. 1 - Moves loop_containing_stmt() from tree-flow-inline.h into the new tree-ssa-loop.h 2 - I hated the #includes at the bottom of tree-ssa-loop.h, so I tweaked the definition of affinve_iv. tree-scalar-evolution.h prototypes do not use the affine_iv typedef now, and then I moved the #includes to the top of the file. bootstrapped on x86_64-unknown-linux-gnu and now new regressions. OK? Andrew * tree-flow-inline.h (loop_containing_stmt): Move to tree-ssa-loop.h. * tree-scalar-evolution.h (simple_iv): Don't use affive_iv typedef. * tree-ssa-loop.h: Move includes to top of file. (loop_containing_stmt): Relocate from tree-flow-inline.h. diff -cp G/tree-flow-inline.h ./tree-flow-inline.h *** G/tree-flow-inline.h 2013-10-03 10:33:35.147370376 -0400 --- ./tree-flow-inline.h 2013-10-03 10:36:19.820409453 -0400 *************** may_be_aliased (const_tree var) *** 107,127 **** || TREE_ADDRESSABLE (var))); } - - /* Returns the loop of the statement STMT. */ - - static inline struct loop * - loop_containing_stmt (gimple stmt) - { - basic_block bb = gimple_bb (stmt); - if (!bb) - return NULL; - - return bb->loop_father; - } - - - /* Return true if VAR cannot be modified by the program. */ static inline bool --- 107,112 ---- diff -cp G/tree-scalar-evolution.h ./tree-scalar-evolution.h *** G/tree-scalar-evolution.h 2013-10-03 10:33:35.147370376 -0400 --- ./tree-scalar-evolution.h 2013-10-03 10:25:12.036251172 -0400 *************** extern tree resolve_mixers (struct loop *** 36,42 **** extern void gather_stats_on_scev_database (void); extern unsigned int scev_const_prop (void); extern bool expression_expensive_p (tree); ! extern bool simple_iv (struct loop *, struct loop *, tree, affine_iv *, bool); extern tree compute_overall_effect_of_inner_loop (struct loop *, tree); /* Returns the basic block preceding LOOP or ENTRY_BLOCK_PTR when the --- 36,43 ---- extern void gather_stats_on_scev_database (void); extern unsigned int scev_const_prop (void); extern bool expression_expensive_p (tree); ! extern bool simple_iv (struct loop *, struct loop *, tree, struct affine_iv_d *, ! bool); extern tree compute_overall_effect_of_inner_loop (struct loop *, tree); /* Returns the basic block preceding LOOP or ENTRY_BLOCK_PTR when the diff -cp G/tree-ssa-loop.h ./tree-ssa-loop.h *** G/tree-ssa-loop.h 2013-10-03 10:33:48.299373496 -0400 --- ./tree-ssa-loop.h 2013-10-03 10:26:03.971263458 -0400 *************** along with GCC; see the file COPYING3. *** 20,28 **** #ifndef GCC_TREE_SSA_LOOP_H #define GCC_TREE_SSA_LOOP_H /* Affine iv. */ ! typedef struct { /* Iv = BASE + STEP * i. */ tree base, step; --- 20,34 ---- #ifndef GCC_TREE_SSA_LOOP_H #define GCC_TREE_SSA_LOOP_H + #include "tree-ssa-loop-im.h" + #include "tree-ssa-loop-ivcanon.h" + #include "tree-ssa-loop-ivopts.h" + #include "tree-ssa-loop-manip.h" + #include "tree-ssa-loop-niter.h" + /* Affine iv. */ ! typedef struct affine_iv_d { /* Iv = BASE + STEP * i. */ tree base, step; *************** struct tree_niter_desc *** 62,71 **** enum tree_code cmp; }; ! #include "tree-ssa-loop-im.h" ! #include "tree-ssa-loop-ivcanon.h" ! #include "tree-ssa-loop-ivopts.h" ! #include "tree-ssa-loop-manip.h" ! #include "tree-ssa-loop-niter.h" #endif /* GCC_TREE_SSA_LOOP_H */ --- 68,83 ---- enum tree_code cmp; }; ! /* Returns the loop of the statement STMT. */ ! ! static inline struct loop * ! loop_containing_stmt (gimple stmt) ! { ! basic_block bb = gimple_bb (stmt); ! if (!bb) ! return NULL; ! ! return bb->loop_father; ! } #endif /* GCC_TREE_SSA_LOOP_H */