From patchwork Wed Nov 14 13:07:47 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Robin Dapp X-Patchwork-Id: 997730 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=gcc.gnu.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=gcc-patches-return-490054-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=linux.ibm.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="T2F+gjRt"; dkim-atps=neutral Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 42w4Zw5FQlz9sB5 for ; Thu, 15 Nov 2018 00:09:28 +1100 (AEDT) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:cc:subject:date:in-reply-to:references:message-id; q=dns; s= default; b=TOCPAL9OQTEe5zDH+u07/pbnwTDIeaZDhX1wacDEwatKPgkvTT7iw mtskqP7KzveUi6fBLCtUn8mphWtR720aVv+4K2e7EPhGFtdH86q3pzOhXJ7AQWrb sZc3c7WejnIeMvC1rpfJxPFHg2juHDgCHVwGbxCxmyrN07vTva2TIA= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:cc:subject:date:in-reply-to:references:message-id; s= default; bh=6uEPTlWjvEAZn5iV3vvpFUxxk+I=; b=T2F+gjRt5edIliRxQlRy sWThTBrCoGuZ9lTyh9IIpaZpxojWtVChOenGBID3K/YR4lIIJB1fkfnqwEq7NugN NWpVkY0uLWnz1lzUzJvDNHTFWbBRgZYIuxQiUo5Jzk5yUF8Wfz4sANk2cwR2U8YP Z4biYA7LdiDij4WeYxpM0eY= Received: (qmail 86538 invoked by alias); 14 Nov 2018 13:08:18 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 86332 invoked by uid 89); 14 Nov 2018 13:08:17 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-27.0 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=ham version=3.3.2 spammy= X-HELO: mx0a-001b2d01.pphosted.com Received: from mx0a-001b2d01.pphosted.com (HELO mx0a-001b2d01.pphosted.com) (148.163.156.1) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 14 Nov 2018 13:08:15 +0000 Received: from pps.filterd (m0098410.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id wAED4TTY126162 for ; Wed, 14 Nov 2018 08:08:13 -0500 Received: from e06smtp02.uk.ibm.com (e06smtp02.uk.ibm.com [195.75.94.98]) by mx0a-001b2d01.pphosted.com with ESMTP id 2nrhe5h4cb-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Wed, 14 Nov 2018 08:08:00 -0500 Received: from localhost by e06smtp02.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Wed, 14 Nov 2018 13:07:58 -0000 Received: from b06cxnps3074.portsmouth.uk.ibm.com (9.149.109.194) by e06smtp02.uk.ibm.com (192.168.101.132) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Wed, 14 Nov 2018 13:07:55 -0000 Received: from d06av22.portsmouth.uk.ibm.com (d06av22.portsmouth.uk.ibm.com [9.149.105.58]) by b06cxnps3074.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id wAED7sXC61603862 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Wed, 14 Nov 2018 13:07:54 GMT Received: from d06av22.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 2D9BF4C04E; Wed, 14 Nov 2018 13:07:54 +0000 (GMT) Received: from d06av22.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 0608A4C046; Wed, 14 Nov 2018 13:07:54 +0000 (GMT) Received: from oc6142347168.ibm.com (unknown [9.152.222.44]) by d06av22.portsmouth.uk.ibm.com (Postfix) with ESMTP; Wed, 14 Nov 2018 13:07:53 +0000 (GMT) From: Robin Dapp To: gcc-patches@gcc.gnu.org Cc: krebbel@linux.ibm.com, iii@linux.ibm.com Subject: [PATCH 1/6] ifcvt: Store the number of created cmovs. Date: Wed, 14 Nov 2018 14:07:47 +0100 In-Reply-To: <20181114130752.5057-1-rdapp@linux.ibm.com> References: <20181114130752.5057-1-rdapp@linux.ibm.com> x-cbid: 18111413-0008-0000-0000-00000292B22E X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 18111413-0009-0000-0000-000021FCC75E Message-Id: <20181114130752.5057-2-rdapp@linux.ibm.com> This patch saves the number of created conditional moves by noce_convert_multiple_sets in the IF_INFO struct. This may be used by the backend to easier decide whether to accept a generated sequence or not. --- gcc/ChangeLog: 2018-11-14 Robin Dapp * ifcvt.c (noce_convert_multiple_sets): Set cmov count. (noce_find_if_block): Set cmov count. * ifcvt.h (struct noce_if_info): Add cmov count. --- gcc/ifcvt.c | 10 ++++++++-- gcc/ifcvt.h | 4 ++++ 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/gcc/ifcvt.c b/gcc/ifcvt.c index 8b3907618e7..ddf077fa051 100644 --- a/gcc/ifcvt.c +++ b/gcc/ifcvt.c @@ -3247,9 +3247,14 @@ noce_convert_multiple_sets (struct noce_if_info *if_info) /* Actually emit the sequence if it isn't too expensive. */ rtx_insn *seq = get_insns (); + if_info->transform_name = "noce_convert_multiple_sets"; + if_info->created_cmovs = count; + if (!targetm.noce_conversion_profitable_p (seq, if_info)) { end_sequence (); + if_info->transform_name = ""; + if_info->created_cmovs = 0; return FALSE; } @@ -3296,7 +3301,7 @@ noce_convert_multiple_sets (struct noce_if_info *if_info) } num_updated_if_blocks++; - if_info->transform_name = "noce_convert_multiple_sets"; + return TRUE; } @@ -4060,7 +4065,8 @@ noce_find_if_block (basic_block test_bb, edge then_edge, edge else_edge, and jump_insns are always given a cost of 1 by seq_cost, so treat both instructions as having cost COSTS_N_INSNS (1). */ if_info.original_cost = COSTS_N_INSNS (2); - + if_info.transform_name = ""; + if_info.created_cmovs = 0; /* Do the real work. */ diff --git a/gcc/ifcvt.h b/gcc/ifcvt.h index a18ba94b8df..50f40bbd1e5 100644 --- a/gcc/ifcvt.h +++ b/gcc/ifcvt.h @@ -108,6 +108,10 @@ struct noce_if_info /* The name of the noce transform that succeeded in if-converting this structure. Used for debugging. */ const char *transform_name; + + /* The number of created conditional moves in case we convert multiple + sets. */ + unsigned int created_cmovs; }; #endif /* GCC_IFCVT_H */