From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 6F3AE3858C52; Sat, 10 Feb 2024 09:53:25 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 6F3AE3858C52 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1707558805; bh=w9M45zOEdZLqQFu8x3bgJLc1RvF5qwFkaOKWMn8Pp/4=; h=From:To:Subject:Date:In-Reply-To:References:From; b=BN5NOoMlxeV0yBDqTLVpIORzlxT1Z3yxFjBSb/PEw9vm0xbNo1PtsRlmLRBiz7iOv jSbVII9HK5/tBNqOpnfAU6Sop3GkNDSzOgC/ePLuuiIOLM7TMdHNUe1eKIEBbJCd3c LyYA7Du08SgnuL5JoLyyvIA1vmhnx29a36n695TA= From: "pinskia at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/109885] gcc does not generate movmskps and testps instructions (clang does) Date: Sat, 10 Feb 2024 09:53:23 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: tree-optimization X-Bugzilla-Version: 14.0 X-Bugzilla-Keywords: missed-optimization X-Bugzilla-Severity: enhancement X-Bugzilla-Who: pinskia 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: component cc blocked 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=3D109885 Andrew Pinski changed: What |Removed |Added ---------------------------------------------------------------------------- Component|target |tree-optimization CC| |pinskia at gcc dot gnu.org Blocks| |53947 --- Comment #3 from Andrew Pinski --- What is even funnier on the LLVM side is if we have: ``` void f(unsigned int * __restrict a, unsigned int * __restrict b) { unsigned int t =3D 0; t +=3D (a[0] =3D=3D b[0]); t +=3D (a[1] =3D=3D b[1])<<1; t +=3D (a[2] =3D=3D b[2])<<2; t +=3D (a[3] =3D=3D b[3])<<3; *a =3D t; } ``` LLVM can produce movmskps for x86_64 but then does do a similar trick that = it did for the sum for aarch64. Note GCC does not handle reductions that well for SLP either. Referenced Bugs: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D53947 [Bug 53947] [meta-bug] vectorizer missed-optimizations=