From: Richard Biener <richard.guenther@gmail.com>
To: "Andre Vieira (lists)" <andre.simoesdiasvieira@arm.com>
Cc: Richard Biener <rguenther@suse.de>,
Jakub Jelinek <jakub@redhat.com>,
Richard Sandiford <richard.sandiford@arm.com>,
"gcc-patches@gcc.gnu.org" <gcc-patches@gcc.gnu.org>
Subject: Re: [PATCH] Teach vectorizer to deal with bitfield accesses (was: [RFC] Teach vectorizer to deal with bitfield reads)
Date: Thu, 29 Sep 2022 09:54:53 +0200 [thread overview]
Message-ID: <CAFiYyc0BV17CGDd7C1PzEWFoCerkQhx+d+BVxP-E7KB+W9O-2w@mail.gmail.com> (raw)
In-Reply-To: <29d958e5-364f-5784-5764-e9b5d364448a@arm.com>
On Wed, Sep 28, 2022 at 7:32 PM Andre Vieira (lists) via Gcc-patches
<gcc-patches@gcc.gnu.org> wrote:
>
> Made the change and also created the ChangeLogs.
OK if bootstrap / testing succeeds.
Thanks,
Richard.
> gcc/ChangeLog:
>
> * tree-if-conv.cc (if_convertible_loop_p_1): Move ordering of
> loop bb's from here...
> (tree_if_conversion): ... to here. Also call bitfield lowering
> when appropriate.
> (version_loop_for_if_conversion): Adapt to enable loop
> versioning when we only need
> to lower bitfields.
> (ifcvt_split_critical_edges): Relax condition of expected loop
> form as this is checked earlier.
> (get_bitfield_rep): New function.
> (lower_bitfield): Likewise.
> (bitfields_to_lower_p): Likewise.
> (need_to_lower_bitfields): New global boolean.
> (need_to_ifcvt): Likewise.
> * tree-vect-data-refs.cc (vect_find_stmt_data_reference):
> Improve diagnostic message.
> * tree-vect-patterns.cc (vect_recog_temp_ssa_var): Add default
> value for last parameter.
> (vect_recog_bitfield_ref_pattern): New.
> (vect_recog_bit_insert_pattern): New.
>
> gcc/testsuite/ChangeLog:
>
> * gcc.dg/vect/vect-bitfield-read-1.c: New test.
> * gcc.dg/vect/vect-bitfield-read-2.c: New test.
> * gcc.dg/vect/vect-bitfield-read-3.c: New test.
> * gcc.dg/vect/vect-bitfield-read-4.c: New test.
> * gcc.dg/vect/vect-bitfield-read-5.c: New test.
> * gcc.dg/vect/vect-bitfield-read-6.c: New test.
> * gcc.dg/vect/vect-bitfield-write-1.c: New test.
> * gcc.dg/vect/vect-bitfield-write-2.c: New test.
> * gcc.dg/vect/vect-bitfield-write-3.c: New test.
> * gcc.dg/vect/vect-bitfield-write-4.c: New test.
> * gcc.dg/vect/vect-bitfield-write-5.c: New test.
>
> On 28/09/2022 10:43, Andre Vieira (lists) via Gcc-patches wrote:
> >
> > On 27/09/2022 13:34, Richard Biener wrote:
> >> On Mon, 26 Sep 2022, Andre Vieira (lists) wrote:
> >>
> >>> On 08/09/2022 12:51, Richard Biener wrote:
> >>>> I'm curious, why the push to redundant_ssa_names? That could use
> >>>> a comment ...
> >>> So I purposefully left a #if 0 #else #endif in there so you can see
> >>> the two
> >>> options. But the reason I used redundant_ssa_names is because ifcvt
> >>> seems to
> >>> use that as a container for all pairs of (old, new) ssa names to
> >>> replace
> >>> later. So I just piggy backed on that. I don't know if there's a
> >>> specific
> >>> reason they do the replacement at the end? Maybe some ordering
> >>> issue? Either
> >>> way both adding it to redundant_ssa_names or doing the replacement
> >>> inline work
> >>> for the bitfield lowering (or work in my testing at least).
> >> Possibly because we (in the past?) inserted/copied stuff based on
> >> predicates generated at analysis time after we decide to elide something
> >> so we need to watch for later appearing uses. But who knows ... my mind
> >> fails me here.
> >>
> >> If it works to replace uses immediately please do so. But now
> >> I wonder why we need this - the value shouldn't change so you
> >> should get away with re-using the existing SSA name for the final value?
> >
> > Yeah... good point. A quick change and minor testing seems to agree.
> > I'm sure I had a good reason to do it initially ;)
> >
> > I'll run a full-regression on this change to make sure I didn't miss
> > anything.
> >
next prev parent reply other threads:[~2022-09-29 7:55 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-07-26 10:00 [RFC] Teach vectorizer to deal with bitfield reads Andre Vieira (lists)
2022-07-27 11:37 ` Richard Biener
2022-07-29 8:57 ` Andre Vieira (lists)
2022-07-29 9:11 ` Richard Biener
2022-07-29 10:31 ` Jakub Jelinek
2022-07-29 10:52 ` Richard Biener
2022-08-01 10:21 ` Andre Vieira (lists)
2022-08-01 13:16 ` Richard Biener
2022-08-08 14:06 ` [PATCH] Teach vectorizer to deal with bitfield accesses (was: [RFC] Teach vectorizer to deal with bitfield reads) Andre Vieira (lists)
2022-08-09 14:34 ` Richard Biener
2022-08-16 10:24 ` Andre Vieira (lists)
2022-08-17 12:49 ` Richard Biener
2022-08-25 9:09 ` Andre Vieira (lists)
2022-09-08 9:07 ` Andre Vieira (lists)
2022-09-08 11:51 ` Richard Biener
2022-09-26 15:23 ` Andre Vieira (lists)
2022-09-27 12:34 ` Richard Biener
2022-09-28 9:43 ` Andre Vieira (lists)
2022-09-28 17:31 ` Andre Vieira (lists)
2022-09-29 7:54 ` Richard Biener [this message]
2022-10-07 14:20 ` Andre Vieira (lists)
2022-10-12 1:55 ` Hongtao Liu
2022-10-12 2:11 ` Hongtao Liu
2022-08-01 10:13 ` [RFC] Teach vectorizer to deal with bitfield reads Andre Vieira (lists)
2022-10-12 9:02 ` Eric Botcazou
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=CAFiYyc0BV17CGDd7C1PzEWFoCerkQhx+d+BVxP-E7KB+W9O-2w@mail.gmail.com \
--to=richard.guenther@gmail.com \
--cc=andre.simoesdiasvieira@arm.com \
--cc=gcc-patches@gcc.gnu.org \
--cc=jakub@redhat.com \
--cc=rguenther@suse.de \
--cc=richard.sandiford@arm.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).