From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 6944E3858430; Tue, 16 Nov 2021 07:41:57 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 6944E3858430 From: "luoxhu at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug testsuite/103270] New: [12 regression] gcc.dg/vect/pr96698.c inner loop turned from hot to cold after r12-4526 Date: Tue, 16 Nov 2021 07:41:57 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: testsuite X-Bugzilla-Version: 12.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: luoxhu 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: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter target_milestone Message-ID: 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: Tue, 16 Nov 2021 07:41:57 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D103270 Bug ID: 103270 Summary: [12 regression] gcc.dg/vect/pr96698.c inner loop turned from hot to cold after r12-4526 Product: gcc Version: 12.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: testsuite Assignee: unassigned at gcc dot gnu.org Reporter: luoxhu at gcc dot gnu.org Target Milestone: --- For the testcase gcc.dg/vect/pr96698.c, the inner loop was hot (preheader c= ount < loop count), but it is NOT now after r12-4526, bb 3's profile count 35433= 4801 is only 1/2 of the preheader bb 5's profile count 719407024. But I guess it should be fixed in tree-ssa-loop-ch.c when copy_headers, the= re are profile count update there, this case should be handled specially when = the single exit loop only has two bbs and the old header is new exit->src, no n= eed to scale down the old header profile count to preserve the hotness of the l= oop. pr96698.c.138t.lim2: void test (int a, int * i) { int i__lsm.5; int c; int b; int _22; int _23; int _24; [local count: 88915474]: if (a_12(D) <=3D 4) goto ; [89.00%] else goto ; [11.00%] [local count: 79134772]: i__lsm.5_11 =3D *i_16(D); goto ; [100.00%] [local count: 116930484]: [local count: 354334801]: # b_3 =3D PHI # c_17 =3D PHI # i__lsm.5_20 =3D PHI _22 =3D i__lsm.5_20; _23 =3D a_2 & c_17; _24 =3D _22 + _23; i__lsm.5_4 =3D _24; b_15 =3D b_3 + -1; if (b_15 !=3D -11) goto ; [33.00%] else goto ; [67.00%] [local count: 719407024]: # i__lsm.5_7 =3D PHI a_14 =3D a_2 + 1; if (a_14 <=3D 4) goto ; [89.00%] else goto ; [11.00%] [local count: 640272252]: [local count: 719407024]: # a_2 =3D PHI # i__lsm.5_1 =3D PHI goto ; [100.00%] [local count: 79134772]: # i__lsm.5_5 =3D PHI *i_16(D) =3D i__lsm.5_5; [local count: 88915474]: return; }=