From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from gate.crashing.org (gate.crashing.org [63.228.1.57]) by sourceware.org (Postfix) with ESMTP id A9F0A3858D32; Thu, 25 May 2023 15:38:34 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org A9F0A3858D32 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=kernel.crashing.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=kernel.crashing.org Received: from gate.crashing.org (localhost.localdomain [127.0.0.1]) by gate.crashing.org (8.14.1/8.14.1) with ESMTP id 34PFbYvS006233; Thu, 25 May 2023 10:37:34 -0500 Received: (from segher@localhost) by gate.crashing.org (8.14.1/8.14.1/Submit) id 34PFbX87006232; Thu, 25 May 2023 10:37:33 -0500 X-Authentication-Warning: gate.crashing.org: segher set sender to segher@kernel.crashing.org using -f Date: Thu, 25 May 2023 10:37:33 -0500 From: Segher Boessenkool To: Vladimir Makarov Cc: liuhongt , gcc-patches@gcc.gnu.org, linkw@gcc.gnu.org Subject: Re: [PATCH] Only use NO_REGS in cost calculation when !hard_regno_mode_ok for GENERAL_REGS and mode. Message-ID: <20230525153733.GL19790@gate.crashing.org> References: <20230517065702.2935000-1-hongtao.liu@intel.com> <611d2da4-c692-39bb-8042-4415e7b6a194@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <611d2da4-c692-39bb-8042-4415e7b6a194@redhat.com> User-Agent: Mutt/1.4.2.3i X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,JMQ_SPF_NEUTRAL,KAM_DMARC_STATUS,SPF_HELO_PASS,SPF_PASS,TXREP,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: On Thu, May 25, 2023 at 10:29:47AM -0400, Vladimir Makarov wrote: > > On 5/17/23 02:57, liuhongt wrote: > >r14-172-g0368d169492017 replaces GENERAL_REGS with NO_REGS in cost > >calculation when the preferred register class are not known yet. > >It regressed powerpc PR109610 and PR109858, it looks too aggressive to use > >NO_REGS when mode can be allocated with GENERAL_REGS. > >The patch takes a step back, still use GENERAL_REGS when > >hard_regno_mode_ok for mode and GENERAL_REGS, otherwise uses NO_REGS. > >Kewen confirmed the patch fixed PR109858, I vefiried it also fixed > >PR109610. > > > >Bootstrapped and regtested on x86_64-pc-linux-gnu{-m32,}. > >No big performance impact for SPEC2017 on icelake server. > >Ok for trunk? > > > >gcc/ChangeLog: > > > > * ira-costs.cc (scan_one_insn): Only use NO_REGS in cost > > calculation when !hard_regno_mode_ok for GENERAL_REGS and > > mode, otherwise still use GENERAL_REGS. > > Thank you for the patch.  It looks good for me.  It is ok to commit it > into the trunk. Thanks everyone involved for fixing this nasty regression! Much appreciated. Segher