From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id A0D373858C74; Thu, 27 Apr 2023 01:36:16 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org A0D373858C74 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1682559376; bh=8EzWYiA1oymqtVZTkjOLA3GIzsR/A5nna7z5DCuNcbE=; h=From:To:Subject:Date:In-Reply-To:References:From; b=w0TKLpqCkLrmkvFbHlBMVxKQRbd7LArvqATOreNDu2oPODti/aOP9URuo0mvlsHVP YAjpcHel4JnJsTYLvkxDEiX8/6ON8THkuD6/9R2IFZHF5Gqx8yacdYIKHhMTpVENdP bOq+wqzuQvvLAlhE4NOGLbWZowFSxKVKZWP/Z5VA= From: "crazylht at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/109610] [14 regression] gcc.target/powerpc/dform-3.c fails after r14-172-g0368d169492017 Date: Thu, 27 Apr 2023 01:36:15 +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: testsuite-fail X-Bugzilla-Severity: normal X-Bugzilla-Who: crazylht at gmail 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: 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=3D109610 --- Comment #7 from Hongtao.liu --- (In reply to rsandifo@gcc.gnu.org from comment #6) > Please don't do the peephole thing! This seems like a > target-independent problem. >=20 > The costs for r117 look odd. Why is the cost of GENERAL_REGS so high > when the use (before the introduction of insn 13) explicitly requires > GENERAL_REGS? >=20 > Given those costs, the behaviour after the patch looks correct > (on the basis of the information its working with, I mean, > even though it's not the desired effect). (define_insn "vsx_mov_64bit" [(set (match_operand:VSX_M 0 "nonimmediate_operand" "=3DZwO, wa, wa, r, we, ?w= Q, ?&r, ??r, ??Y, , wa, v, wa, wa, ?wa, v, , wZ, v") (match_operand:VSX_M 1 "input_operand"=20 "wa, ZwO, wa, we, r, r, wQ, Y, r, r, wE, jwM, eQ, eP, ?jwM, W, , v, wZ"))] "TARGET_POWERPC64 && VECTOR_MEM_VSX_P (mode) && (register_operand (operands[0], mode)=20 || register_operand (operands[1], mode))" { return rs6000_output_move_128bit (operands); } Because the backend pattern explicitly disparage the alternative (, r), (??r, Y) which moves from GENERAL_REGS/MEM to GENERAL_REGS. And in cost calculation, RA will add extra 2 for each '?', that's why cost of GENERAL_R= EGS is so high. If manually remove ?? from ??r, then the cost for GENERAL_REGS = will become 0, then RA can allocate r117 as GENERAL_REGS, the extra move can be eliminated by pass_reload.=20=20 ----------cost after removing ?? from ??r-------------- a2(r117,l0) costs: BASE_REGS:0,0 GENERAL_REGS:0,0 FLOAT_REGS:0,0 ALTIVEC_REGS:0,0 VSX_REGS:0,0 GEN_OR_FLOAT_REGS:12000,12000 GEN_OR_VSX_REGS:12000,12000 MEM:0,0 -----------end----------------------- So it looks like an target dependent issue, the backend dislike allocating GENERAL_REGS for V2DFmode move, but inline asm explicitly want it to be in GENERAL_REGS.=