From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id D76033858432; Tue, 27 Feb 2024 08:08:48 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org D76033858432 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1709021328; bh=y47GT3tH/6/8WfcHE9YdDPnLRoPsqutfrKOPGIBhGA4=; h=From:To:Subject:Date:In-Reply-To:References:From; b=xdlTN10rERFwESCtpJmQHQKG3tfYrvQ8x5sxpwnqkrjAahVZ9GRPsnKU2C2ibOx7M l26MKExMNsP5s2EEjkjjltmzmcZyqOklI9l+7GWsC48aNZ0b0WuGdTy5yfD/PaJwoo dxRbgql6jOO+8OSuV5q4rkldPTUL1RVjPiT9VOGg= From: "rguenth at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/113441] [14 Regression] Fail to fold the last element with multiple loop since g:2efe3a7de0107618397264017fb045f237764cc7 Date: Tue, 27 Feb 2024 08:08: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: 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: 14.0 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=3D113441 --- Comment #30 from Richard Biener --- The x86 and "emulation" paths handle narrowing/widening during code generat= ion (but yes, the IFN path doesn't). A fix would be to do similar as for the gs_info.decl case in vectorizable_load/store and handle select cases of widening/narrowing (2x) and adjust vect_check_gather_scatter accordingly. That might be against the spirit of how the IFN support was laid out (possibly to be "cleaner"), but I don't see a good way to avoid the very premature (during pattern selection) load/store vectorization choosing for the cases there are multiple possibilities as seen here.=