From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 817D63857400; Tue, 10 Aug 2021 14:30:52 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 817D63857400 From: "rguenth at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/101846] Improve __builtin_shufflevector emitted code Date: Tue, 10 Aug 2021 14:30:52 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: target X-Bugzilla-Version: 12.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: rguenth at gcc dot gnu.org X-Bugzilla-Status: NEW 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: cf_reconfirmed_on bug_status everconfirmed 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 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: Tue, 10 Aug 2021 14:30:52 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D101846 Richard Biener changed: What |Removed |Added ---------------------------------------------------------------------------- Last reconfirmed| |2021-08-10 Status|UNCONFIRMED |NEW Ever confirmed|0 |1 --- Comment #1 from Richard Biener --- Confirmed. I've pondered (for elsewhere) about how to represent "paradoxic= al subregs" on GIMPLE. We expand from v32hi foo (v16hi x) { vector(32) short int _1; v32hi _3; ;; basic block 2, loop depth 0 ;; pred: ENTRY _1 =3D {x_2(D), { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }}; _3 =3D VEC_PERM_EXPR <_1, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, = 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, { 0, 32, 1, 33, 2, 34, 3, 35= , 4, 36, 5, 37, 6, 38, 7, 39, 8, 40, 9, 41, 10, 42, 11, 43, 12, 44, 13, 45, 14, = 46, 15, 47 }>; return _3; and v16hi bar (v32hi x) { vector(32) short int _1; v16hi _3; ;; basic block 2, loop depth 0 ;; pred: ENTRY _1 =3D VEC_PERM_EXPR ; _3 =3D BIT_FIELD_REF <_1, 256, 0>; return _3; I think bar() is reasonable from the GIMPLE side, it would be a 1:1 canonicalization choice to move the BIT_FIELD_REF across the permute (and something only "profitable" for single operand permutes). For foo() I thought of doing _1 =3D BIT_INSERT_EXPR ; with tem_3(D) being uninitialized as to represent a paradoxical subreg. I've tested and disregarded the idea of simply doing VIEW_CONVERT_EXPRs here but I'm considering it for the case where we need the lowpart of a vector and the the highpart doesn't matter (aka %xmm0 vs %ymm0) since the current representation of doing a BIT_FIELD_REF doesn't seem to optimize well (that was in the context of AVX512 mask registers though). I suppose the testcases can be optimized on the RTL level as well.=