From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 0AA3C38930F3; Fri, 29 Jan 2021 07:31:24 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 0AA3C38930F3 From: "rguenther at suse dot de" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/98848] [9/10/11 regression] vectorizer failed to reduce max pattern since r9-1590 Date: Fri, 29 Jan 2021 07:31: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: 11.0 X-Bugzilla-Keywords: missed-optimization X-Bugzilla-Severity: normal X-Bugzilla-Who: rguenther at suse dot de X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: 9.4 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: Fri, 29 Jan 2021 07:31:24 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D98848 --- Comment #5 from rguenther at suse dot de --- On Thu, 28 Jan 2021, jakub at gcc dot gnu.org wrote: > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D98848 >=20 > --- Comment #4 from Jakub Jelinek --- > Alternatively, couldn't we support truncation in the reductions if > SSA_NAME_RANGE_INFO suggests that the values are always in the narrower r= ange? Yes, we probably could. But note that changes in reduction support are quite fragile and we're currently just set up for sign changes (via emitting V_C_E) but not required promotions/demotions so there would be a lot of changes needed. It's also not clear promoting/demoting the reduction IV all the time is doing any good (unless you suggest that we'd magically undo the pattern by promoting the non-reduction OP instead - but that would require even more changes). So I guess the better approach might be to somehow allow late "undoing" of pattern recog (but it's a bit complicated because of how that=20 influences VF compute and also relevant/liveness compute).=