From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id DAB8F3857C46; Fri, 9 Oct 2020 11:05:34 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org DAB8F3857C46 From: "rguenth at gcc dot 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 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: tree-optimization X-Bugzilla-Version: 11.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: rguenth at gcc dot gnu.org X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter target_milestone Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: gcc-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 09 Oct 2020 11:05:35 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D97352 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] =3D c[0]; a[1] =3D c[1]; a[2] =3D c[0]; a[3] =3D c[1]; b[0] =3D c[2]; b[1] =3D c[3]; b[2] =3D c[2]; b[3] =3D c[3]; x[0] =3D c[4]; x[1] =3D 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: n= ote: =3D=3D=3D vect_slp_analyze_instance_dependence =3D=3D=3D /home/rguenther/src/gcc3/gcc/testsuite/gcc.dg/vect/bb-slp-pr78205.c:9:8: no= te:=20 =3D=3D=3D vect_slp_analyze_instance_alignment =3D=3D=3D /home/rguenther/src/gcc3/gcc/testsuite/gcc.dg/vect/bb-slp-pr78205.c:9:8: no= te:=20 removing SLP instance operations starting from: a[0] =3D _1; /home/rguenther/src/gcc3/gcc/testsuite/gcc.dg/vect/bb-slp-pr78205.c:13:8: n= ote: =3D=3D=3D vect_slp_analyze_instance_alignment =3D=3D=3D /home/rguenther/src/gcc3/gcc/testsuite/gcc.dg/vect/bb-slp-pr78205.c:13:8: n= ote: removing SLP instance operations starting from: b[0] =3D _3; /home/rguenther/src/gcc3/gcc/testsuite/gcc.dg/vect/bb-slp-pr78205.c:13:8: n= ote: =3D=3D=3D vect_slp_analyze_operations =3D=3D=3D 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 (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.=