From: Maxim Kuvyrkov <maxim@codesourcery.com>
To: Eric Botcazou <ebotcazou@adacore.com>
Cc: gcc-patches@gcc.gnu.org
Subject: Re: [PATCH] Improve combining of conditionals
Date: Fri, 15 Apr 2011 12:41:00 -0000 [thread overview]
Message-ID: <66F48FC0-456C-43A3-878E-0868BA3C96D2@codesourcery.com> (raw)
In-Reply-To: <201104151334.32639.ebotcazou@adacore.com>
On Apr 15, 2011, at 3:34 PM, Eric Botcazou wrote:
>> 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?
Hm, I didn't notice that one, thanks! I have access to m68k (ColdFire, tbp) and will test this change there before committing.
--
Maxim Kuvyrkov
Mentor Graphics / CodeSourcery
next prev parent reply other threads:[~2011-04-15 12:38 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
2011-04-15 12:41 ` Maxim Kuvyrkov [this message]
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=66F48FC0-456C-43A3-878E-0868BA3C96D2@codesourcery.com \
--to=maxim@codesourcery.com \
--cc=ebotcazou@adacore.com \
--cc=gcc-patches@gcc.gnu.org \
/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).