From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 5F4643858C33; Wed, 26 Jul 2023 11:00:39 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 5F4643858C33 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1690369239; bh=VXVhavfnDGr9t26WyJ4GxCDDIGhcg9ijgmh8oiCSJ3Q=; h=From:To:Subject:Date:In-Reply-To:References:From; b=X1SPBrscltzLacllLF9Ae5h9LGLrTmybuE42MWL59m3AhltPyjjLtGGH6iLGWwg2f Y+r0ZavZyJpBFd7ae6qGnNkwI6yRgCr/qf+Ir56TMHTX9/GJuj6CU8LJoiRl/+X31G W5Le4OPlocMpNJBM6axxEcKOUgkbJsW4LYcF86oQ= From: "rsandifo at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug middle-end/106081] missed vectorization Date: Wed, 26 Jul 2023 11:00:38 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: middle-end X-Bugzilla-Version: 13.0 X-Bugzilla-Keywords: missed-optimization X-Bugzilla-Severity: enhancement X-Bugzilla-Who: rsandifo at gcc dot gnu.org X-Bugzilla-Status: ASSIGNED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: rguenth at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: 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=3D106081 --- Comment #13 from rsandifo at gcc dot gnu.org --- (In reply to Richard Biener from comment #12) > Btw, I see we actually materialize a permute before the splat: >=20 > t.c:14:24: note: node 0x5b311c0 (max_nunits=3D1, refcnt=3D2) vector(2) = double > t.c:14:24: note: op: VEC_PERM_EXPR > t.c:14:24: note: stmt 0 _1 =3D *k_50; > t.c:14:24: note: stmt 1 _1 =3D *k_50; > t.c:14:24: note: stmt 2 _1 =3D *k_50; > t.c:14:24: note: stmt 3 _1 =3D *k_50; > t.c:14:24: note: lane permutation { 0[3] 0[2] 0[1] 0[0] } > t.c:14:24: note: children 0x5b30fc0 > t.c:14:24: note: node 0x5b30fc0 (max_nunits=3D2, refcnt=3D1) vector(2) = double > t.c:14:24: note: op template: _1 =3D *k_50; > t.c:14:24: note: stmt 0 _1 =3D *k_50; > t.c:14:24: note: stmt 1 _1 =3D *k_50; > t.c:14:24: note: stmt 2 _1 =3D *k_50; > t.c:14:24: note: stmt 3 _1 =3D *k_50; > t.c:14:24: note: load permutation { 0 0 0 0 } >=20 > this is because vect_optimize_slp_pass::get_result_with_layout doesn't > seem to consider load permutations? Yeah. That's because, if to_layout_i !=3D from_layout_i, the caller is asking for a different layout from the one that we picked for the load. If we wanted to change the load permutation in-place for the given to_layout_i, we'd need to duplicate the load too, which didn't seem like a good trade-off.=