From: Uros Bizjak <ubizjak@gmail.com>
To: Roger Sayle <roger@nextmovesoftware.com>
Cc: GCC Patches <gcc-patches@gcc.gnu.org>, "H.J. Lu" <hjl.tools@gmail.com>
Subject: Re: [x86_64 PATCH take #2] PR target/106450: Tweak timode_remove_non_convertible_regs.
Date: Sun, 31 Jul 2022 19:23:24 +0200 [thread overview]
Message-ID: <CAFULd4Z7N__qyd49Oc-A=2AsOV2+XXqzU=wX4LN3XS16RBGyKA@mail.gmail.com> (raw)
In-Reply-To: <040c01d8a3f8$a6056d20$f2104760$@nextmovesoftware.com>
On Sat, Jul 30, 2022 at 11:42 AM Roger Sayle <roger@nextmovesoftware.com> wrote:
>
>
> Many thanks to H.J. for pointing out a better idiom for traversing
> the USEs (and also DEFs) of TImode registers in an instruction.
>
> This revised patched has been tested on x86_64-pc-linux-gnu with
> make bootstrap and make -k check, both with and without
> --target_board=unix{-m32}, with no new failures. Ok for mainline?
>
>
> 2022-07-30 Roger Sayle <roger@nextmovesoftware.com>
> H.J. Lu <hjl.tools@gmail.com>
>
> gcc/ChangeLog
> PR target/106450
> * config/i386/i386-features.cc (timode_check_non_convertible_regs):
> Do nothing if REGNO is set in the REGS bitmap, or is a hard reg.
> (timode_remove_non_convertible_regs): Update comment.
> Call timode_check_non_convertible_reg on all TImode register
> DEFs and USEs in each instruction.
>
> gcc/testsuite/ChangeLog
> PR target/106450
> * gcc.target/i386/pr106450.c: New test case.
LGTM.
Thanks,
Uros.
>
>
> Thanks (H.J. and Uros),
> Roger
> --
>
> > -----Original Message-----
> > From: H.J. Lu <hjl.tools@gmail.com>
> > Sent: 28 July 2022 17:55
> > To: Roger Sayle <roger@nextmovesoftware.com>
> > Cc: GCC Patches <gcc-patches@gcc.gnu.org>
> > Subject: Re: [x86_64 PATCH] PR target/106450: Tweak
> > timode_remove_non_convertible_regs.
> >
> > On Thu, Jul 28, 2022 at 9:43 AM Roger Sayle <roger@nextmovesoftware.com>
> > wrote:
> > >
> > > This patch resolves PR target/106450, some more fall-out from more
> > > aggressive TImode scalar-to-vector (STV) optimizations. I continue to
> > > be caught out by how far TImode STV has diverged from DImode/SImode
> > > STV, and therefore requires additional (unexpected) tweaking. Many
> > > thanks to H.J. Lu for pointing out timode_remove_non_convertible_regs
> > > needs to be extended to handle XOR (and other new operations).
> > >
> > > Unhelpfully the comment above this function states that it's the
> > > TImode version of "remove_non_convertible_regs", which doesn't exist
> > > anymore, so I've resurrected an explanatory comment from the git history.
> > > By refactoring the checks for hard regs and already "marked" regs into
> > > timode_check_non_convertible_regs itself, all its callers are
> > > simplified. This patch then uses GET_RTX_CLASS to generically handle
> > > unary and binary operations, calling timode_check_non_convertible_regs
> > > on each TImode register operand in the single_set's SET_SRC.
> > >
> > > This patch has been tested on x86_64-pc-linux-gnu with make bootstrap
> > > and make -k check, both with and without --target_board=unix{-m32},
> > > with no new failures. Ok for mainline?
> > >
> > >
> > > 2022-07-28 Roger Sayle <roger@nextmovesoftware.com>
> > >
> > > gcc/ChangeLog
> > > PR target/106450
> > > * config/i386/i386-features.cc (timode_check_non_convertible_regs):
> > > Do nothing if REGNO is set in the REGS bitmap, or is a hard reg.
> > > (timode_remove_non_convertible_regs): Update comment.
> > > Call timode_check_non_convertible_regs on all register operands
> > > of supported (binary and unary) operations.
> >
> > Should we use
> >
> > df_ref ref;
> > FOR_EACH_INSN_USE (ref, insn)
> > if (!DF_REF_REG_MEM_P (ref))
> > timode_check_non_convertible_regs (candidates, regs,
> > DF_REF_REGNO (ref));
> >
> > to check each use?
> >
> > > gcc/testsuite/ChangeLog
> > > PR target/106450
> > > * gcc.target/i386/pr106450.c: New test case.
> > >
> > >
> > > Thanks in advance,
> > > Roger
> > > --
> > --
> > H.J.
prev parent reply other threads:[~2022-07-31 17:23 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-07-28 16:43 [x86_64 PATCH] " Roger Sayle
2022-07-28 16:55 ` H.J. Lu
2022-07-30 9:42 ` [x86_64 PATCH take #2] " Roger Sayle
2022-07-31 17:23 ` Uros Bizjak [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='CAFULd4Z7N__qyd49Oc-A=2AsOV2+XXqzU=wX4LN3XS16RBGyKA@mail.gmail.com' \
--to=ubizjak@gmail.com \
--cc=gcc-patches@gcc.gnu.org \
--cc=hjl.tools@gmail.com \
--cc=roger@nextmovesoftware.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).