From: Jeff Law <jeffreyalaw@gmail.com>
To: gcc-patches@gcc.gnu.org
Subject: Re: [PATCH] middle-end: Add MULT_EXPR recognition for cond scalar reduction
Date: Wed, 31 Aug 2022 10:08:35 -0600 [thread overview]
Message-ID: <c00b1e10-26b1-7174-74ef-dc29ae19c5e5@gmail.com> (raw)
In-Reply-To: <DM4PR11MB5487C73F15F6205425B57CE3EC729@DM4PR11MB5487.namprd11.prod.outlook.com>
On 8/25/2022 3:39 AM, Kong, Lingling via Gcc-patches wrote:
> Hi,
>
> The conditional mult reduction cannot be recognized with current GCC. The following loop cannot be vectorized.
> Now add MULT_EXPR recognition for conditional scalar reduction.
>
> float summa(int n, float *arg1, float *arg2)
> {
> int i;
> float res1 = 1.0;
> for(i = 0; i < n; i++) {
> if(arg2[i])
> res1 *= arg1[i];
> }
> return res1;
> }
>
> gcc/ChangeLog:
>
> * tree-if-conv.cc (is_cond_scalar_reduction): Add MULT_EXPR
> recognition.
>
> gcc/testsuite/ChangeLog:
>
> * gcc.dg/tree-ssa/gen-vect-34.c: New test.
> * gcc.dg/vect/vect-ifcvt-18.c: New test.
OK
jeff
prev parent reply other threads:[~2022-08-31 16:08 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-08-25 9:39 Kong, Lingling
2022-08-25 9:39 ` Kong, Lingling
2022-08-31 7:14 ` Kong, Lingling
2022-08-31 16:08 ` Jeff Law [this message]
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=c00b1e10-26b1-7174-74ef-dc29ae19c5e5@gmail.com \
--to=jeffreyalaw@gmail.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).