From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id B8C8F3858D28; Mon, 7 Aug 2023 13:28:26 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org B8C8F3858D28 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1691414906; bh=1JNXHrGxYx50CsigmddGH8EwGMDspTzVDqzUwMRjvm0=; h=From:To:Subject:Date:From; b=xB3xaZhfhWzqWU1djE/VnSbtMg1aI2UQ0N743eudd5wBlEgBypRMaKOyrqrulhE+5 m7dlSSwlWh6b16ZBIXZyUXMvHPz0KvVrOHAsyStywMUrAGnXKMoM1i+OG+c84mJwkf a1CliPeZ4gP0nzrtkPeW3o4cVMlLWplWv1HVm/S0= From: "rguenth at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/110935] New: Missed BB reduction vectorization because of missed eliding of a permute Date: Mon, 07 Aug 2023 13:28:26 +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: 13.1.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 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D110935 Bug ID: 110935 Summary: Missed BB reduction vectorization because of missed eliding of a permute Product: gcc Version: 13.1.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: --- double vals[16]; double test () { vals[0]++; return vals[2] + vals[4] + vals[1] + vals[3]; } has the reduction not vectorized with -ffast-math because t.c:5:38: note: =3D=3D=3D vect_slp_analyze_operations =3D=3D=3D t.c:5:38: note: =3D=3D> examining statement: _8 =3D vals[3]; t.c:5:38: missed: BB vectorization with gaps at the end of a load is not supported t.c:5:44: missed: not vectorized: relevant stmt not supported: _8 =3D val= s[3]; t.c:5:38: note: removing SLP instance operations starting from: _11 =3D _= 7 + _8; t.c:5:38: missed: not vectorized: bad operation in basic block. we fail to elide the load permutation (BB vect allows a consecutive sub-set): t.c:5:38: note: Final SLP tree for instance 0x51c8d60: t.c:5:38: note: node 0x5285860 (max_nunits=3D2, refcnt=3D2) vector(2) dou= ble t.c:5:38: note: op template: _8 =3D vals[3]; t.c:5:38: note: stmt 0 _8 =3D vals[3]; t.c:5:38: note: stmt 1 _6 =3D vals[1]; t.c:5:38: note: stmt 2 _3 =3D vals[2]; t.c:5:38: note: stmt 3 _4 =3D vals[4]; t.c:5:38: note: load permutation { 3 1 2 4 } t.c:5:38: note: =3D=3D=3D vect_match_slp_patterns =3D=3D=3D t.c:5:38: note: Analyzing SLP tree 0x5285860 for patterns t.c:5:38: note: SLP optimize permutations: t.c:5:38: note: 1: { 2, 0, 1, 3 } t.c:5:38: note: SLP optimize partitions: t.c:5:38: note: ------------- t.c:5:38: note: partition 0 (layout 0): t.c:5:38: note: nodes: t.c:5:38: note: - 0x5285860: t.c:5:38: note: weight: 1.000000 t.c:5:38: note: op template: _8 =3D vals[3]; t.c:5:38: note: edges: t.c:5:38: note: layout 0: (*) t.c:5:38: note: {depth: 0.000000, total: 0.000000} t.c:5:38: note: + {depth: 1.000000, total: 1.000000} t.c:5:38: note: + {depth: 0.000000, total: 0.000000} t.c:5:38: note: =3D {depth: 1.000000, total: 1.000000} t.c:5:38: note: layout 1: t.c:5:38: note: {depth: 0.000000, total: 0.000000} t.c:5:38: note: + {depth: 1.000000, total: 1.000000} t.c:5:38: note: + {depth: 0.000000, total: 0.000000} t.c:5:38: note: =3D {depth: 1.000000, total: 1.000000} t.c:5:38: note: recording new base alignment for &vals alignment: 32 misalignment: 0 based on: _1 =3D vals[0]; t.c:5:38: note: =3D=3D=3D vect_slp_analyze_instance_alignment =3D=3D=3D=