From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 31391 invoked by alias); 9 May 2003 22:24:00 -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 31367 invoked from network); 9 May 2003 22:24:00 -0000 Received: from unknown (HELO atrey.karlin.mff.cuni.cz) (195.113.31.123) by sources.redhat.com with SMTP; 9 May 2003 22:24:00 -0000 Received: by atrey.karlin.mff.cuni.cz (Postfix, from userid 4018) id 802B84FE1E; Sat, 10 May 2003 00:23:59 +0200 (CEST) Date: Fri, 09 May 2003 22:24:00 -0000 From: Jan Hubicka To: Richard Kenner Cc: jh@suse.cz, gcc@gcc.gnu.org Subject: Re: An issue for the SC: horrible documentation quality of GCC Message-ID: <20030509222359.GD11041@atrey.karlin.mff.cuni.cz> References: <10305092222.AA19835@vlsi1.ultra.nyu.edu> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <10305092222.AA19835@vlsi1.ultra.nyu.edu> User-Agent: Mutt/1.3.28i X-SW-Source: 2003-05/txt/msg00959.txt.bz2 > No, the CSE algorithm as usually defined in the books would simplify > for instance: > (set (reg a) (plus b c)) > (use a) > (set (reg a) (something else)) > (set (reg b) (plus b c)) > > But our alrgorithm won't, but it would do different things CSE described > in the books won't, so it is not CSE as rest of the world know it and > naming it CSE is missleading. > > Well I'm not sure what the "usual" cse algorithm would simplify this into > since the result of the addition is no longer around, but defining an > algorithm by what it would do in an obscure case seems odd to me. The definition I find in all three books on compilers I have the algorithm is documented as maintaining hash of available expressions and when there is a hit it inserts a copy instruction at one side and use on the other. This is what GCSE does. It is not too odd situation, it is what you usually get after the (manual) loop unrolling when same variables are reused many times for no good reason. The global optimizers are usually described as group of three main passes: copy propagation, constant propagation and CSE (PRE), each having local and global pass. This is what I would like to slowly converge into. We do have all the main bits in place, just they are twisted. Honza