From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 00D1E386C595; Fri, 26 Jan 2024 09:33:01 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 00D1E386C595 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1706261582; bh=gk06Frxvfwx6FKqNQQJaYs+kuCVtVsr+bvjnlZyL4So=; h=From:To:Subject:Date:In-Reply-To:References:From; b=LcniR5F0bY7MiQt6Nndndr2QgQj9DPU33dFtpNyQu6u+KqXORckXtfwpOSnSelbjL R9ruEZ+Ih3lb5ZV1Kiw4LMNhn+wlLnIxsXl2ccumAgBEhjk3EpLBSRpCWvdC2TzfBk kkOUcJ9FMpOw4JK11G14ht0aH0FfT+NQIUbnN2lA= From: "acoplan at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/113613] [14 Regression] Missing ldp/stp optimization since r14-6290-g9f0f7d802482a8 Date: Fri, 26 Jan 2024 09:33:00 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: target X-Bugzilla-Version: 14.0 X-Bugzilla-Keywords: missed-optimization X-Bugzilla-Severity: normal X-Bugzilla-Who: acoplan at gcc dot gnu.org X-Bugzilla-Status: NEW 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=3D113613 --- Comment #6 from Alex Coplan --- FWIW, if I move ldp_fusion1 before early_ra, with: diff --git a/gcc/config/aarch64/aarch64-passes.def b/gcc/config/aarch64/aarch64-passes.def index 769d48f4faa..3853f6bf7a4 100644 --- a/gcc/config/aarch64/aarch64-passes.def +++ b/gcc/config/aarch64/aarch64-passes.def @@ -18,6 +18,7 @@ along with GCC; see the file COPYING3. If not see . */ +INSERT_PASS_BEFORE (pass_sched, 1, pass_ldp_fusion); INSERT_PASS_BEFORE (pass_sched, 1, pass_aarch64_early_ra); INSERT_PASS_AFTER (pass_regrename, 1, pass_fma_steering); INSERT_PASS_BEFORE (pass_reorder_blocks, 1, pass_track_speculation); @@ -25,5 +26,4 @@ INSERT_PASS_BEFORE (pass_late_thread_prologue_and_epilogu= e, 1, pass_switch_pstat INSERT_PASS_AFTER (pass_machine_reorg, 1, pass_tag_collision_avoidance); INSERT_PASS_BEFORE (pass_shorten_branches, 1, pass_insert_bti); INSERT_PASS_AFTER (pass_if_after_combine, 1, pass_cc_fusion); -INSERT_PASS_BEFORE (pass_early_remat, 1, pass_ldp_fusion); INSERT_PASS_BEFORE (pass_peephole2, 1, pass_ldp_fusion); we get: f: .LFB0: .cfi_startproc adrp x0, .LANCHOR0 add x0, x0, :lo12:.LANCHOR0 ldp d31, d30, [x0] ldp d29, d28, [x0, 32] fadd v29.2s, v31.2s, v29.2s fadd v28.2s, v30.2s, v28.2s stp d29, d28, [x0] ret note that this does use more registers, though, so it's not necessarily a c= lear win in the general case (particularly if register pressure is already high)= .=