From: "H.J. Lu" <hjl.tools@gmail.com>
To: Hongtao Liu <crazylht@gmail.com>
Cc: liuhongt <hongtao.liu@intel.com>, GCC Patches <gcc-patches@gcc.gnu.org>
Subject: Re: [PATCH] [i386] Replace ix86_gen_scratch_sse_rtx with gen_reg_rtx.
Date: Tue, 1 Mar 2022 14:48:24 -0800 [thread overview]
Message-ID: <CAMe9rOpkDJ5Z=Dw8XYRm2a-OdoE7onDTX2rk-h26MRZEJ9-8-g@mail.gmail.com> (raw)
In-Reply-To: <CAMe9rOoXp_ruXy5_8xtd503RJpF5xPV_c-S5N37u=3b33Rr2MQ@mail.gmail.com>
On Tue, Mar 1, 2022 at 7:06 AM H.J. Lu <hjl.tools@gmail.com> wrote:
>
> On Mon, Feb 28, 2022 at 9:36 PM Hongtao Liu <crazylht@gmail.com> wrote:
> >
> > On Tue, Mar 1, 2022 at 10:39 AM H.J. Lu via Gcc-patches
> > <gcc-patches@gcc.gnu.org> wrote:
> > >
> > > On Mon, Feb 28, 2022 at 6:26 PM H.J. Lu <hjl.tools@gmail.com> wrote:
> > > >
> > > > On Mon, Feb 28, 2022 at 6:03 PM liuhongt <hongtao.liu@intel.com> wrote:
> > > > >
> > > > > .. in ix86_expand_vector_move and
> > > > > ix86_convert_const_wide_int_to_broadcast(called by the former).
> > > > >
> > > > > ix86_expand_vector_move is called by emit_move_insn which is used by
> > > > > many pre_reload passes, ix86_gen_scratch_sse_rtx will break data flow
> > > > > when there's explict usage of xmm7/xmm15/xmm31.
> > > > >
> > > > > Bootstrapped and regtested on x86_64-linux-gnu{-m32,}
> > > > > for both w/and w/o --with-cpu=native --with-arch=native.
> > > > >
> > > > > Ok for trunk?
> > > > >
> > > > > gcc/ChangeLog:
> > > > >
> > > > > PR target/104704
> > > > > * config/i386/i386-expand.cc
> > > > > (ix86_convert_const_wide_int_to_broadcast): Replace
> > > > > ix86_gen_scratch_sse_rtx with gen_reg_rtx.
> > > > > (ix86_expand_vector_move): Ditto.
> > > > > * config/i386/sse.md (*vec_dupv4si): Add alternative $r and
> > > > > corresponding splitter after it.
> > > > >
> > > > > gcc/testsuite/ChangeLog:
> > > > >
> > > > > * gcc.target/i386/incoming-11.c: Revert r12-2665-g7f4c3943f795fd.
> > > > > * gcc.target/i386/pr100865-11b.c: Expect vmovdqa or vmovda64.
> > > > > * gcc.target/i386/pr100865-12b.c: Ditto.
> > > > > * gcc.target/i386/pr100865-8b.c: Ditto.
> > > > > * gcc.target/i386/pr100865-9b.c: Ditto.
> > > > > * gcc.target/i386/pr82941-1.c: Expect vzeroupper for ! ia32.
> > > > > * gcc.target/i386/pr82942-1.c: Ditto.
> > > > > * gcc.target/i386/pr82990-1.c: Ditto.
> > > > > * gcc.target/i386/pr82990-3.c: Ditto.
> > > > > * gcc.target/i386/pr82990-5.c: Ditto.
> > > > > ---
> > > > > gcc/config/i386/i386-expand.cc | 6 +--
> > > > > gcc/config/i386/sse.md | 41 +++++++++++++++-----
> > > > > gcc/testsuite/gcc.target/i386/incoming-11.c | 2 +-
> > > > > gcc/testsuite/gcc.target/i386/pr100865-11b.c | 2 +-
> > > > > gcc/testsuite/gcc.target/i386/pr100865-12b.c | 2 +-
> > > > > gcc/testsuite/gcc.target/i386/pr100865-8b.c | 2 +-
> > > > > gcc/testsuite/gcc.target/i386/pr100865-9b.c | 2 +-
> > > > > gcc/testsuite/gcc.target/i386/pr82941-1.c | 3 +-
> > > > > gcc/testsuite/gcc.target/i386/pr82942-1.c | 3 +-
> > > > > gcc/testsuite/gcc.target/i386/pr82990-1.c | 3 +-
> > > > > gcc/testsuite/gcc.target/i386/pr82990-3.c | 3 +-
> > > > > gcc/testsuite/gcc.target/i386/pr82990-5.c | 3 +-
> > > > > 12 files changed, 45 insertions(+), 27 deletions(-)
> > > > >
> > > > > diff --git a/gcc/config/i386/i386-expand.cc b/gcc/config/i386/i386-expand.cc
> > > > > index faa0191c6dd..75a28cdd89d 100644
> > > > > --- a/gcc/config/i386/i386-expand.cc
> > > > > +++ b/gcc/config/i386/i386-expand.cc
> > > > > @@ -257,7 +257,7 @@ ix86_convert_const_wide_int_to_broadcast (machine_mode mode, rtx op)
> > > > > machine_mode vector_mode;
> > > > > if (!mode_for_vector (broadcast_mode, nunits).exists (&vector_mode))
> > > > > gcc_unreachable ();
> > > > > - rtx target = ix86_gen_scratch_sse_rtx (vector_mode);
> > > > > + rtx target = gen_reg_rtx (vector_mode);
> > > >
> > > > I think ix86_gen_scratch_sse_rtx should check
> > > > currently_expanding_gimple_stmt == NULL
> > > > to return gen_reg_rtx (vector_mode) instead.
> > >
> > > Like this:
> > >
> > > diff --git a/gcc/config/i386/i386.cc b/gcc/config/i386/i386.cc
> > > index b2bf90576d5..6c0e4929914 100644
> > > --- a/gcc/config/i386/i386.cc
> > > +++ b/gcc/config/i386/i386.cc
> > > @@ -23786,7 +23786,7 @@ ix86_optab_supported_p (int op, machine_mode
> > > mode1, machine_mode,
> > > rtx
> > > ix86_gen_scratch_sse_rtx (machine_mode mode)
> > > {
> > > - if (TARGET_SSE && !lra_in_progress)
> > > + if (TARGET_SSE && currently_expanding_gimple_stmt)
> > > {
> > > unsigned int regno;
> > > if (TARGET_64BIT)
> > > (END)
> > Looks like it relies on PR104721.
>
> I have checked the fix for PR104721.
>
The proposed patch doesn't fix the testcase in:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104704
I am testing:
https://gitlab.com/x86-gcc/gcc/-/merge_requests/28
--
H.J.
next prev parent reply other threads:[~2022-03-01 22:49 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-03-01 2:03 liuhongt
2022-03-01 2:26 ` H.J. Lu
2022-03-01 2:38 ` H.J. Lu
2022-03-01 5:45 ` Hongtao Liu
2022-03-01 15:06 ` H.J. Lu
2022-03-01 22:48 ` H.J. Lu [this message]
2022-03-02 1:32 ` Hongtao Liu
2022-03-02 2:01 ` H.J. Lu
2022-03-01 3:01 ` Hongtao Liu
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='CAMe9rOpkDJ5Z=Dw8XYRm2a-OdoE7onDTX2rk-h26MRZEJ9-8-g@mail.gmail.com' \
--to=hjl.tools@gmail.com \
--cc=crazylht@gmail.com \
--cc=gcc-patches@gcc.gnu.org \
--cc=hongtao.liu@intel.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).