From patchwork Tue Jul 7 13:43:03 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew MacLeod X-Patchwork-Id: 492265 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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id EF6FE1402B3 for ; Tue, 7 Jul 2015 23:43:16 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b=Rmnsjmvm; dkim-atps=neutral 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=cpgNbrmw0DOw8SKse EfJa3N71bRk26NEj6OhLAnwGYOje9DoPD8Z7Z2/SnUKXgGX9uXzMp3M5sc1xpY9V yZeAiBf/Le3V2RJQWAGqAbrnhEOvzidJTJ/3IJd9v0ROLrD9Aw/6ptt9eqjRX3Xr jj9kAo3VIRL/xDH5CDDQ7Q4+WY= 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=Odw9K4C7n9mwIdLEx1Ma4cM zq+E=; b=RmnsjmvmmpmebVKIRfz7AHB7Zo3Zpn+LFN60QYLaBlkr+6xyHAVvIBS 6cIPUatUTLzthXowWL7a21LwhU1sFVumwvG7Z2bL/CHty4n26nglU3y2CzYWZHE/ cKkUqF6mVRy5qERn2sQbwMI3K+GgFrw5wl1bcOZ9lVlmlRqTFt94= Received: (qmail 68162 invoked by alias); 7 Jul 2015 13:43:08 -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 68151 invoked by uid 89); 7 Jul 2015 13:43:08 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-0.9 required=5.0 tests=AWL, BAYES_50, KAM_ASCII_DIVIDERS, KAM_LAZY_DOMAIN_SECURITY, RP_MATCHES_RCVD, SPF_HELO_PASS autolearn=no version=3.3.2 X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Tue, 07 Jul 2015 13:43:06 +0000 Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) by mx1.redhat.com (Postfix) with ESMTPS id EEE08B0CEA for ; Tue, 7 Jul 2015 13:43:04 +0000 (UTC) Received: from [10.10.63.37] (vpn-63-37.rdu2.redhat.com [10.10.63.37]) by int-mx13.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id t67Dh31e024969 for ; Tue, 7 Jul 2015 09:43:04 -0400 Message-ID: <559BD767.6010401@redhat.com> Date: Tue, 07 Jul 2015 09:43:03 -0400 From: Andrew MacLeod User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.7.0 MIME-Version: 1.0 To: gcc-patches@gcc.gnu.org Subject: [patch 1/9] header additions and aggregators References: <559BD6B3.2080207@redhat.com> In-Reply-To: <559BD6B3.2080207@redhat.com> X-IsSubscribed: yes This patch implements most of the core concepts described in my previous email (https://gcc.gnu.org/ml/gcc-patches/2015-06/msg01846.html) It goes into detail of the analysis which resulted in this layout. Most of the unnecessary prerequisites have been removed, so we can start introducing back some of the required files. The changes in this patch: * symtab.h is required for tree-core.h to compile, so include it. * rtl.h does not require flagfs.h, but it does need hard-reg-set.h, and it turns out that any build files which need rtl.h actually have hard-reg-set.h available... so we can simply include it there. Furthermore, now that hard-reg-set.h is being included, all the conditional compilation code on HARD_CONST can also be removed. This removes a subtle ordering that you needed to make sure hard-reg-set.h was included before rtl.h, or certain routines didn't appear to be available. * regs.h includes both hard-reg-set.h and rtl.h. Turns out 153 of the 155 files which include regs.h also included rtl.h already... so simple remove the includes. * cfg.h requires dominance to compile, so include it. * gimple.h requires tree-ssa-alias.h and gimple-expr.h to compile, so include them * introduce backend.h which includes the files most frequently required by libbackend.a objects. they are tm.h, function.h, bitmap.h, sbitmap.h, predict.h, basic-block.h, and cfg.h gimple-ssa.h does not need tree-hasher.h., so remove it. * Introduce ssa.h as an aggregator for commonly needs ssa files. I originally thought I could use tree-ssa-operands.h, but alas, there are ordering issues where many of the headers require the contents of tree-ssa-operands.h. So I'd either have to put all these includes at the bottom of the file, or create a new file. I think a new file is a better solution. This patch actually compiles as is, but there are a number of followup manipulations in the final source update. For each source file, any includes which occur in one of these files are removed, avoiding duplicates. In the case of backend.h and ssa.h, any backend file which used 3 or more of the aggregated includes are replaced with the aggregator. Further aggregations may be done for front end and other components after the include reduction is eventually performed. Bootstraps from scratch on x86_64-unknown-linux-gnu with no new regressions. Also compiles all the files in config-list.mk. Andrew * tree-core.h: Include symtab.h. * rtl.h: Include hard-reg-set.h but not flags.h. (HARD_CONST): Remove condition compilation involving HARD_CONST since hard-reg-set.h is always included. * regs.h: Don't include hard-reg-set.h or rtl.h. * cfg.h: Include dominance.h. * gimple.h: Include tree-ssa-alias.h and gimple-expr.h. * backend.h: New. Aggregate commonly used backend header files. * gimple-ssa.h: Don't include tree-hasher.h. * ssa.h: New. Aggregate commonly used SSA header files. Index: tree-core.h =================================================================== *** tree-core.h (revision 224988) --- tree-core.h (working copy) *************** along with GCC; see the file COPYING3. *** 20,25 **** --- 20,27 ---- #ifndef GCC_TREE_CORE_H #define GCC_TREE_CORE_H + #include "symtab.h" + /* This file contains all the data structures that define the 'tree' type. There are no accessor macros nor functions in this file. Only the basic data structures, extern declarations and type definitions. */ Index: rtl.h =================================================================== *** rtl.h (revision 224988) --- rtl.h (working copy) *************** along with GCC; see the file COPYING3. *** 38,44 **** #include "is-a.h" #endif /* GENERATOR_FILE */ ! #include "flags.h" /* Value used by some passes to "recognize" noop moves as valid instructions. */ --- 38,44 ---- #include "is-a.h" #endif /* GENERATOR_FILE */ ! #include "hard-reg-set.h" /* Value used by some passes to "recognize" noop moves as valid instructions. */ *************** extern bool val_signbit_known_clear_p (m *** 2880,2888 **** /* In reginfo.c */ extern machine_mode choose_hard_reg_mode (unsigned int, unsigned int, bool); - #ifdef HARD_CONST extern const HARD_REG_SET &simplifiable_subregs (const subreg_shape &); - #endif /* In emit-rtl.c */ extern rtx set_for_reg_notes (rtx); --- 2880,2886 ---- *************** extern int reg_overlap_mentioned_p (cons *** 2939,2948 **** extern const_rtx set_of (const_rtx, const_rtx); extern void record_hard_reg_sets (rtx, const_rtx, void *); extern void record_hard_reg_uses (rtx *, void *); - #ifdef HARD_CONST extern void find_all_hard_regs (const_rtx, HARD_REG_SET *); extern void find_all_hard_reg_sets (const rtx_insn *, HARD_REG_SET *, bool); - #endif extern void note_stores (const_rtx, void (*) (rtx, const_rtx, void *), void *); extern void note_uses (rtx *, void (*) (rtx *, void *), void *); extern int dead_or_set_p (const_rtx, const_rtx); --- 2937,2944 ---- *************** extern bool can_assign_to_reg_without_cl *** 3572,3580 **** extern rtx fis_get_condition (rtx_insn *); /* In ira.c */ - #ifdef HARD_CONST extern HARD_REG_SET eliminable_regset; - #endif extern void mark_elimination (int, int); /* In reginfo.c */ --- 3568,3574 ---- *************** extern void init_reg_sets (void); *** 3590,3598 **** extern void regclass (rtx, int); extern void reg_scan (rtx_insn *, unsigned int); extern void fix_register (const char *, int, int); - #ifdef HARD_CONST extern const HARD_REG_SET *valid_mode_changes_for_regno (unsigned int); - #endif /* In reload1.c */ extern int function_invariant_p (const_rtx); --- 3584,3590 ---- *************** extern void _fatal_insn (const char *, c *** 3709,3715 **** /* reginfo.c */ extern tree GTY(()) global_regs_decl[FIRST_PSEUDO_REGISTER]; - #ifdef HARD_CONST /* Information about the function that is propagated by the RTL backend. Available only for functions that has been already assembled. */ --- 3701,3706 ---- *************** struct GTY(()) cgraph_rtl_info { *** 3723,3729 **** /* Set if function_used_regs is valid. */ unsigned function_used_regs_valid: 1; }; - #endif #endif /* ! GCC_RTL_H */ --- 3714,3719 ---- Index: regs.h =================================================================== *** regs.h (revision 225452) --- regs.h (working copy) *************** along with GCC; see the file COPYING3. *** 20,28 **** #ifndef GCC_REGS_H #define GCC_REGS_H - #include "hard-reg-set.h" - #include "rtl.h" - #define REG_BYTES(R) mode_size[(int) GET_MODE (R)] /* When you only have the mode of a pseudo register before it has a hard --- 20,25 ---- Index: cfg.h =================================================================== *** cfg.h (revision 224988) --- cfg.h (working copy) *************** along with GCC; see the file COPYING3. *** 20,25 **** --- 20,27 ---- #ifndef GCC_CFG_H #define GCC_CFG_H + #include "dominance.h" + /* What sort of profiling information we have. */ enum profile_status_d { Index: gimple.h =================================================================== *** gimple.h (revision 224989) --- gimple.h (working copy) *************** along with GCC; see the file COPYING3. *** 22,27 **** --- 22,30 ---- #ifndef GCC_GIMPLE_H #define GCC_GIMPLE_H + #include "tree-ssa-alias.h" + #include "gimple-expr.h" + typedef gimple gimple_seq_node; enum gimple_code { Index: backend.h =================================================================== *** backend.h (revision 0) --- backend.h (working copy) *************** *** 0 **** --- 1,33 ---- + /* Common Backend requirements. + + Copyright (C) 2015 Free Software Foundation, Inc. + Contributed by Andrew MacLeod + + This file is part of GCC. + + GCC is free software; you can redistribute it and/or modify it under + the terms of the GNU General Public License as published by the Free + Software Foundation; either version 3, or (at your option) any later + version. + + GCC is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + for more details. + + You should have received a copy of the GNU General Public License + along with GCC; see the file COPYING3. If not see + . */ + + #ifndef GCC_BACKEND_H + #define GCC_BACKEND_H + + #include "tm.h" + #include "function.h" + #include "bitmap.h" + #include "sbitmap.h" + #include "predict.h" + #include "basic-block.h" + #include "cfg.h" + + #endif /*GCC_BACKEND_H */ Index: gimple-ssa.h =================================================================== *** gimple-ssa.h (revision 224988) --- gimple-ssa.h (working copy) *************** along with GCC; see the file COPYING3. *** 21,27 **** #ifndef GCC_GIMPLE_SSA_H #define GCC_GIMPLE_SSA_H - #include "tree-hasher.h" #include "tree-ssa-operands.h" /* This structure is used to map a gimple statement to a label, --- 21,26 ---- Index: ssa.h =================================================================== *** ssa.h (revision 0) --- ssa.h (working copy) *************** *** 0 **** --- 1,29 ---- + /* Common SSA files + Copyright (C) 2015 Free Software Foundation, Inc. + + This file is part of GCC. + + GCC is free software; you can redistribute it and/or modify it under + the terms of the GNU General Public License as published by the Free + Software Foundation; either version 3, or (at your option) any later + version. + + GCC is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + for more details. + + You should have received a copy of the GNU General Public License + along with GCC; see the file COPYING3. If not see + . */ + + #ifndef GCC_SSA_H + #define GCC_SSA_H + + #include "stringpool.h" + #include "gimple-ssa.h" + #include "tree-ssanames.h" + #include "tree-phinodes.h" + #include "ssa-iterators.h" + + #endif /* GCC_SSA_H */