From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id C64A6385741A; Thu, 2 Sep 2021 07:01:43 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org C64A6385741A From: "rguenth at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/95845] Failure to optimize vector load made in separate operations to single load Date: Thu, 02 Sep 2021 07:01:43 +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: 11.0 X-Bugzilla-Keywords: missed-optimization 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: 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: Thu, 02 Sep 2021 07:01:43 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D95845 --- Comment #3 from Richard Biener --- It's now vectorized at -O3 or with -ftree-slp-vectorize. In particular vect_slp_check_for_constructors now matches else if (code =3D=3D BIT_INSERT_EXPR && VECTOR_TYPE_P (TREE_TYPE (rhs)) && TYPE_VECTOR_SUBPARTS (TREE_TYPE (rhs)).is_constant () && TYPE_VECTOR_SUBPARTS (TREE_TYPE (rhs)).to_constant () > 1 && integer_zerop (gimple_assign_rhs3 (assign)) && useless_type_conversion_p (TREE_TYPE (TREE_TYPE (rhs)), TREE_TYPE (gimple_assign_rhs2 (assign))) && bb_vinfo->lookup_def (gimple_assign_rhs2 (assign))) { /* We start to match on insert to lane zero but since the inserts need not be ordered we'd have to search both the def and the use chains. */ this matching could be factored out and used by forwprop to build a vector CTOR. So I don't think it's fully fixed yet and there's an opportunity to improve things earlier. Partial defs of otherwise uninitialized vectors might also be an interesting target. When not keying on lane zero to start the match the possibility is to start matching on the insert that does not have a single immediate use of the result in another BIT_INSERT_EXPR.=