From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id A28CF3858438; Mon, 28 Aug 2023 12:51:16 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org A28CF3858438 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1693227076; bh=C53svVOFZiQd8NXvjQuBIKn36KtdZdLJGGHj/Jo+UAU=; h=From:To:Subject:Date:In-Reply-To:References:From; b=i59NixZViPguWInorx0/pjek5Lp41CMVGvCRU3gHR+aENcXYUz9o7+qs1oQ4Og75J 9lr4v9IC0ALiMynV44p3d+DN/kcLJdXQUMOvC9jUjuZjtVnM6S2RoXIQxN/ttjWRUf 1Z5wYTt8bphVZbdKyA4K1faoCfCBunviYaz1MVCY= From: "gnu_bugzilla_gcc at catelyn dot tech" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/111166] gcc unnecessarily creates vector operations for packing 32 bit integers into struct (x86_64) Date: Mon, 28 Aug 2023 12:51:15 +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: 13.2.1 X-Bugzilla-Keywords: missed-optimization X-Bugzilla-Severity: normal X-Bugzilla-Who: gnu_bugzilla_gcc at catelyn dot tech 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 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D111166 --- Comment #5 from gnu_bugzilla_gcc at catelyn dot tech --- (In reply to Richard Biener from comment #4) > note the situation is difficult to rectify - ideally the vectorizer > would see that we require two 64bit register pieces but it doesn't - it s= ees > we store into memory. right, I figured that might have been what was going on, given some of the related issues, the vectorizer incorrectly calculating the cost beforehand > I'll note the non-vectorized code is also far from optimal. clang > produces the following which is faster by more of the delta that > the vectorized version is slower compared to the scalar GCC variant. I did notice that the GCC -Os and clang -O3 versions were different, didn't realize that it was by that much, interesting=