From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 89BE03874C2E; Fri, 29 Jan 2021 09:09:04 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 89BE03874C2E From: "marxin at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/98868] [8/9/10/11 Regression] polyhedron rnflow.f90 regression since r8-2555-g344be1fd47d7d64e Date: Fri, 29 Jan 2021 09:09:04 +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: marxin at gcc dot gnu.org X-Bugzilla-Status: ASSIGNED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: rguenth at gcc dot gnu.org X-Bugzilla-Target-Milestone: 8.5 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 09:09:04 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D98868 --- Comment #3 from Martin Li=C5=A1ka --- It's likely about a small loop alignment: # Overhead Command Shared Object Symbol=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20 # ........ ....... .................... ................................= .... # 78.19% a.out a.out [.] matsim_ 17.00% a.out a.out [.] evlrnf_ matsim_ hot place (with --show-total-period) SLOW: 8653282 : 4017cb: imul $0x3243f6ad,%esi,%esi : genuni(): : genuni =3D us231 * real (jsee) 726254541 : 4017d1: vxorps %xmm0,%xmm0,%xmm0 : jsee =3D jsee * jmul + jadd 0 : 4017d5: add $0x1b0cb175,%esi : genuni =3D us231 * real (jsee) 105853662 : 4017db: vcvtsi2ss %esi,%xmm0,%xmm0 273371557 : 4017df: vmulss %xmm1,%xmm0,%xmm0 : gentrs_(): : do icls =3D icls1, ncls 454049783 : 4017e3: cmp $0xffffffff,%edi 2165881 : 4017e6: je 401970 0 : 4017ec: cmp $0x1,%edi 1081799 : 4017ef: jne 4017cb 2155914 : 4017f1: mov %r9,%rdx 4307088 : 4017f4: mov %r8d,%ecx 0 : 4017f7: jmp 401811 0 : 4017f9: nopl 0x0(%rax) 8624612913 : 401800: inc %ecx 42153493 : 401802: add $0x400,%rdx 484044717 : 401809: cmp $0x101,%ecx 38933067 : 40180f: je 4017cb FAST: 45442445 : 4017c9: imul $0x3243f6ad,%edx,%edx : genuni(): : genuni =3D us231 * real (jsee) 1076892 : 4017cf: vxorps %xmm0,%xmm0,%xmm0 : jsee =3D jsee * jmul + jadd 3245642 : 4017d3: add $0x1b0cb175,%edx : jsee =3D ibits(jsee, 0, 31) ! Replacement 1083699 : 4017d9: and $0x7fffffff,%edx : genuni =3D us231 * real (jsee) 0 : 4017df: vcvtsi2ss %edx,%xmm0,%xmm0 76652291 : 4017e3: vmulss %xmm1,%xmm0,%xmm0 : gentrs_(): : do icls =3D icls1, ncls 166631920 : 4017e7: cmp $0xffffffff,%edi 3251886 : 4017ea: je 401970 0 : 4017f0: cmp $0x1,%edi 0 : 4017f3: jne 4017c9 0 : 4017f5: mov %r9,%rcx 0 : 4017f8: mov %r8d,%esi 1083364 : 4017fb: jmp 401811 0 : 4017fd: nopl (%rax) 1099920836 : 401800: inc %esi 209587136 : 401802: add $0x400,%rcx 100391619 : 401809: cmp $0x101,%esi 69184337 : 40180f: je 4017c9 For some reason the hottest "inc" instruction has in fast version ~10x smal= ler number of cycles. The instruction takes 20% of cycles in the slow version.=