From patchwork Fri Oct 27 14:23:41 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vladimir Makarov X-Patchwork-Id: 158959 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:d641:0:b0:403:3b70:6f57 with SMTP id cy1csp642377vqb; Fri, 27 Oct 2023 07:24:18 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFi7y2+o4sILkuWQumWTapVsq8tUFNrL6f2aGnGj0Tqg7IbrCGeHBhxZM4nVXhdKZxRgQyb X-Received: by 2002:a05:620a:2a03:b0:767:c30:517 with SMTP id o3-20020a05620a2a0300b007670c300517mr7095511qkp.3.1698416657674; Fri, 27 Oct 2023 07:24:17 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1698416657; cv=pass; d=google.com; s=arc-20160816; b=A6oEFrd23cV2HDZ60IDDgk8uYhl4+gS0zN7UErOdPndyvVb7qjyjwDhRKP73QYWftc xjiEIkCT2Hnxi73BicHQqu21Me+nfiWLS+NJzRwuOKDNdGiS5LTnH0f0dTscBcRq7Rgj Ci0856R5Fw1wHQTNjimjPDIPSyv6VR3wP4uVDnF5CCBIBsnsHAKWy5velGFwYt1RHN/4 W97e3LqHUe25B2xW0C8cPAYAtOMtEsP1NTq3W5A26OQjxiyzZbFldIqM0wxGLYl/s7Ye wIvB065r4wPro6nzkLCtGUBtj1uR9R8OsBny3eXdcUI9V/gwH7rgH6QGAFXHBSChEsCi akxg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-language:to:subject :from:user-agent:mime-version:date:message-id:dkim-signature :arc-filter:dmarc-filter:delivered-to; bh=Yg8lUsjM3cmNHp4eEoOXOmCcujh8Z/MTxQfDClf0zAA=; fh=XNn3asQvIblazGK92GBt13dVv+YmGV3pBS0JC29ZQco=; b=cBxY41ilLfBd1WxfBwnM/TDHgtI32ecXNj7mMK3MztnAMQTHS/N3ZAfVlNtxcxrUrO lD+xdfGKD4hVpvW4rRC7sUtGQfcad9a3273rPVrJBsEL6VpaX9Kx9MN4Mk9SbQFY85FE SV5AF2wxxkzHFbAiATDu//qdWxS1lxZT2C1MYHuzbuXsc++Ds6WU9zfzVrqigTRi4XIF mqeSpG83yzW+PBKNGzzBztS3RVz1unpafWG1ybXA2lkPk7Q+a9ptpdOyggXiVR411l50 6HA9n205cKo8vosgIKtP8pq/4ISQ+pa9L+OIGuvRT9ns5HW4JOxYW2GxSFEJKdp9S1MK OpXg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=QYT9Hbxp; arc=pass (i=1); spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from server2.sourceware.org (server2.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id o6-20020a05620a2a0600b007742129e1ebsi747492qkp.118.2023.10.27.07.24.17 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 27 Oct 2023 07:24:17 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) client-ip=8.43.85.97; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=QYT9Hbxp; arc=pass (i=1); spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 683A73860778 for ; Fri, 27 Oct 2023 14:24:17 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by sourceware.org (Postfix) with ESMTPS id 796343857C43 for ; Fri, 27 Oct 2023 14:23:51 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 796343857C43 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 796343857C43 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=170.10.129.124 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1698416632; cv=none; b=aj3kOwY3OvkR76bkMdYmxyHPEuW3rSQDa9FukptF4bqpMb8olIj1BDwo3W6KpBG8BrkW01t8feA0ARTz44WJHuacqWCiDp1SCRSHnExJo5PwRj/yTxHJgrcuA3kD9PFVwD9NO5itq2ORRtqgyKZRGmLm5bmvm6mTeIuO5TQ+Ca8= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1698416632; c=relaxed/simple; bh=QrsXRuisjg8MT3OL4KVWxRYWveR7FKp4ZMbSZLgjzpI=; h=DKIM-Signature:Message-ID:Date:MIME-Version:From:Subject:To; b=cs+mrqPcIL4g0msbZDYOEL5iSq1MAqpFWswEXfKq+o9i1KoNnwPqxOsvq8JEL0bruK1yWI6yHzFWu/XQ5MsQK3UkP9mJFYmLR6GoV/c5UgJJM87QxpA30fZnOaZL4e7x05TYvAGof7buVpwtTbAX0whtRHu9JgTc5o3wRDr8BbI= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1698416631; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type; bh=Yg8lUsjM3cmNHp4eEoOXOmCcujh8Z/MTxQfDClf0zAA=; b=QYT9Hbxp19XQ+Njmsmm8/vIgb2qbiFKKU9xfULI6sTqCUq+DGa2lxq2UE0gQqLZRXN94CN EEKE4p6BC7aS9qeDxkHADXJdifM10T/ocKZrjoZIbENtF68DVTzdIqVuQjViBvNlb3YUaG KTyfCo7d5Gcgau831Ipid4GwGO7m/Lg= Received: from mail-qk1-f199.google.com (mail-qk1-f199.google.com [209.85.222.199]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-193-UXND2TlNNf6QVCtl951vFQ-1; Fri, 27 Oct 2023 10:23:44 -0400 X-MC-Unique: UXND2TlNNf6QVCtl951vFQ-1 Received: by mail-qk1-f199.google.com with SMTP id af79cd13be357-7789f06778aso461271585a.0 for ; Fri, 27 Oct 2023 07:23:44 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698416623; x=1699021423; h=to:subject:from:content-language:user-agent:mime-version:date :message-id:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=moeN58PhXvAP8CRMdr1Zd8stTOKZzW7h86fnLW7+57E=; b=AI808qBONXLFewXvd3VcYvhgsZGUIP+QuAAEW7RUtLmGhi4tkIfTgghhsYBDnjdWX6 4qECdlEtfj5topUNrvD4cfYa0Fu/fBDHjBsczryyHhmFFwQF4A7+BU6qSk7xnnj6gfCH s87sP0JCyeBWM1zC1MPcK3gP1LUo1le8eBvq7Sox7LQNtHC8EbuX9nBbzEnV1ThFO46e 56lFH0jqHJ9fFxCfzZO6DQoREXrUE3h4vaPUviMEHAQZzkLVBa1Sj0hwMnQAXJcKKWzR YPRogMCJeXVFksFHVXBe+O2FNX0bL9h98/tyEyTp1AFZ+JVMpnSDSqEEA7j5LnGrh0R5 +Zkg== X-Gm-Message-State: AOJu0YwwS7llwdbuwl88XaD2E6lcehZG6xE2ET9ZWljteT3L3q4/97kG 0f8uWLU+cp3tgRe55BhLAfiD55za0hmyYBWCL/S3SyhJ0owrvR1Yub4D4XkhrYBb79jXbUnbOSs m0senyMjmtgyWP6RDjzGzH43d9Wku5ra9DYFhGZvf0fFBXCVtsnM2nnyY3IdhPJz2mKJOoUsF6y NGCQ== X-Received: by 2002:a05:620a:171e:b0:76f:1614:577a with SMTP id az30-20020a05620a171e00b0076f1614577amr7222329qkb.5.1698416623713; Fri, 27 Oct 2023 07:23:43 -0700 (PDT) X-Received: by 2002:a05:620a:171e:b0:76f:1614:577a with SMTP id az30-20020a05620a171e00b0076f1614577amr7222301qkb.5.1698416623316; Fri, 27 Oct 2023 07:23:43 -0700 (PDT) Received: from [192.168.1.88] (23-233-12-249.cpe.pppoe.ca. [23.233.12.249]) by smtp.gmail.com with ESMTPSA id s5-20020a05620a254500b007757f6558b3sm575657qko.95.2023.10.27.07.23.42 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 27 Oct 2023 07:23:42 -0700 (PDT) Message-ID: <583aa85a-7b5c-bcda-35cd-f275da69c7cc@redhat.com> Date: Fri, 27 Oct 2023 10:23:41 -0400 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.13.0 From: Vladimir Makarov Subject: [pushed] [RA]: Add cost calculation for reg equivalence invariants To: "gcc-patches@gcc.gnu.org" X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Language: en-US X-Spam-Status: No, score=-10.9 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, KAM_SHORT, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H4, RCVD_IN_MSPIKE_WL, RCVD_IN_SORBS_WEB, SPF_HELO_NONE, SPF_NONE, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1780918945094678752 X-GMAIL-MSGID: 1780918945094678752 The following patch fixes one aarch64 GCC test failure resulted from my previous patch dealing with reg equivalences. The patch was successfully bootstrapped and tested on x86-64, aarch64, ppc64le. commit 9b03e1d20c00dca215b787a5e959db473325b660 Author: Vladimir N. Makarov Date: Fri Oct 27 08:28:24 2023 -0400 [RA]: Add cost calculation for reg equivalence invariants My recent patch improving cost calculation for pseudos with equivalence resulted in failure of gcc.target/arm/eliminate.c on aarch64. This patch fixes this failure. gcc/ChangeLog: * ira-costs.cc: (get_equiv_regno, calculate_equiv_gains): Process reg equivalence invariants. diff --git a/gcc/ira-costs.cc b/gcc/ira-costs.cc index a59d45a6e24..c4086807076 100644 --- a/gcc/ira-costs.cc +++ b/gcc/ira-costs.cc @@ -1784,6 +1784,7 @@ get_equiv_regno (rtx x, int ®no, rtx &subreg) } if (REG_P (x) && (ira_reg_equiv[REGNO (x)].memory != NULL + || ira_reg_equiv[REGNO (x)].invariant != NULL || ira_reg_equiv[REGNO (x)].constant != NULL)) { regno = REGNO (x); @@ -1826,6 +1827,7 @@ calculate_equiv_gains (void) for (regno = max_reg_num () - 1; regno >= FIRST_PSEUDO_REGISTER; regno--) if (ira_reg_equiv[regno].init_insns != NULL && (ira_reg_equiv[regno].memory != NULL + || ira_reg_equiv[regno].invariant != NULL || (ira_reg_equiv[regno].constant != NULL /* Ignore complicated constants which probably will be placed in memory: */ @@ -1876,6 +1878,8 @@ calculate_equiv_gains (void) if (subst == NULL) subst = ira_reg_equiv[regno].constant; + if (subst == NULL) + subst = ira_reg_equiv[regno].invariant; ira_assert (subst != NULL); mode = PSEUDO_REGNO_MODE (regno); ira_init_register_move_cost_if_necessary (mode);