From: Richard Biener <richard.guenther@gmail.com>
To: Zhongyunde <zhongyunde@huawei.com>
Cc: Andrew Pinski <pinskia@gcc.gnu.org>,
"zhong_1985624@163.com" <zhong_1985624@163.com>,
"Weiwei (weiwei, Compiler)" <weiwei64@huawei.com>,
"hongtao.liu@intel.com" <hongtao.liu@intel.com>,
"gcc-patches@gcc.gnu.org" <gcc-patches@gcc.gnu.org>,
"Zhangwen(Esan)" <zwzhangwen.zhang@huawei.com>
Subject: Re: [PATCH] [PHIOPT] Add A ? B + CST : B match and simplify optimizations
Date: Tue, 8 Nov 2022 15:58:34 +0100 [thread overview]
Message-ID: <CAFiYyc3+LxvnVcMOsCXZ4QFDOstRS=ji1L3YG70ugwC4foNfoA@mail.gmail.com> (raw)
In-Reply-To: <7b6d19fcef784a019c89e77c9917c5a8@huawei.com>
On Sat, Nov 5, 2022 at 10:03 AM Zhongyunde via Gcc-patches
<gcc-patches@gcc.gnu.org> wrote:
>
>
> > -----Original Message-----
> > From: Andrew Pinski [mailto:pinskia@gcc.gnu.org]
> > Sent: Saturday, November 5, 2022 2:34 PM
> > To: Zhongyunde <zhongyunde@huawei.com>
> > Cc: hongtao.liu@intel.com; gcc-patches@gcc.gnu.org; Zhangwen(Esan)
> > <zwzhangwen.zhang@huawei.com>; Weiwei (weiwei, Compiler)
> > <weiwei64@huawei.com>; zhong_1985624@163.com
> > Subject: Re: [PATCH] [PHIOPT] Add A ? B + CST : B match and simplify
> > optimizations
> >
> > On Fri, Nov 4, 2022 at 11:17 PM Zhongyunde <zhongyunde@huawei.com>
> > wrote:
> > >
> > > hi,
> > > This patch is try to fix the issue
> > > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107190,
> > > would you like to give me some suggestion, thanks.
> >
> > This seems like a "simplified" version of
> > https://gcc.gnu.org/pipermail/gcc-patches/2021-November/584411.html
> > which just handles power of 2 constants where we know the cond will be
> > removed.
> > We could do even more "simplified" of 1 if needed really.
> > What is the IR before PHI-OPT? Is it just + 1?
>
> Thanks for your attention. It is + 4294967296 before PHI-OPT (See detail https://gcc.godbolt.org/z/6zEc6ja1z)
> So we should keep matching the power of 2 constants ?
>
> > Also your pattern can be simplified to use integer_pow2p in the match part
> > instead of INTEGER_CST.
> >
> Apply your comment, thanks
How does the patch fix the mentioned bug? match.pd patterns should make things
"simpler" but x + (a << C') isn't simpler than a ? x + C : x. It
looks you are targeting
PHI-OPT here, so maybe instead extend value_replacement to handle this case,
it does look similar to the case with neutral/absorbing element there?
Richard.
>
> > Thanks,
> > Andrew
>
>
next prev parent reply other threads:[~2022-11-08 14:58 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-09-05 21:44 [PATCH] riscv: implement TARGET_MODE_REP_EXTENDED Philipp Tomsich
2022-09-06 11:39 ` Alexander Monakov
2022-09-16 23:48 ` Jeff Law
2022-09-17 7:59 ` Palmer Dabbelt
2022-11-04 23:00 ` Philipp Tomsich
2022-11-05 6:16 ` [PATCH] [PHIOPT] Add A ? B + CST : B match and simplify optimizations Zhongyunde
2022-11-05 6:34 ` Andrew Pinski
2022-11-05 9:03 ` Zhongyunde
2022-11-08 14:58 ` Richard Biener [this message]
2022-11-08 15:51 ` 钟云德
2022-11-09 8:00 ` Richard Biener
2022-11-07 13:55 ` [PATCH] riscv: implement TARGET_MODE_REP_EXTENDED Alexander Monakov
2022-11-08 23:45 ` Philipp Tomsich
2022-11-09 17:21 ` Alexander Monakov
2022-11-20 16:09 ` Jeff Law
2022-11-21 13:49 ` Alexander Monakov
2022-11-21 14:56 ` Jeff Law
2022-11-21 15:33 ` Alexander Monakov
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='CAFiYyc3+LxvnVcMOsCXZ4QFDOstRS=ji1L3YG70ugwC4foNfoA@mail.gmail.com' \
--to=richard.guenther@gmail.com \
--cc=gcc-patches@gcc.gnu.org \
--cc=hongtao.liu@intel.com \
--cc=pinskia@gcc.gnu.org \
--cc=weiwei64@huawei.com \
--cc=zhong_1985624@163.com \
--cc=zhongyunde@huawei.com \
--cc=zwzhangwen.zhang@huawei.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).