From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 23359 invoked by alias); 9 Dec 2003 14:26:32 -0000 Mailing-List: contact gcc-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-owner@gcc.gnu.org Received: (qmail 23346 invoked from network); 9 Dec 2003 14:26:31 -0000 Received: from unknown (HELO mx2.redhat.com) (66.187.237.31) by sources.redhat.com with SMTP; 9 Dec 2003 14:26:31 -0000 Received: from int-mx2.corp.redhat.com (int-mx2.corp.redhat.com [172.16.27.26]) by mx2.redhat.com (8.11.6/8.11.6) with ESMTP id hB9E6LA03766; Tue, 9 Dec 2003 09:06:21 -0500 Received: from potter.sfbay.redhat.com (potter.sfbay.redhat.com [172.16.27.15]) by int-mx2.corp.redhat.com (8.11.6/8.11.6) with ESMTP id hB9EQNb02176; Tue, 9 Dec 2003 09:26:23 -0500 Received: from p4 (vpn50-8.rdu.redhat.com [172.16.50.8]) by potter.sfbay.redhat.com (8.11.6/8.11.6) with ESMTP id hB9EQL627952; Tue, 9 Dec 2003 06:26:21 -0800 Subject: Re: [tree-ssa] Lazy updating of stmt operands From: Andrew MacLeod To: Steven Bosscher Cc: Diego Novillo , Zdenek Dvorak , gcc mailing list In-Reply-To: <200312072241.38969.s.bosscher@student.tudelft.nl> References: <20031207161929.GA10638@atrey.karlin.mff.cuni.cz> <20031207171454.GA12827@atrey.karlin.mff.cuni.cz> <1070818186.7334.30.camel@frodo.toronto.redhat.com> <200312072241.38969.s.bosscher@student.tudelft.nl> Content-Type: text/plain Content-Transfer-Encoding: 7bit Date: Tue, 09 Dec 2003 14:30:00 -0000 Message-Id: <1070979982.17702.2610.camel@p4> Mime-Version: 1.0 X-SW-Source: 2003-12/txt/msg00577.txt.bz2 On Sun, 2003-12-07 at 16:41, Steven Bosscher wrote: > On Sunday 07 December 2003 18:29, Diego Novillo wrote: > > > > tree-dfa.c:compute_immediate_uses() > > > > > > Which needs to pass through every single statement in the program. Not > > > really terribly efficient. > > > > *shrug*, it's used by SSA-CCP. Since def-use edges are only needed by > > some passes, I don't think it would be worth our while trying to > > maintain them in get_stmt_operands. > > There are going to be more passes that need immediate uses. Even a simple > pass to kill redundant PHIs (say, after unswitching a loop) will have to go > over _all_ statements to get the immediate uses of one or two statements. It > would be really nice if there were some way to keep this information > up-to-date at all times... So use get_immidiate_uses() which does what is required on demand, and if we discover its a serious performance issue down the road, it ought to be easy enough to change. The interface is abstracted out already. since operands are cached, a pass through the IL is actually pretty cheap. Its nothing like the expense of a pass through rtl. The effort and memory required to keep this information up to date throughout all compilations would not be insignificant, and until it is demonstrated that its a win to do so, I wouldn't want to keep it around all the time. CCP uses the information, and one of the big compile time and memory savings on that pass was to optimize the immediate_uses code to only build it for SSA_NAMEs which we actually cared about. It was a significant memory hit to build it and have it around for all stmts. It would also be possible down the road, if it is an issue, to maintain the immediate uses information only for as long as it is required. Ie, get_stmt_operands could update the immediate_uses info if its present and we want to keep it up to date. Then if you have a string of optimizations that want the information, you can keep it up to date automatically. I'd wait until we measure a performance need to do this however. Andrew