public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Uros Bizjak <ubizjak@gmail.com>
To: Kyrill Tkachov <kyrylo.tkachov@arm.com>
Cc: "gcc-patches@gcc.gnu.org" <gcc-patches@gcc.gnu.org>,
	Jeff Law <law@redhat.com>, 	"H.J. Lu" <hjl.tools@gmail.com>
Subject: Re: [PATCH][RTL-ifcvt] Improve conditional select ops on immediates
Date: Mon, 03 Aug 2015 17:37:00 -0000	[thread overview]
Message-ID: <CAFULd4bEePWJ+dhw5p32OKx+oTuOWnw3HqVFz59o5_w_ocd-8g@mail.gmail.com> (raw)
In-Reply-To: <55BFA2DB.1040507@arm.com>

On Mon, Aug 3, 2015 at 7:20 PM, Kyrill Tkachov <kyrylo.tkachov@arm.com> wrote:

>>>>> Looking at the x86 movcc expansion code (ix86_expand_int_movcc) I
>>>>> don't think this is a good idea. In the expander, there is already
>>>>> quite some target-dependent code that goes great length to utilize sbb
>>>>> insn as much as possible, before cmove is used.
>>>>>
>>>>> IMO, as far as x86 is concerned, the best solution would be to revert
>>>>> the change. ix86_expand_int_movcc already does some tricks from your
>>>>> patch in a target-efficient way. Generic change that was introduced by
>>>>> your patch now interferes with this expansion.
>>>>
>>>> Well, technically the transformation was already there, it was just
>>>> never
>>>> reached for an x86 compilation because noce_try_cmove was tried in front
>>>> of
>>>> it
>>>> and used a target-specific expansion.
>>>> In any case, how's this proposal?
>>>> The transformation noce_try_store_flag_constants
>>>>         /* if (test) x = a; else x = b;
>>>>        =>   x = (-(test != 0) & (b - a)) + a;  */
>>>>
>>>> Is a catch-all-immediates transformation in
>>>> noce_try_store_flag_constants.
>>>> What if we moved it to noce_try_cmove and performed it only if the
>>>> target-specific
>>>> conditional move expansion there failed?
>>>>
>>>> That way we can try the x86_64-specific sequence first and still give
>>>> the
>>>> opportunity
>>>> to noce_try_store_flag_constants to perform the transformations that can
>>>> benefit targets
>>>> that don't have highly specific conditional move expanders.
>>>
>>> Yes, let's try this approach. As was found out, some targets (e.g.
>>> x86) hide lots of different target-dependent expansion strategies into
>>> movcc expander. Perhaps this fact should be documented in the comment
>>> in the generic code?
>>
>> Ok, I'll work on that approach and add a comment.
>
>
> I'm testing a patch that fix the testcases on x86_64 and does not
> harm codegen on aarch64. Feel free to file a PR and assign it to me.

PR67103 [1]

[1] https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67103

Thanks,
Uros.

  reply	other threads:[~2015-08-03 17:37 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-08-03 12:33 Uros Bizjak
2015-08-03 13:02 ` Kyrill Tkachov
2015-08-03 13:37   ` Uros Bizjak
2015-08-03 13:43     ` Kyrill Tkachov
2015-08-03 14:12       ` Kyrill Tkachov
2015-08-03 14:15       ` Uros Bizjak
2015-08-03 15:37         ` Kyrill Tkachov
2015-08-03 15:46           ` Uros Bizjak
2015-08-03 15:53             ` Kyrill Tkachov
2015-08-03 17:20               ` Kyrill Tkachov
2015-08-03 17:37                 ` Uros Bizjak [this message]
2015-08-04  8:44                   ` Kyrill Tkachov
2015-08-10  9:36                     ` Kyrill Tkachov
2015-08-10  9:43                       ` Uros Bizjak
2015-08-10  9:44                         ` Kyrill Tkachov
2015-08-12 17:52                     ` Jeff Law
2015-08-03 14:04   ` Uros Bizjak
2015-08-03 14:37     ` H.J. Lu
2015-08-03 15:50     ` Ilya Enkovich
2015-08-03 16:29       ` Jeff Law
  -- strict thread matches above, loose matches on Subject: below --
2015-07-29 14:16 Kyrill Tkachov
2015-07-29 22:46 ` Jeff Law
2015-07-30 14:30   ` Kyrill Tkachov
2015-07-31 16:16     ` Jeff Law

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=CAFULd4bEePWJ+dhw5p32OKx+oTuOWnw3HqVFz59o5_w_ocd-8g@mail.gmail.com \
    --to=ubizjak@gmail.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=hjl.tools@gmail.com \
    --cc=kyrylo.tkachov@arm.com \
    --cc=law@redhat.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).