From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 21829 invoked by alias); 16 Jan 2013 14:15:31 -0000 Received: (qmail 21819 invoked by uid 22791); 16 Jan 2013 14:15:30 -0000 X-SWARE-Spam-Status: No, hits=-6.3 required=5.0 tests=AWL,BAYES_00,KHOP_RCVD_UNTRUST,RCVD_IN_DNSWL_HI,RP_MATCHES_RCVD,SPF_HELO_PASS X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 16 Jan 2013 14:15:21 +0000 Received: from int-mx12.intmail.prod.int.phx2.redhat.com (int-mx12.intmail.prod.int.phx2.redhat.com [10.5.11.25]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r0GEFKW0004910 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Wed, 16 Jan 2013 09:15:20 -0500 Received: from zalov.redhat.com (vpn1-6-50.ams2.redhat.com [10.36.6.50]) by int-mx12.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id r0GEF6k7020034 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 16 Jan 2013 09:15:13 -0500 Received: from zalov.cz (localhost [127.0.0.1]) by zalov.redhat.com (8.14.5/8.14.5) with ESMTP id r0GEF64Z007604; Wed, 16 Jan 2013 15:15:06 +0100 Received: (from jakub@localhost) by zalov.cz (8.14.5/8.14.5/Submit) id r0GEF6oK007603; Wed, 16 Jan 2013 15:15:06 +0100 Date: Wed, 16 Jan 2013 14:15:00 -0000 From: Jakub Jelinek To: Alexandre Oliva Cc: gcc-patches@gcc.gnu.org Subject: Re: fix for PR49888 var-tracking compile-time regression Message-ID: <20130116141504.GF7269@tucnak.redhat.com> Reply-To: Jakub Jelinek References: <20130116105827.GE7269@tucnak.redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) 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-01/txt/msg00853.txt.bz2 On Wed, Jan 16, 2013 at 11:25:46AM -0200, Alexandre Oliva wrote: > > Can you safely cache the canon addresses already during vt_initialize > > (when cselib_* is still processing new insns, cselib VALUEs contain > > REGs and MEMs that are flushed at the end of processing the current bb > > in vt_initialize)? > > No. AFAICT we only call the address canonicalization function after > collecting all MOps, when the cselib table is fully constructed and > cleaned up from any local information, retaining only the global > equivalences. Weird, I thought I've seen significant time spent in get_addr etc. already during vt_initialize, e.g. when looking at PR54402, but I might be wrong. --- var-tracking.c.xx 2013-01-11 09:03:01.000000000 +0100 +++ var-tracking.c 2013-01-16 15:00:39.012478547 +0100 @@ -2172,11 +2172,14 @@ drop_overlapping_mem_locs (void **slot, /* Remove from SET all VALUE bindings to MEMs that overlap with LOC. */ +static bool vt_initialize_p; + static void clobber_overlapping_mems (dataflow_set *set, rtx loc) { struct overlapping_mems coms; +gcc_assert (!vt_initialize_p); coms.set = set; coms.loc = canon_rtx (loc); coms.addr = vt_canonicalize_addr (set, XEXP (loc, 0)); @@ -9604,6 +9607,8 @@ vt_initialize (void) VTI (bb)->permp = NULL; } +vt_initialize_p = true; + if (MAY_HAVE_DEBUG_INSNS) { cselib_init (CSELIB_RECORD_MEMORY | CSELIB_PRESERVE_CONSTANTS); @@ -9861,6 +9866,7 @@ vt_initialize (void) } } +vt_initialize_p = false; hard_frame_pointer_adjustment = -1; VTI (ENTRY_BLOCK_PTR)->flooded = true; cfa_base_rtx = NULL_RTX; doesn't ICE on the few testcases I've tried. If it only runs after vt_initialize, my complain is wrong of course. > > Also, what effects (if any) does the patch have on the > > .debug_info/.debug_loc size and coverage? > > It shouldn't have any, since it's just caching results that would have > been recomputed over and over. However, there's a possibility of being > “lucky” and recording an equivalence in the cache whose path would later > be removed from a dynamic set (say, if an incoming VALUE is reset and > re-bound within a block; I'm not sure this ever actually happens). In > this case, these retained equivalences might enable alias analysis to > figure out that two memory refs do not overlap, and so one can be > retained in a dynamic equivalence list when we process a MOp that > modifies the other. Or something ;-) It shouldn't really make any > difference, just speed things up a bit. Paraphrasing Knuth, “I proved > it, but I didn't test it” ;-) Let me do a bootstrap/regtest pair (first one almost finished) to see. Jakub