public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "liuhongt at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug target/112891] [10/11/12/13/14 Regression] Missing vzeroupper insert.
Date: Thu, 07 Dec 2023 06:13:50 +0000	[thread overview]
Message-ID: <bug-112891-4-XagBa0PdFY@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-112891-4@http.gcc.gnu.org/bugzilla/>

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

--- Comment #3 from Hongtao Liu <liuhongt at gcc dot gnu.org> ---
(In reply to Hongtao Liu from comment #2)
> (In reply to Hongtao Liu from comment #1)
> > Aaused by r10-3477-g2a2e3a0dfcbe08, Can be fixed by revert the patch.
> > 
> > --- a/gcc/config/i386/i386.cc
> > +++ b/gcc/config/i386/i386.cc
> > @@ -15032,14 +15032,7 @@ ix86_avx_u128_mode_needed (rtx_insn *insn)
> >        if (avx_upper_reg_found)
> >         return AVX_U128_DIRTY;
> > 
> > -      /* If the function is known to preserve some SSE registers,
> > -        RA and previous passes can legitimately rely on that for
> > -        modes wider than 256 bits.  It's only safe to issue a
> > -        vzeroupper if all SSE registers are clobbered.  */
> > -      const function_abi &abi = insn_callee_abi (insn);
> > -      if (vzeroupper_pattern (PATTERN (insn), VOIDmode)
> > -         || !hard_reg_set_subset_p (reg_class_contents[SSE_REGS],
> > -                                    abi.mode_clobbers (V4DImode)))
> > +      if (vzeroupper_pattern (PATTERN (insn), VOIDmode))
> >         return AVX_U128_ANY;
> > 
> >        return AVX_U128_CLEAN;
> Remove this regressed many testcases
> 
> So it looks like we need to handle ix86_avx_u128_mode_after 
> 
> --- a/gcc/config/i386/i386.cc
> +++ b/gcc/config/i386/i386.cc
> @@ -15177,7 +15177,14 @@ ix86_avx_u128_mode_after (int mode, rtx_insn *insn)
>        bool avx_upper_reg_found = false;
>        note_stores (insn, ix86_check_avx_upper_stores, &avx_upper_reg_found);
> 
> -      return avx_upper_reg_found ? AVX_U128_DIRTY : AVX_U128_CLEAN;
> +      if (avx_upper_reg_found)
> +       return AVX_U128_DIRTY;
> +
> +      const function_abi &abi = insn_callee_abi (insn);
> +      if (!hard_reg_set_subset_p (reg_class_contents[SSE_REGS],
> +                                 abi.mode_clobbers (V4DImode)))
> +       return AVX_U128_ANY;
> +      return  AVX_U128_CLEAN;
>      }

Also for sibcall, we should return AVX_U128_CLEAN for
ix86_avx_u128_mode_needed.

  parent reply	other threads:[~2023-12-07  6:13 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-07  0:59 [Bug target/112891] New: " liuhongt at gcc dot gnu.org
2023-12-07  1:10 ` [Bug target/112891] " liuhongt at gcc dot gnu.org
2023-12-07  5:04 ` liuhongt at gcc dot gnu.org
2023-12-07  6:13 ` liuhongt at gcc dot gnu.org [this message]
2023-12-07  8:18 ` [Bug target/112891] [11/12/13/14 " rguenth at gcc dot gnu.org
2023-12-07 17:00 ` rsandifo at gcc dot gnu.org
2023-12-12  5:24 ` cvs-commit at gcc dot gnu.org
2023-12-12 10:48 ` cvs-commit at gcc dot gnu.org
2023-12-12 10:48 ` cvs-commit at gcc dot gnu.org
2023-12-12 10:49 ` cvs-commit at gcc dot gnu.org
2023-12-12 10:50 ` liuhongt 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-112891-4-XagBa0PdFY@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).