From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11079 invoked by alias); 13 Jun 2011 12:54:31 -0000 Received: (qmail 11070 invoked by uid 22791); 13 Jun 2011 12:54:30 -0000 X-SWARE-Spam-Status: No, hits=-1.8 required=5.0 tests=AWL,BAYES_00,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from nikam.ms.mff.cuni.cz (HELO nikam.ms.mff.cuni.cz) (195.113.20.16) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 13 Jun 2011 12:54:14 +0000 Received: by nikam.ms.mff.cuni.cz (Postfix, from userid 16202) id 206569AC846; Mon, 13 Jun 2011 14:54:13 +0200 (CEST) Date: Mon, 13 Jun 2011 13:11:00 -0000 From: Jan Hubicka To: gcc-patches@gcc.gnu.org Subject: Do not stream BINFO_VIRTUALs to ltrans unit Message-ID: <20110613125412.GC11211@kam.mff.cuni.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.18 (2008-05-17) Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org X-SW-Source: 2011-06/txt/msg00971.txt.bz2 Hi, by accident I noticed that BINFO_VIRTUALs streaming is really expensive. It about doubles amount of IL and types streamed by Mozilla. One obvious optimization is to not stream into ltrans unit where it is too late to do any useful devirtualization anyway. Doing so reduces /tmp usage from 1.7GB to 1.1GB and proportionaly reduces streaming out time. Bootstrapped/regtested x86_64-linux. OK? Honza * lto-streamer-out.c (lto_output_ts_binfo_tree_pointers): Do not stream BINFO_VIRTUALS to ltrans units. Index: lto-streamer-out.c =================================================================== --- lto-streamer-out.c (revision 174985) +++ lto-streamer-out.c (working copy) @@ -1117,7 +1117,11 @@ lto_output_tree_or_ref (ob, BINFO_OFFSET (expr), ref_p); lto_output_tree_or_ref (ob, BINFO_VTABLE (expr), ref_p); - lto_output_tree_or_ref (ob, BINFO_VIRTUALS (expr), ref_p); + /* BINFO_VIRTUALS is used to drive type based devirtualizatoin. It often links + together large portions of programs making it harder to partition. Becuase + devirtualization is interesting before inlining, only, there is no real + need to ship it into ltrans partition. */ + lto_output_tree_or_ref (ob, flag_wpa ? NULL : BINFO_VIRTUALS (expr), ref_p); lto_output_tree_or_ref (ob, BINFO_VPTR_FIELD (expr), ref_p); output_uleb128 (ob, VEC_length (tree, BINFO_BASE_ACCESSES (expr)));