From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 39AD4384B808; Thu, 14 Jan 2021 09:32:24 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 39AD4384B808 From: "rjiejie at me dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/98673] New: pass fre4 inhibit pass dom3 to create much more optimized code Date: Thu, 14 Jan 2021 09:32:24 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: tree-optimization X-Bugzilla-Version: 10.2.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: rjiejie at me dot com 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 attachments.created 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: Thu, 14 Jan 2021 09:32:24 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D98673 Bug ID: 98673 Summary: pass fre4 inhibit pass dom3 to create much more optimized code Product: gcc Version: 10.2.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: tree-optimization Assignee: unassigned at gcc dot gnu.org Reporter: rjiejie at me dot com Target Milestone: --- Created attachment 49962 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=3D49962&action=3Dedit bug test file a, compiler option: cc1 -mabi=3Dlp64d -march=3Drv64gc -O2 -S b, hot code in function t_run_test: j .L30 .L39: mv a4,a3 .L30: ld a2,8(a5) addi a3,a4,1 slli t3,a4,3 ble a2,a1,.L28 ld t5,0(a5) bge a1,t5,.L50 .L28: addi a5,a5,8 bne a3,a0,.L39 : hot code loop to .L39 better code in version 8.4 with same compiler option: =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D .L30: ld t1,8(a4) slli a7,a5,3 ble t1,a3,.L28 ld t4,0(a4) bge a3,t4,.L50 .L28: addi a5,a5,1 addi a4,a4,8 bne a5,t3,.L30 : hot code loop to .L30 v10.2.0 gcc has more one instruction than v8.4.0. analize gcc pass of source code in v10.2.0: =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D before pass fr4: ---------------- [local count: 82176881]: engLoad.11_20 =3D engLoad; loadValue.13_26 =3D loadValue; _410 =3D (unsigned long) numXEntries.17_218; _409 =3D _410 + 18446744073709551615; _408 =3D (long int) _409; ... ... [local count: 986782143]: i1_174 =3D i1_6 + 1; if (i1_174 !=3D _408) goto ; [94.50%] else goto ; [5.50%] [local count: 54273018]: # i1_420 =3D PHI _433 =3D (long unsigned int) i1_420; _434 =3D _433 + 1; _435 =3D _434 * 8; _436 =3D i1_420 + 1; _440 =3D _435 - 8; _442 =3D engLoad.11_20 + _440; goto ; [100.00%] after pass fr4: --------------- [local count: 82176881]: engLoad.11_20 =3D engLoad; loadValue.13_26 =3D loadValue; _410 =3D (unsigned long) numXEntries.17_218; _409 =3D _410 + 18446744073709551615; ... ... [local count: 986782143]: i1_174 =3D i1_6 + 1; if (i1_174 !=3D _213) goto ; [94.50%] else goto ; [5.50%] [local count: 54273018]: _433 =3D (long unsigned int) i1_174; _434 =3D _433 + 1; _435 =3D _434 * 8; _436 =3D i1_174 + 1; _440 =3D _435 - 8; _442 =3D engLoad.11_20 + _440; goto ; [100.00%] pass fr4 remove 'Removing dead stmt _408 =3D (long int) _409;', pass dom3 can't optimize this about '_433 =3D (long unsigned int) i1_174;' if use i1_174 node same as , so that conflict will be happen= ed in pass expand on processing coalesced ssa/phi nodes, and then will split e= dge. need help ....:)=