From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15287 invoked by alias); 9 May 2003 16:18:03 -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 15280 invoked from network); 9 May 2003 16:18:03 -0000 Received: from unknown (HELO vlsi1.ultra.nyu.edu) (128.122.140.213) by sources.redhat.com with SMTP; 9 May 2003 16:18:03 -0000 Received: by vlsi1.ultra.nyu.edu (4.1/1.34) id AA15829; Fri, 9 May 03 12:22:44 EDT Date: Fri, 09 May 2003 16:18:00 -0000 From: kenner@vlsi1.ultra.nyu.edu (Richard Kenner) Message-Id: <10305091622.AA15829@vlsi1.ultra.nyu.edu> To: matz@suse.de Subject: Re: An issue for the SC: horrible documentation quality of GCC Cc: gcc@gcc.gnu.org X-SW-Source: 2003-05/txt/msg00909.txt.bz2 Well, when dead code is removed this will look like: p2 <-- 100 + p3 Only if p1 is, in fact, dead. But this needs to be determined at a later point, instead of cluttering all the optimization passes with machine dependend checks. You lost me here. All of RTL and every choice within it is implicitly machine-dependent. Every cost calculation is machine-dependent. The entire RTL optimization strategy is based on making machine-dependent decisions (of course, written in machine-independent ways). CSE as we implement it is fundamentally different from gcse. For one our CSE is not any CSE but a kind of ad hoc value numbering intertwined with expression simplification. Again, you lost me. It eliminates common subexpressions. Isn't that what "cse" stands for? And I can't find a function in cse.c which does something similar (i.e. just propagating constants and copies). Well, fold_rtx, I suppose, but that's because it does everything at one time. And, as I've pointed out, it's not always better to substitute a constant for a register: sometimes, it's best to do it the other way around. I have a favorite example for this: the (non-obsolete) ROMP chip had an ABI where the return register and the first argument register were the same. It also had a conditional return insn. So if you have a function with one operand, say X, and you have: if (x == 0) return 0; What you really want to do with the insn setting the return value is to change *from* the 0 *to* the equivalent, X. That way that insn is a no-op, and you can do this as a conditional return insn. CSE gets this right because it uses the cost metric. It sounds like the code in gcse.c will get this wrong. Like I said, local_cprop* has nothing to do with gcse itself, except being run to clean up the code between the gcse iterations. Then that's all the *more* reason why it should be documented!