public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "rguenth at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug tree-optimization/97352] New: gcc.dg/vect/bb-slp-pr78205.c fails to vectorize all opportunities with AVX
Date: Fri, 09 Oct 2020 11:05:34 +0000	[thread overview]
Message-ID: <bug-97352-4@http.gcc.gnu.org/bugzilla/> (raw)

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

            Bug ID: 97352
           Summary: gcc.dg/vect/bb-slp-pr78205.c fails to vectorize all
                    opportunities with AVX
           Product: gcc
           Version: 11.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: tree-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: rguenth at gcc dot gnu.org
  Target Milestone: ---

When using AVX vectors

double x[2], a[4], b[4], c[5];

void foo ()
{
  a[0] = c[0];
  a[1] = c[1];
  a[2] = c[0];
  a[3] = c[1];
  b[0] = c[2];
  b[1] = c[3];
  b[2] = c[2];
  b[3] = c[3];
  x[0] = c[4];
  x[1] = c[4];
}

only vectorizes the x[] stores since the overall SLP analysis succeeds with
V4DFmode but only parts of the opportunities are finally vectorized and thus
SLP vectorization with V2DFmode isn't even tried.

This is the issue that vector mode iteration works on wrong granularity.

/home/rguenther/src/gcc3/gcc/testsuite/gcc.dg/vect/bb-slp-pr78205.c:17:8: note:
  === vect_slp_analyze_instance_dependence ===
/home/rguenther/src/gcc3/gcc/testsuite/gcc.dg/vect/bb-slp-pr78205.c:9:8: note: 
 === vect_slp_analyze_instance_alignment ===
/home/rguenther/src/gcc3/gcc/testsuite/gcc.dg/vect/bb-slp-pr78205.c:9:8: note: 
removing SLP instance operations starting from: a[0] = _1;
/home/rguenther/src/gcc3/gcc/testsuite/gcc.dg/vect/bb-slp-pr78205.c:13:8: note:
  === vect_slp_analyze_instance_alignment ===
/home/rguenther/src/gcc3/gcc/testsuite/gcc.dg/vect/bb-slp-pr78205.c:13:8: note:
 removing SLP instance operations starting from: b[0] = _3;
/home/rguenther/src/gcc3/gcc/testsuite/gcc.dg/vect/bb-slp-pr78205.c:13:8: note:
  === vect_slp_analyze_operations ===

and the failure is because of the now late performed

/* Analyze alignment of DRs of stmts in NODE.  */

static bool
vect_slp_analyze_node_alignment (vec_info *vinfo, slp_tree node)
{
...
  /* We need to commit to a vector type for the group now.  */
  if (is_a <bb_vec_info> (vinfo)
      && !vect_update_shared_vectype (first_stmt_info, SLP_TREE_VECTYPE
(node)))
    return false;

because the other SLP instance (with x[] stores) set the vector type to V2DF
while this one wants V4DF.

             reply	other threads:[~2020-10-09 11:05 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-09 11:05 rguenth at gcc dot gnu.org [this message]
2020-10-12  7:29 ` [Bug tree-optimization/97352] " rguenth at gcc dot gnu.org
2020-10-13 11:47 ` rguenth at gcc dot gnu.org
2021-09-02 10:18 ` pinskia at gcc dot gnu.org
2021-09-10 12:24 ` rguenth at gcc dot gnu.org
2021-09-27  8:24 ` cvs-commit at gcc dot gnu.org
2021-09-27  8:25 ` rguenth 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-97352-4@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).