From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14735 invoked by alias); 1 Sep 2014 16:41:37 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 14721 invoked by uid 89); 1 Sep 2014 16:41:37 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.6 required=5.0 tests=AWL,BAYES_00,MSGID_FROM_MTA_HEADER,RP_MATCHES_RCVD,SPF_PASS autolearn=ham version=3.3.2 X-HELO: e06smtp11.uk.ibm.com Received: from e06smtp11.uk.ibm.com (HELO e06smtp11.uk.ibm.com) (195.75.94.107) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-SHA encrypted) ESMTPS; Mon, 01 Sep 2014 16:41:35 +0000 Received: from /spool/local by e06smtp11.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Mon, 1 Sep 2014 17:41:32 +0100 Received: from d06dlp03.portsmouth.uk.ibm.com (9.149.20.15) by e06smtp11.uk.ibm.com (192.168.101.141) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Mon, 1 Sep 2014 17:41:30 +0100 Received: from b06cxnps3074.portsmouth.uk.ibm.com (d06relay09.portsmouth.uk.ibm.com [9.149.109.194]) by d06dlp03.portsmouth.uk.ibm.com (Postfix) with ESMTP id 2CD611B08061 for ; Mon, 1 Sep 2014 17:42:30 +0100 (BST) Received: from d06av02.portsmouth.uk.ibm.com (d06av02.portsmouth.uk.ibm.com [9.149.37.228]) by b06cxnps3074.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id s81GfUtY41746542 for ; Mon, 1 Sep 2014 16:41:30 GMT Received: from d06av02.portsmouth.uk.ibm.com (localhost [127.0.0.1]) by d06av02.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id s81GfTbD004418 for ; Mon, 1 Sep 2014 10:41:29 -0600 Received: from tuxmaker.boeblingen.de.ibm.com (tuxmaker.boeblingen.de.ibm.com [9.152.85.9]) by d06av02.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVin) with SMTP id s81GfSmK004385; Mon, 1 Sep 2014 10:41:28 -0600 Message-Id: <201409011641.s81GfSmK004385@d06av02.portsmouth.uk.ibm.com> Received: by tuxmaker.boeblingen.de.ibm.com (sSMTP sendmail emulation); Mon, 01 Sep 2014 18:41:28 +0200 Subject: Re: [PATCH][IRA] Analysis of register usage of functions for usage by IRA. To: Tom_deVries@mentor.com (Tom de Vries) Date: Mon, 01 Sep 2014 16:41:00 -0000 From: "Ulrich Weigand" Cc: vmakarov@redhat.com (Vladimir Makarov), stevenb.gcc@gmail.com (Steven Bosscher), gcc-patches@gcc.gnu.org (gcc-patches@gcc.gnu.org), robradovic@mips.com (Radovan Obradovic) In-Reply-To: <510282FE.1060809@mentor.com> from "Tom de Vries" at Jan 25, 2013 02:05:02 PM MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 14090116-5024-0000-0000-000001258914 X-SW-Source: 2014-09/txt/msg00065.txt.bz2 Tom de Vries wrote: > * ira-costs.c (ira_tune_allocno_costs): Use > ALLOCNO_CROSSED_CALLS_CLOBBERED_REGS to adjust costs. In debugging PR 53864 on s390x-linux, I ran into a weird change in behavior that occurs when the following part of this patch was checked in: > - if (ira_hard_reg_set_intersection_p (regno, mode, call_used_reg_set) > - || HARD_REGNO_CALL_PART_CLOBBERED (regno, mode)) > - cost += (ALLOCNO_CALL_FREQ (a) > - * (ira_memory_move_cost[mode][rclass][0] > - + ira_memory_move_cost[mode][rclass][1])); > + crossed_calls_clobber_regs > + = &(ALLOCNO_CROSSED_CALLS_CLOBBERED_REGS (a)); > + if (ira_hard_reg_set_intersection_p (regno, mode, > + *crossed_calls_clobber_regs)) > + { > + if (ira_hard_reg_set_intersection_p (regno, mode, > + call_used_reg_set) > + || HARD_REGNO_CALL_PART_CLOBBERED (regno, mode)) > + cost += (ALLOCNO_CALL_FREQ (a) > + * (ira_memory_move_cost[mode][rclass][0] > + + ira_memory_move_cost[mode][rclass][1])); > #ifdef IRA_HARD_REGNO_ADD_COST_MULTIPLIER > - cost += ((ira_memory_move_cost[mode][rclass][0] > - + ira_memory_move_cost[mode][rclass][1]) > - * ALLOCNO_FREQ (a) > - * IRA_HARD_REGNO_ADD_COST_MULTIPLIER (regno) / 2); > + cost += ((ira_memory_move_cost[mode][rclass][0] > + + ira_memory_move_cost[mode][rclass][1]) > + * ALLOCNO_FREQ (a) > + * IRA_HARD_REGNO_ADD_COST_MULTIPLIER (regno) / 2); > #endif > + } Before that patch, this code would penalize all call-clobbered registers (if the alloca is used across a call), and it would penalize *all* registers in a target-dependent way if IRA_HARD_REGNO_ADD_COST_MULTIPLIER is defined; the latter is completely independent of the presence of any calls. However, after that patch, the IRA_HARD_REGNO_ADD_COST_MULTIPLIER penalty is only applied for registers clobbered by calls in this function. This seems a completely unrelated change, and looks just wrong to me ... Was this done intentionally or is this just an oversight? Bye, Ulrich -- Dr. Ulrich Weigand GNU/Linux compilers and toolchain Ulrich.Weigand@de.ibm.com