public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Eric Botcazou <ebotcazou@adacore.com>
To: Maxim Kuvyrkov <maxim@codesourcery.com>
Cc: gcc-patches@gcc.gnu.org
Subject: Re: [PATCH] Improve combining of conditionals
Date: Fri, 15 Apr 2011 12:31:00 -0000	[thread overview]
Message-ID: <201104151334.32639.ebotcazou@adacore.com> (raw)
In-Reply-To: <33F4E740-6ED2-4694-B63C-E43ED3B91461@codesourcery.com>

> The problem this patch fixes is that combine_simplify_rtx() prefers to
> return an expression (say, <xor (a) (b)>) even when a comparison is
> prefered (say, <neq (xor (a) (b)) 0>).  Expressions are not recognized as
> valid conditions of if_then_else for most targets, so combiner misses a
> potential optimization.  This patch makes combine_simplify_rtx() aware of
> the context it was invoked in, and, when appropriate, does not discourage
> it from returning a conditional.

Btw, this is very likely also valid for targets with STORE_FLAG_VALUE == -1 so 
the same IN_COND short-circuit would need to be added a few lines below in 
combine_simplify_rtx.  But this would need to be tested.  Do you happen to 
have access to such a target, e.g. m68k?

-- 
Eric Botcazou

  parent reply	other threads:[~2011-04-15 11:40 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-04-15  7:59 Maxim Kuvyrkov
2011-04-15  9:27 ` Eric Botcazou
2011-04-15 10:49   ` Steven Bosscher
2011-04-15 10:54     ` Maxim Kuvyrkov
2011-04-15 11:14     ` Eric Botcazou
2011-04-15 16:55       ` Mike Stump
2011-04-15 17:52         ` Eric Botcazou
2011-04-15 18:16           ` Mike Stump
2011-04-15 12:31 ` Eric Botcazou [this message]
2011-04-15 12:41   ` Maxim Kuvyrkov
2011-04-25 15:32     ` Maxim Kuvyrkov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=201104151334.32639.ebotcazou@adacore.com \
    --to=ebotcazou@adacore.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=maxim@codesourcery.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).