public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "linkw at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug target/104015] [12 regression] gcc.dg/vect/slp-perm-9.c fails on power 9 (only)
Date: Fri, 14 Jan 2022 06:33:01 +0000	[thread overview]
Message-ID: <bug-104015-4-4bzyo8ghNi@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-104015-4@http.gcc.gnu.org/bugzilla/>

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

Kewen Lin <linkw at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |ASSIGNED
                 CC|                            |rguenth at gcc dot gnu.org,
                   |                            |rsandifo at gcc dot gnu.org
           Assignee|unassigned at gcc dot gnu.org      |linkw at gcc dot gnu.org

--- Comment #2 from Kewen Lin <linkw at gcc dot gnu.org> ---
With further investigation, this isn't duplicated. Now we have the function
partial_vectors_supported_p to get boolean supports_partial_vectors.

on rs6000, it's:

bool
partial_vectors_supported_p (void)
{
  return HAVE_len_load_v16qi || HAVE_len_store_v16qi;
}

#define HAVE_len_load_v16qi (TARGET_P9_VECTOR && TARGET_64BIT)
#define HAVE_len_store_v16qi (TARGET_P9_VECTOR && TARGET_64BIT)

The above optabs are supported from Power9 already.

However, we only enable it from Power10 due to known performance issue on
Power9.

      /* The lxvl/stxvl instructions don't perform well before Power10.  */
      if (TARGET_POWER10)
        SET_OPTION_IF_UNSET (&global_options, &global_options_set,
                             param_vect_partial_vector_usage, 1);
      else
        SET_OPTION_IF_UNSET (&global_options, &global_options_set,
                             param_vect_partial_vector_usage, 0);

So checking optab supports look not robust.

I had a check with the below fix, it works:

diff --git a/gcc/tree-vect-loop.c b/gcc/tree-vect-loop.c
index ba67de490bb..49d53fb3383 100644
--- a/gcc/tree-vect-loop.c
+++ b/gcc/tree-vect-loop.c
@@ -3026,7 +3026,8 @@ vect_analyze_loop (class loop *loop, vec_info_shared
*shared)
   vector_modes[0] = autodetected_vector_mode;
   mode_i = 0;

-  bool supports_partial_vectors = partial_vectors_supported_p ();
+  bool supports_partial_vectors =
+    partial_vectors_supported_p () && param_vect_partial_vector_usage != 0;
   poly_uint64 first_vinfo_vf = LOOP_VINFO_VECT_FACTOR (first_loop_vinfo);

   while (1)


But, is there some reason not use the LOOP_VINFO_CAN_USE_PARTIAL_VECTORS_P of
first_loop_vinfo? It respects param_vect_partial_vector_usage and checks
partial vector supports (LOOP_VINFO_MASKS and LOOP_VINFO_LENS) during the
analysis phase, it looks good fit for this need of supports_partial_vectors.

  parent reply	other threads:[~2022-01-14  6:33 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-13 19:47 [Bug target/104015] New: " seurer at gcc dot gnu.org
2022-01-14  3:15 ` [Bug target/104015] " linkw at gcc dot gnu.org
2022-01-14  6:33 ` linkw at gcc dot gnu.org [this message]
2022-01-14  8:01 ` rguenth at gcc dot gnu.org
2022-01-14  8:55 ` avieira at gcc dot gnu.org
2022-01-14 10:12 ` linkw at gcc dot gnu.org
2022-01-14 10:23 ` avieira at gcc dot gnu.org
2022-01-14 10:44 ` rsandifo at gcc dot gnu.org
2022-01-14 11:30 ` avieira at gcc dot gnu.org
2022-01-14 13:04 ` cvs-commit at gcc dot gnu.org
2022-01-14 13:12 ` linkw at gcc dot gnu.org
2022-01-17 12:55 ` rsandifo at gcc dot gnu.org
2022-01-18  3:11 ` linkw at gcc dot gnu.org
2022-01-19  6:04 ` cvs-commit at gcc dot gnu.org
2022-01-19  6:06 ` linkw 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-104015-4-4bzyo8ghNi@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).