public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "crazylht at gmail dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug target/82735] _mm256_zeroupper does not invalidate previously computed registers
Date: Fri, 07 May 2021 03:22:13 +0000	[thread overview]
Message-ID: <bug-82735-4-UwjdguurdM@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-82735-4@http.gcc.gnu.org/bugzilla/>

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82735

--- Comment #16 from Hongtao.liu <crazylht at gmail dot com> ---
(In reply to Hongtao.liu from comment #15)
> (In reply to Hongtao.liu from comment #14)
> > (In reply to Hongtao.liu from comment #12)
> > > (In reply to Jakub Jelinek from comment #10)
> > > > Last touched in PR99563.
> > > > I guess for the explicit user vzeroupper we need to add the clobbers/sets
> > > > earlier than in the vzeroupper pass, but ideally in a way that doesn't force
> > > > save/restore of registers that aren't really needed in the function.
> > > 
> > > Yes, if we want to add the clobbers/sets earlier(than CSE1), vzeroupper pass
> > > should be able to remove those unnecessary clobbers/sets.
> > 
> > Correct typo, add the clobbers/sets earlier(than RA)
> 
> I'm trying to add a post_reload splitter to add CLOBBERS of xmm to
> vzeroupper so that LRA knows vzeroupper will kill those xmm registers, then
> in pass_vzeroupper, transform those CLOBBERS to SET (xmm, xmm), it will
> benifit post_reload CSE which allow lower 128bits to cross vzeroupper, then
> in post_reload split2, drop those SETs, it's safe since there's no CSE
> between split2 and split3, problem is there's no update for data flow info
> between split2 and pro_and_epilog which mean even i manually drop those
> SETS, xmm6-xmm15 are still marked as used which causes redudant save and
> restore under 64-bit MSabi.
> 
> I'm thinking of adding a target_hook for updating df info just in the
> begenning of pass_pro_and_epilogue, the default behavior of the target_hook
> is doing nothing , and in i386 backend, df_analyse is called only under
> TARGET_AVX && cfun->machine->has_explicit_vzeroupper.

Oh, regs_ever_live isn't recomputed, that's why even i manually drop those SETs
is post_reload splitter, but xmm6 to xmm15 is still marked as live.

/* After reload, some ports add certain bits to regs_ever_live so
     this cannot be reset.  */

  parent reply	other threads:[~2021-05-07  3:22 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <bug-82735-4@http.gcc.gnu.org/bugzilla/>
2021-04-24 14:17 ` noloader at gmail dot com
2021-04-24 14:36 ` noloader at gmail dot com
2021-04-25  8:28 ` crazylht at gmail dot com
2021-04-28  9:07 ` ubizjak at gmail dot com
2021-04-28  9:13 ` ubizjak at gmail dot com
2021-04-28  9:19 ` jakub at gcc dot gnu.org
2021-04-28  9:46 ` ubizjak at gmail dot com
2021-04-28 11:08 ` crazylht at gmail dot com
2021-04-28 13:02 ` marcin.slusarz at intel dot com
2021-04-29  5:56 ` crazylht at gmail dot com
2021-05-06  7:43 ` crazylht at gmail dot com
2021-05-07  3:22 ` crazylht at gmail dot com [this message]
2021-06-07  2:25 ` cvs-commit at gcc dot gnu.org
2021-06-07  2:25 ` cvs-commit at gcc dot gnu.org
2021-06-07  2:26 ` crazylht at gmail dot com
2021-06-07 19:06 ` cvs-commit at gcc dot gnu.org
2023-06-27  6:13 ` cvs-commit at gcc dot gnu.org

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=bug-82735-4-UwjdguurdM@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@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).