From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18762 invoked by alias); 11 Mar 2013 09:23:52 -0000 Received: (qmail 18754 invoked by uid 22791); 11 Mar 2013 09:23:52 -0000 X-SWARE-Spam-Status: No, hits=-5.0 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-wi0-f182.google.com (HELO mail-wi0-f182.google.com) (209.85.212.182) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 11 Mar 2013 09:23:46 +0000 Received: by mail-wi0-f182.google.com with SMTP id hi18so788453wib.15 for ; Mon, 11 Mar 2013 02:23:45 -0700 (PDT) MIME-Version: 1.0 X-Received: by 10.180.84.162 with SMTP id a2mr10853312wiz.14.1362993821005; Mon, 11 Mar 2013 02:23:41 -0700 (PDT) Received: by 10.194.56.100 with HTTP; Mon, 11 Mar 2013 02:23:40 -0700 (PDT) In-Reply-To: References: Date: Mon, 11 Mar 2013 09:23:00 -0000 Message-ID: Subject: Re: [patch PR middle-end/39326 - compile time and memory explosion in combine From: Richard Biener To: Steven Bosscher Cc: GCC Patches , Jakub Jelinek Content-Type: text/plain; charset=ISO-8859-1 X-IsSubscribed: yes 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: 2013-03/txt/msg00395.txt.bz2 On Sat, Mar 9, 2013 at 11:23 PM, Steven Bosscher wrote: > Hello, > > The attached patch fixes one of the (at least) three scalability > problems reported in PR middle-end/39326. This problem is that combine > takes forever and increases the memory footprint from ~650MB to >7GB. > The cause is DSE creating a lot of new registers in replace_read, and > those registers are not copy-prop'd out between dse1 and combine. The > result is many overlapping live ranges and single-set-single-use > registers that combine is made to work on. > > The fix is to just not create so many new registers in DSE in the > first place. It is wasteful and unnecessary if an existing register > can be re-used. > > With this patch, for the test case of the PR the combine time in > combine goes down from ~350s to ~4.5s, and the memory footprint > explosion is avoided. For my set of cc1-i files this also helps reduce > compile time a modest amount, especially for the larger files of > course. > > Bootstrapped&tested on {x86_64,powerpc64}-unknown-linux-gnu. > OK for trunk? Not sure on the patch details - but in general I wonder why _DSE_ performs full redundancy elimination at all ... which replace_read seems to be. Anyway, for this one I'd say we wait for stage1 and consider backporting for 4.8.1 given we want to do a 4.8 RC1 soon. Thanks, Richard. > Ciao! > Steven > > > PR middle-end/39326 > * dse.c (replace_read): If the stored value is a pseudo-register > that is set only once, re-use it to replace the load instead of > creating a new register.