From: Robin Dapp <rdapp.gcc@gmail.com>
To: Tamar Christina <Tamar.Christina@arm.com>,
gcc-patches <gcc-patches@gcc.gnu.org>,
Richard Biener <rguenther@suse.de>
Cc: rdapp.gcc@gmail.com
Subject: Re: [PATCH] ifcvt/vect: Emit COND_ADD for conditional scalar reduction.
Date: Thu, 5 Oct 2023 10:54:52 +0200 [thread overview]
Message-ID: <bad4c5b4-84d5-1912-aba5-9b0eb3e32d30@gmail.com> (raw)
In-Reply-To: <VI1PR08MB5325F4C648851C5A9C833E87FFCBA@VI1PR08MB5325.eurprd08.prod.outlook.com>
Hi Tamar,
> So in the
>
> if (slp_node)
> {
>
> Add something like:
>
> If (is_cond_op)
> {
> if (dump_enabled_p ())
> dump_printf_loc (MSG_MISSED_OPTIMIZATION, vect_location,
> "left fold reduction on SLP not supported.\n");
> return false;
> }
Yes, seems reasonable, added.
> The only comment I have is whether you actually need this helper function?
> It looks like all the uses of it are in cases you have, or will call conditional_internal_fn_code
> directly.
>
> e.g. in vect_transform_reduction you can replace it by
>
> bool cond_fn_p = cond_fn != ERROR_MARK;
>
> and in
>
> if (cond_fn_p (orig_code))
> orig_code = conditional_internal_fn_code (internal_fn(orig_code));
>
> just
>
> internal_fn new_fn = conditional_internal_fn_code (internal_fn(orig_code));
> if (new_fn != ERROR_MARK)
> orig_code = new_fn;
>
> which would save the repeated testing of the condition.
I see what you mean. One complication is that we want to disambiguate
(among others):
(1) code = IFN_COND_ADD, cond_fn = IFN_LAST. (new case)
(2) code = IFN_MAX, cond_fn = IFN_COND_MAX.
(3) code = IFN_SOMETHING, cond_fn = IFN_LAST.
So just checking cond_fn is not enough (even if we made
get_conditional_internal_fn (IFN_COND_ADD) return IFN_COND_ADD).
We need to know if the initial code already was an IFN_COND.
It's a bit of a mess but I didn't dare untangling. Well, actually, I
tried but made it worse ;) The cond_fn_p check seemed least
intrusive to me. Maybe you have another idea?
Regards
Robin
next prev parent reply other threads:[~2023-10-05 8:54 UTC|newest]
Thread overview: 32+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-09-20 13:51 Robin Dapp
2023-09-27 0:44 ` Tamar Christina
2023-10-04 7:54 ` Robin Dapp
2023-10-04 13:15 ` Robin Dapp
2023-10-04 15:12 ` Tamar Christina
2023-10-05 8:54 ` Robin Dapp [this message]
2023-10-05 9:02 ` Robin Dapp
2023-10-05 14:05 ` Robin Dapp
2023-10-05 14:15 ` Tamar Christina
2023-10-06 9:10 ` Richard Biener
2023-10-06 12:28 ` Robin Dapp
2023-10-06 12:30 ` Robin Dapp
2023-10-06 13:43 ` Richard Biener
2023-10-06 20:54 ` Robin Dapp
2023-10-09 8:25 ` Richard Biener
2023-10-09 12:54 ` Robin Dapp
2023-10-09 13:05 ` Richard Biener
2023-10-09 5:50 ` Richard Sandiford
2023-10-09 12:02 ` Robin Dapp
2023-10-09 14:57 ` Richard Sandiford
2023-10-11 19:15 ` Robin Dapp
2023-10-12 10:47 ` Richard Sandiford
2023-10-12 11:11 ` Richard Biener
2023-10-19 20:07 ` Robin Dapp
2023-10-23 10:53 ` Richard Biener
2023-10-24 11:11 ` Richard Sandiford
2023-10-24 19:56 ` Robin Dapp
2023-10-31 21:04 ` Richard Sandiford
2023-10-31 21:19 ` Robin Dapp
2023-11-02 7:48 ` Richard Biener
2023-09-27 11:42 ` Richard Biener
2023-11-02 23:26 ` Andrew Pinski
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=bad4c5b4-84d5-1912-aba5-9b0eb3e32d30@gmail.com \
--to=rdapp.gcc@gmail.com \
--cc=Tamar.Christina@arm.com \
--cc=gcc-patches@gcc.gnu.org \
--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).