From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 529E1385782B; Wed, 25 Aug 2021 08:42:53 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 529E1385782B From: "crazylht at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug rtl-optimization/43147] SSE shuffle merge Date: Wed, 25 Aug 2021 08:42:52 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: rtl-optimization X-Bugzilla-Version: 12.0 X-Bugzilla-Keywords: missed-optimization X-Bugzilla-Severity: enhancement X-Bugzilla-Who: crazylht at gmail dot com 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: 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: Wed, 25 Aug 2021 08:42:53 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D43147 --- Comment #15 from Hongtao.liu --- > I think pass_combine should be extended to force illegitimate constant > to constant pool and recog load insn again, It looks like a general > optimization that better not do it in the backend. The issue can also be solved by folding __builtin_ia32_shufps to gimple VEC_PERM_EXPR, .i.e the below testcase doesn't have the problem typedef int v4si __attribute__((vector_size (16))); v4si foo () { v4si a =3D __extension__ (v4si) {4, 3, 2, 1}; v4si b =3D __extension__ (v4si) {5, 6, 7, 8}; v4si c =3D __builtin_shufflevector (a, b, 1, 4, 2, 7); v4si d =3D __builtin_shuffle (c, __extension__ (v4si) { 3, 2, 0, 1 }); return d; } foo(): movdqa .LC0(%rip), %xmm0 ret .LC0: .long 8 .long 2 .long 3 .long 5=