This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [tree-ssa] fold-const trick for gzip
On Wed, Dec 10, 2003 at 07:04:17AM -0700, Roger Sayle wrote:
> I strongly agree that constant folding transformations of COND_EXPRs
> should *also* appear in ifcvt.c, but pragmatically they really need to
> be done in (1) in "fold" of fold-const.c, (2) in "noce_process_if_block"
> in ifcvt.c, and (3) in "simplify_ternary_operation" in simplify-rtx.c.
> Each of these covers a slightly different set of cases from the other
> two, and in an optimizing compiler, we really need all three.
Well, aside from the obvious ones, (p ? 1 : 0) -> (p != 0) and
(true/false ? a : b), what do you hope to gain at the tree level?
Only at the rtl level can you determine if (x >> 31) is better
than (x < 0 ? -1 : 0) (with cmov) or (-(x < 0)) (with setcc).
r~