From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 96C603861024; Thu, 2 Jul 2020 01:18:45 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 96C603861024 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1593652725; bh=jt2jSZg0gn8TU1/McuF2R+mfoB84lP5Dr0WL44b7LZQ=; h=From:To:Subject:Date:In-Reply-To:References:From; b=ZOHdHqhp6FfUgu5GRo4EHaxHe+Tdy8/8TORl5l4NeQd/h8Da35y2JNBVZj1kz4P9t z7ZJvnYKT1nKUxSDgErNzit78P950sg42UCPdCGoZAsgYlIucEHBKlTwYfV+CAVxPW fCfNVpmPag5dnzKtqoVLP/2x3aACTpixHJrWkUIc= From: "bergner at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/96017] Powerpc suboptimal register spill in likely path Date: Thu, 02 Jul 2020 01:18:45 +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: 9.2.1 X-Bugzilla-Keywords: missed-optimization X-Bugzilla-Severity: normal X-Bugzilla-Who: bergner 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: 11.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 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, 02 Jul 2020 01:18:45 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D96017 --- Comment #6 from Peter Bergner --- (In reply to Segher Boessenkool from comment #5) > But it is r31 already before > shrink-wrapping -- we need some renaming / copying of registers (like > in Peter's code) to get rid of it. In an example like this it is > quite useful, but in a lot of "real world" code there are no free > volatile registers to scarf up. Or that was my impression anyway, > when I last looked at this. Time to revisit it... Right, that's why we need to add the copies before RA, so we don't have to = look for unused regs. But we don't want to add the copies too early just for the optimizer to remove them on us. Like it did for my manually added copies. There is ira.c:split_live_ranges_for_shrink_wrap(). I'll have a look to see why it's not catching this test case.=20 > (The "ELFv1" code is just [snip] > which feels simpler... but it is kind of the same? It does look better, but marginally so, since we still stack a frame and save/restore r31 on the fast path.=