From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 2BE773858409; Tue, 23 Jan 2024 12:56:21 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 2BE773858409 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1706014581; bh=/A+rCHWRsU7Hg5T5/9PSWp4rAxlRApGtwxOi0YJ6jVQ=; h=From:To:Subject:Date:In-Reply-To:References:From; b=Lv0ThmXrZ0vJoDor+CHrAe7LPshJr+4fAv46BR/HFY9rvDVqel9eZPOzqS5CvBpYI 4cI7ZFqrxqyCEX5k2Bw6Qtlrts8wR1c2HJtbYr0lKQcW5AH15fwsye2WP9DTWX5zou zjup8Bebae5aMaNA+Hcg0uSBtq1BVCwJoZqhvoFY= 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 Date: Tue, 23 Jan 2024 12:56:20 +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, needs-bisection X-Bugzilla-Severity: normal X-Bugzilla-Who: rguenth at gcc dot gnu.org X-Bugzilla-Status: UNCONFIRMED 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 #20 from Richard Biener --- (In reply to Richard Biener from comment #19) > (In reply to Richard Biener from comment #18) > > (In reply to Tamar Christina from comment #17) > > > Ok, bisected to > > >=20 > > > g:2efe3a7de0107618397264017fb045f237764cc7 is the first bad commit > > > commit 2efe3a7de0107618397264017fb045f237764cc7 > > > Author: Hao Liu > > > Date: Wed Dec 6 14:52:19 2023 +0800 > > >=20 > > > tree-optimization/112774: extend the SCEV CHREC tree with a nonwr= apping > > > flag > > >=20 > > > Before this commit we were unable to analyse the stride of the access. > > > After this niters seems to estimate the loop trip count at 4 and afte= r that > > > the logs diverge enormously. > >=20 > > Hum, but that's backward and would match to what I said in comment#2 - = we > > should get better code with that. > >=20 > > Juzhe - when you revert the above ontop of trunk does the generated code > > look better for Risc-V? >=20 > It doesn't revert but you can do >=20 > diff --git a/gcc/tree-scalar-evolution.cc b/gcc/tree-scalar-evolution.cc > index 25e3130e2f1..7870c8d76fb 100644 > --- a/gcc/tree-scalar-evolution.cc > +++ b/gcc/tree-scalar-evolution.cc > @@ -2054,7 +2054,7 @@ analyze_scalar_evolution (class loop *loop, tree va= r) >=20=20 > void record_nonwrapping_chrec (tree chrec) > { > - CHREC_NOWRAP(chrec) =3D 1; > + CHREC_NOWRAP(chrec) =3D 0; >=20=20 > if (dump_file && (dump_flags & TDF_SCEV)) > { For me with this, on x86-64 we do not vectorize the loop at all. With -fno-vect-cost-model we vectorize some of the stores as part of BB vectorization.=