From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id DD0AE3857C5D; Sun, 25 Jul 2021 00:33:22 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org DD0AE3857C5D From: "pinskia at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/57430] Redundant move instruction is produced after function inlining Date: Sun, 25 Jul 2021 00:33:22 +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: 4.9.0 X-Bugzilla-Keywords: missed-optimization X-Bugzilla-Severity: normal X-Bugzilla-Who: pinskia 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: component 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: Sun, 25 Jul 2021 00:33:23 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D57430 Andrew Pinski changed: What |Removed |Added ---------------------------------------------------------------------------- Component|rtl-optimization |tree-optimization --- Comment #5 from Andrew Pinski --- So on the trunk, it looks like the inlined version has only one mov while t= he out of line one has two. inlined: .L19: cmpq %rax, %rsi je .L18 .L17: movq %rax, %rdx movq 24(%rax), %rax testq %rax, %rax jne .L19 out of line: .L7: movq %rdx, %rax .L4: cmpq %rax, %rsi je .L3 movq 24(%rax), %rdx movq %rax, %rcx testq %rdx, %rdx jne .L7 Note this is 64bit x86. inlined: [local count: 376074471]: if (first_24 !=3D curr_34) goto ; [94.50%] else goto ; [5.50%] [local count: 397962402]: # curr_55 =3D PHI curr_34 =3D curr_55->next; if (curr_34 !=3D 0B) goto ; [94.50%] else goto ; [5.50%] out of line: [local count: 1014686024]: # curr_24 =3D PHI # prev_25 =3D PHI if (elt_12(D) !=3D curr_24) goto ; [94.50%] else goto ; [5.50%] [local count: 958878294]: curr_15 =3D curr_24->next; if (curr_15 !=3D 0B) goto ; [93.84%] else goto ; [6.16%]=