From patchwork Mon Jul 16 11:57:15 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steven Bosscher X-Patchwork-Id: 171174 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 98DDF2C0222 for ; Mon, 16 Jul 2012 21:57:55 +1000 (EST) Comment: DKIM? See http://www.dkim.org DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=gcc.gnu.org; s=default; x=1343044676; h=Comment: DomainKey-Signature:Received:Received:Received:Received:Received: MIME-Version:Received:In-Reply-To:References:From:Date: Message-ID:Subject:To:Cc:Content-Type:Mailing-List:Precedence: List-Id:List-Unsubscribe:List-Archive:List-Post:List-Help:Sender: Delivered-To; bh=NqB6TQjELqv8yrHSMPpS5vJ/mvM=; b=uYaiaRKbr+PyvXy 16jxBi4caydWn8diuK2jV/cQe4Gw8YSO2uG4IdlAkZKbrM4BuxMCGSyOtEBmOuhK nWqqtz4sHPUGo90PnwvzEuzNE/awISqq+lsrGNpyQI1Z+67m5bOHCMilGUAkRGI6 bU5gzW4G4p4yXZd8iL/cdRvXVG3w= Comment: DomainKeys? See http://antispam.yahoo.com/domainkeys DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=default; d=gcc.gnu.org; h=Received:Received:X-SWARE-Spam-Status:X-Spam-Check-By:Received:Received:Received:MIME-Version:Received:In-Reply-To:References:From:Date:Message-ID:Subject:To:Cc:Content-Type:X-IsSubscribed:Mailing-List:Precedence:List-Id:List-Unsubscribe:List-Archive:List-Post:List-Help:Sender:Delivered-To; b=gvGo+eVEH7azI44s6sb2deTxt9gQM4TT5BGTiIGEZzqhZG52s0Qi4e6hXR5Bk6 dMdh9rMkTXTujXGgpXMZXZzVx36DuA/Qqw1zt7LlW7PRzqar6tZQjwrwXVeti+Py t7wtJXuvrC0ST9fnHC0JS4oQOnjz/Mj7Cw3eOUwv3ctEE=; Received: (qmail 24461 invoked by alias); 16 Jul 2012 11:57:52 -0000 Received: (qmail 24409 invoked by uid 22791); 16 Jul 2012 11:57:50 -0000 X-SWARE-Spam-Status: No, hits=-4.9 required=5.0 tests=AWL, BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, KHOP_RCVD_TRUST, KHOP_THREADED, RCVD_IN_DNSWL_LOW, RCVD_IN_HOSTKARMA_YE X-Spam-Check-By: sourceware.org Received: from mail-lb0-f175.google.com (HELO mail-lb0-f175.google.com) (209.85.217.175) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 16 Jul 2012 11:57:37 +0000 Received: by lbol5 with SMTP id l5so7924822lbo.20 for ; Mon, 16 Jul 2012 04:57:35 -0700 (PDT) Received: by 10.152.132.233 with SMTP id ox9mr11153826lab.25.1342439855211; Mon, 16 Jul 2012 04:57:35 -0700 (PDT) MIME-Version: 1.0 Received: by 10.112.4.229 with HTTP; Mon, 16 Jul 2012 04:57:15 -0700 (PDT) In-Reply-To: References: From: Steven Bosscher Date: Mon, 16 Jul 2012 13:57:15 +0200 Message-ID: Subject: Re: [patch] Introduce dumpfile.h, clean up tree-pass.h dependencies To: Richard Guenther Cc: GCC Patches 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 On Mon, Jul 16, 2012 at 1:49 PM, Richard Guenther wrote: > On Mon, Jul 16, 2012 at 11:12 AM, Steven Bosscher wrote: >> On Mon, Jul 16, 2012 at 11:00 AM, Richard Guenther >> wrote: >>> On Fri, Jul 13, 2012 at 3:38 PM, Steven Bosscher wrote: >>>> Hello, >>>> >>>> The attached monster patch re-organizes a lot of includes to avoid >>>> dependencies on tree-pass.h just for having dump_file available. >>>> >>>> I've used the following "rules" to decide what needs to go where: >>>> >>>> * tree-dump.h should be independent of the pass manager, i.e. not >>>> include tree-pass.h. >>>> >>>> * passes that do not need dumping of GENERIC do not need tree-dump.h either. >>>> >>>> * Any file that defines an opt_pass may include tree-pass.h. >>>> >>>> * If a file includes tree-pass.h, it does not need to include >>>> dumpfile.h or timevar.h, because tree-pass.h provides these already >>>> (the *opt_pass structs depend on them) >>>> >>>> * If a file does not include tree-pass.h, but it needs dump_file, it >>>> should include dumpfile.h. Likewise for timevar.h. This category of >>>> files are the implementation files for supporting code, like alias.c >>>> and cfg*.c. >>>> >>>> With those rules in mind, my hackathon started and the result is >>>> attached. I had to move a few functions around, but not very much. I >>>> also uncovered a bug in one of the DF files, where it was trying to >>>> use get_insns without including emit-rtl.h. No DF file should emit >>>> RTL, so I don't want to include emit-rtl.h there, so I removed that >>>> dumping (which was only for debugging purposes anyway, and obviously >>>> not tested in a while or I wouldn't have run into this problem to >>>> begin with :-) >>>> >>>> Bootstrapped&tested on powerpc64-unknown-linux-gnu and on >>>> x86_64-unknown-linux-gnu. OK for trunk? >>> >>> You moved get_ref_base_and_extent to tree.c - any reason for that? >> >> Yes, tree.c uses it (build_simple_mem_ref_loc) and I don't want tree.c >> to depend on tree-dfa.c. Longer-term I'd like to split tree.c and >> tree.h, and this function and the two others you mention below could >> go into e.g. tree-anal.c. >> >>> It is similar to get_inner_reference which is in expr.c and similar to >>> get_addr_base_and_unit_offset which is still in tree-dfa.c. I'd prefer >>> to have it stay where it is for this patch. >> >> OK. > > Seems to break build with graphite for me: > > /space/rguenther/src/svn/trunk/gcc/graphite-dependences.c: In function > 'graphite_legal_transform': > /space/rguenther/src/svn/trunk/gcc/graphite-dependences.c:534: > warning: implicit declaration of function 'timevar_push' > /space/rguenther/src/svn/trunk/gcc/graphite-dependences.c:534: error: > 'TV_GRAPHITE_DATA_DEPS' undeclared (first use in this function) > ... > /space/rguenther/src/svn/trunk/gcc/graphite-clast-to-gimple.c: In > function 'translate_clast_user': > /space/rguenther/src/svn/trunk/gcc/graphite-clast-to-gimple.c:1102: > error: 'TODO_update_ssa' undeclared (first use in this function) > ... > /space/rguenther/src/svn/trunk/gcc/graphite-clast-to-gimple.c:1644: > error: 'TV_GRAPHITE_CODE_GEN' undeclared (first use in this function) > ... > > /space/rguenther/src/svn/trunk/gcc/graphite-sese-to-poly.c:2341: > error: 'TODO_update_ssa' undeclared (first use in this function) > ... Grr... (/me cursing about being able to build gcc without graphite) Index: Makefile.in =================================================================== --- Makefile.in (revision 189519) +++ Makefile.in (working copy) @@ -2541,11 +2541,11 @@ graphite-blocking.o : graphite-blocking. coretypes.h dumpfile.h $(TREE_FLOW_H) $(CFGLOOP_H) $(TREE_DATA_REF_H) \ sese.h graphite-poly.h graphite-clast-to-gimple.o : graphite-clast-to-gimple.c $(CONFIG_H) \ - $(SYSTEM_H) coretypes.h dumpfile.h $(DIAGNOSTIC_CORE_H) $(TREE_FLOW_H) \ + $(SYSTEM_H) coretypes.h $(DIAGNOSTIC_CORE_H) $(TREE_FLOW_H) $(TREE_PASS_H) \ $(CFGLOOP_H) $(TREE_DATA_REF_H) sese.h \ graphite-poly.h graphite-clast-to-gimple.h graphite-dependences.o : graphite-dependences.c $(CONFIG_H) $(SYSTEM_H) \ - coretypes.h dumpfile.h $(TREE_FLOW_H) $(CFGLOOP_H) $(TREE_DATA_REF_H) \ + coretypes.h $(TREE_FLOW_H) $(TREE_PASS_H) $(CFGLOOP_H) $(TREE_DATA_REF_H) \ sese.h graphite-poly.h graphite-interchange.o : graphite-interchange.c $(CONFIG_H) $(SYSTEM_H) \ coretypes.h dumpfile.h $(TREE_FLOW_H) $(CFGLOOP_H) $(TREE_DATA_REF_H) \ @@ -2557,7 +2557,7 @@ graphite-scop-detection.o : graphite-sco coretypes.h $(TREE_FLOW_H) $(CFGLOOP_H) $(TREE_DATA_REF_H) $(TREE_PASS_H) \ sese.h graphite-poly.h graphite-scop-detection.h graphite-sese-to-poly.o : graphite-sese-to-poly.c $(CONFIG_H) \ - $(SYSTEM_H) coretypes.h dumpfile.h $(TREE_FLOW_H) $(CFGLOOP_H) \ + $(SYSTEM_H) coretypes.h $(TREE_FLOW_H) $(TREE_PASS_H) $(CFGLOOP_H) \ $(TREE_DATA_REF_H) domwalk.h sese.h graphite-poly.h \ graphite-sese-to-poly.h graphite-optimize-isl.o : graphite-optimize-isl.c $(CONFIG_H) $(SYSTEM_H) \ Index: graphite-clast-to-gimple.c =================================================================== --- graphite-clast-to-gimple.c (revision 189519) +++ graphite-clast-to-gimple.c (working copy) @@ -36,7 +36,7 @@ along with GCC; see the file COPYING3. #include "coretypes.h" #include "diagnostic-core.h" #include "tree-flow.h" -#include "dumpfile.h" +#include "tree-pass.h" #include "cfgloop.h" #include "tree-chrec.h" #include "tree-data-ref.h" Index: graphite-dependences.c =================================================================== --- graphite-dependences.c (revision 189519) +++ graphite-dependences.c (working copy) @@ -34,7 +34,7 @@ along with GCC; see the file COPYING3. #include "system.h" #include "coretypes.h" #include "tree-flow.h" -#include "dumpfile.h" +#include "tree-pass.h" #include "cfgloop.h" #include "tree-chrec.h" #include "tree-data-ref.h" Index: graphite-sese-to-poly.c =================================================================== --- graphite-sese-to-poly.c (revision 189519) +++ graphite-sese-to-poly.c (working copy) @@ -34,7 +34,7 @@ along with GCC; see the file COPYING3. #include "system.h" #include "coretypes.h" #include "tree-flow.h" -#include "dumpfile.h" +#include "tree-pass.h" #include "cfgloop.h" #include "tree-chrec.h" #include "tree-data-ref.h"