From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 05880385840D; Thu, 27 Oct 2022 22:50:21 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 05880385840D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1666911024; bh=FPv9w+8Selb4U6qAEvoWOc8iK7rz6/wkH+o77KbkxtI=; h=From:To:Subject:Date:From; b=TU25oTY/MD9yEBXyo2gwrRvPDayNxIaMpY+XzBAogyiiZJmI6v9pXioXZ+sRmNyuI 0I2h5r+xyYa9C1/2EPDDWvprcD1AQVW5GlKP7R/O78Ia4H0ks1OploF+paUha2ASSn Urk6dQH3G83GwRUT/K6OvQOJeT5CW1FJtmt3Qvts= From: "juzhe.zhong at rivai dot ai" To: gcc-bugs@gcc.gnu.org Subject: [Bug c/107445] New: Redundant moves for subregs move Date: Thu, 27 Oct 2022 22:50:20 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c X-Bugzilla-Version: 13.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: juzhe.zhong at rivai dot ai 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 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D107445 Bug ID: 107445 Summary: Redundant moves for subregs move Product: gcc Version: 13.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c Assignee: unassigned at gcc dot gnu.org Reporter: juzhe.zhong at rivai dot ai Target Milestone: --- Here is the testcase: https://godbolt.org/z/4bcfx5a86 coalesce: ld4d {z24.d - z27.d}, p0/z, [x0] mov z5.d, z24.d mov z4.d, z25.d mov z3.d, z26.d mov z2.d, z27.d cmp w1, 0 ble .L2 mov w0, 0 ld1d z1.d, p0/z, [x2] ld1d z0.d, p0/z, [x3] .L3: add w0, w0, 1 movprfx z5.d, p0/z, z5.d mad z5.d, p0/m, z1.d, z0.d movprfx z4.d, p0/z, z4.d mad z4.d, p0/m, z1.d, z0.d movprfx z3.d, p0/z, z3.d mad z3.d, p0/m, z1.d, z0.d movprfx z2.d, p0/z, z2.d mad z2.d, p0/m, z1.d, z0.d cmp w1, w0 bne .L3 It's obvious that we should be able to directly use z24 - z27 to perform mad oberation and remove the redundant moves in the prologue. I tried to implement register coalescing in IRA to fix it, but I am not sure whether it's a good idea to fix it?=