From: Monk Chiang <monk.chiang@sifive.com>
To: Jeff Law <jeffreyalaw@gmail.com>
Cc: Richard Biener <rguenther@suse.de>,
gcc-patches@gcc.gnu.org, apinski@marvell.com
Subject: Re: [PATCH] match: Do not select to branchless expression when target has movcc pattern [PR113095]
Date: Thu, 18 Jan 2024 11:19:58 +0800 [thread overview]
Message-ID: <CAMpi97z2_kHfqagQ4wPDsxCQ=MhY0nx3tatC++xvgoEQHsvoQQ@mail.gmail.com> (raw)
In-Reply-To: <b1532911-ae68-4003-bfe1-47351966bffc@gmail.com>
[-- Attachment #1: Type: text/plain, Size: 1378 bytes --]
Thanks for your advice!! I agree it should be fixed in the RISC-V backend
when expansion.
On Wed, Jan 17, 2024 at 10:37 PM Jeff Law <jeffreyalaw@gmail.com> wrote:
>
>
> On 1/17/24 05:14, Richard Biener wrote:
> > On Wed, 17 Jan 2024, Monk Chiang wrote:
> >
> >> This allows the backend to generate movcc instructions, if target
> >> machine has movcc pattern.
> >>
> >> branchless-cond.c needs to be updated since some target machines have
> >> conditional move instructions, and the experssion will not change to
> >> branchless expression.
> >
> > While I agree this pattern should possibly be applied during RTL
> > expansion or instruction selection on x86 which also has movcc
> > the multiplication is cheaper. So I don't think this isn't the way to
> go.
> >
> > I'd rather revert the change than trying to "fix" it this way?
> WRT reverting -- the patch in question's sole purpose was to enable
> branchless sequences for that very same code. Reverting would regress
> performance on a variety of micro-architectures. IIUC, the issue is
> that the SiFive part in question has a fusion which allows it to do the
> branchy sequence cheaply.
>
> ISTM this really needs to be addressed during expansion and most likely
> with a RISC-V target twiddle for the micro-archs which have
> short-forward-branch optimizations.
>
> jeff
>
next prev parent reply other threads:[~2024-01-18 3:20 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-01-17 9:50 Monk Chiang
2024-01-17 12:14 ` Richard Biener
2024-01-17 14:37 ` Jeff Law
2024-01-18 3:19 ` Monk Chiang [this message]
2024-01-18 3:30 ` Palmer Dabbelt
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='CAMpi97z2_kHfqagQ4wPDsxCQ=MhY0nx3tatC++xvgoEQHsvoQQ@mail.gmail.com' \
--to=monk.chiang@sifive.com \
--cc=apinski@marvell.com \
--cc=gcc-patches@gcc.gnu.org \
--cc=jeffreyalaw@gmail.com \
--cc=rguenther@suse.de \
/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).