From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 760E13857C66; Thu, 5 Oct 2023 07:46:49 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 760E13857C66 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1696492009; bh=TqmWXIw0toQPq4NoScPa1YqYihFden9QPBTVf+3lnbY=; h=From:To:Subject:Date:In-Reply-To:References:From; b=ch4bDXG7FWbqVl4VdSe9kfniSwfN24pY1K+cipu7ioxnOK0K0ayJeX7BO6uapkN6o 5I6hXvoy/PrLeB5w9bn+sRWSgf7McA4I3Xj4pOE2KFaBBOIJY/RMLAsm2qj8HSaan+ m8sQlC2DERZNBxGIh8K5fyOFJgB9HdjoDE+gDKYE= From: "rguenth at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/111697] Sub optimal code gen for initialising vector using loop Date: Thu, 05 Oct 2023 07:46:48 +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: 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: 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=3D111697 --- Comment #2 from Richard Biener --- We have quite some code doing vector CTOR stuff in tree-ssa-forwprop.cc and this should be optimized to v_2 =3D { x_6(D), x_6(D), x_6(D), x_6(D) }; note SLP vectorization can do this but it fails because it doesn't handle a default def insert - it handles a group of BIT_INSERT_EXPRs as vector CTOR and SLP discovery doesn't know how to start from external defs (it needs actual definition stmts). A more general approach would be to try to track vector construction through symbolic execution like we form bswap in the bswap pass.=