From patchwork Thu Sep 27 13:18:13 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Biener X-Patchwork-Id: 187354 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 D605A2C0097 for ; Thu, 27 Sep 2012 23:21:36 +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=1349356897; h=Comment: DomainKey-Signature:Received:Received:Received:Received:Date: From:To:Subject:Message-ID:User-Agent:MIME-Version:Content-Type: Mailing-List:Precedence:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:Sender:Delivered-To; bh=juqR2f8qB22D3fmJzJ5w fqk4njk=; b=GD54ThkMbB9op32knlYMczjSuiva7pviKDoRhxasklCGe/pbr3RB oFlr2h30NyEwcJl20PC4WgiGhzBWRUFpRGRiNU+TWPqxAOAX9SpGsKk7HA/LQlo/ K6baTgaZianLklBsMqFoPp/p9wjHq2078loHpoXcThUbX7btU+gkonE= 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:Date:From:To:Subject:Message-ID:User-Agent:MIME-Version:Content-Type:Mailing-List:Precedence:List-Id:List-Unsubscribe:List-Archive:List-Post:List-Help:Sender:Delivered-To; b=r9lbp5J/AbTBncX1a1z4Vs/cKTft38yCIOvQfXp7tbb6DhDWbimkz5haYiJsC1 p4SOaUflDr4tg1VSeVMHGQMCPlB+a/V++qWejq//BgrJFZKIcziGJdUJqO1RIFf4 EsEmIq6xcB+rz/uShk53jOrVtJc27fdyXzyBMzuAe1afc=; Received: (qmail 18804 invoked by alias); 27 Sep 2012 13:21:31 -0000 Received: (qmail 18787 invoked by uid 22791); 27 Sep 2012 13:21:29 -0000 X-SWARE-Spam-Status: No, hits=-5.9 required=5.0 tests=AWL, BAYES_00, KHOP_RCVD_UNTRUST, RCVD_IN_DNSWL_HI, RCVD_IN_HOSTKARMA_W, RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from cantor2.suse.de (HELO mx2.suse.de) (195.135.220.15) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 27 Sep 2012 13:21:25 +0000 Received: from relay2.suse.de (unknown [195.135.220.254]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx2.suse.de (Postfix) with ESMTP id 81E1AA2FD7 for ; Thu, 27 Sep 2012 15:21:23 +0200 (CEST) Date: Thu, 27 Sep 2012 15:18:13 +0200 (CEST) From: Richard Guenther To: gcc-patches@gcc.gnu.org Subject: [PATCH] Shrink symtab_node_base Message-ID: User-Agent: Alpine 2.00 (LNX 1167 2008-08-23) MIME-Version: 1.0 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 The following patch shrinks symtab_node_base from 104 bytes to 88 bytes (on x86_64) by re-ordering and packing fields. Bootstrap & regtest pending. Richard. 2012-09-27 Richard Guenther * cgraph.h (symtab_node_base): Re-order and pack fields. Index: gcc/cgraph.h =================================================================== --- gcc/cgraph.h (revision 191798) +++ gcc/cgraph.h (working copy) @@ -43,14 +43,37 @@ enum symtab_type struct GTY(()) symtab_node_base { /* Type of the symbol. */ - enum symtab_type type; + ENUM_BITFIELD (symtab_type) type : 8; + + /* The symbols resolution. */ + ENUM_BITFIELD (ld_plugin_symbol_resolution) resolution : 8; + + /* Set when function has address taken. + In current implementation it imply needed flag. */ + unsigned address_taken : 1; + /* Set when variable is used from other LTRANS partition. */ + unsigned used_from_other_partition : 1; + /* Set when function is available in the other LTRANS partition. + During WPA output it is used to mark nodes that are present in + multiple partitions. */ + unsigned in_other_partition : 1; + /* Set when function is visible by other units. */ + unsigned externally_visible : 1; + /* Needed variables might become dead by optimization. This flag + forces the variable to be output even if it appears dead otherwise. */ + unsigned force_output : 1; + + /* Ordering of all symtab entries. */ + int order; + tree decl; + + /* Vectors of referring and referenced entities. */ struct ipa_ref_list ref_list; + /* Circular list of nodes in the same comdat group if non-NULL. */ symtab_node same_comdat_group; - /* Ordering of all symtab entries. */ - int order; - enum ld_plugin_symbol_resolution resolution; + /* File stream where this node is being written to. */ struct lto_file_decl_data * lto_file_data; @@ -65,21 +88,6 @@ struct GTY(()) symtab_node_base symtab_node previous_sharing_asm_name; PTR GTY ((skip)) aux; - - /* Set when function has address taken. - In current implementation it imply needed flag. */ - unsigned address_taken : 1; - /* Set when variable is used from other LTRANS partition. */ - unsigned used_from_other_partition : 1; - /* Set when function is available in the other LTRANS partition. - During WPA output it is used to mark nodes that are present in - multiple partitions. */ - unsigned in_other_partition : 1; - /* Set when function is visible by other units. */ - unsigned externally_visible : 1; - /* Needed variables might become dead by optimization. This flag - forces the variable to be output even if it appears dead otherwise. */ - unsigned force_output : 1; }; enum availability