From patchwork Thu May 25 12:35:51 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Manolis Tsamis X-Patchwork-Id: 99002 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp333735vqr; Thu, 25 May 2023 05:37:21 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ69L6Yvo/TNnVajC8UJc6Cp5A6LyUvKFvb82G7DC8ZpngHpJVD8vTPHYa+1qkRP4g9UIfka X-Received: by 2002:a17:907:3faa:b0:970:c9f:2db6 with SMTP id hr42-20020a1709073faa00b009700c9f2db6mr1333845ejc.63.1685018240820; Thu, 25 May 2023 05:37:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685018240; cv=none; d=google.com; s=arc-20160816; b=I1TLxKK+ODfQ2qcI8BM0aPpZc9EcTxkitn2oVfY+KO1vdHww5KaO4N6yCNWsiNqHLh UdCGJZW3edb2K9nAlRNi0VMdrWNC35FdgEQFouFfXJG48ljcbVG0HtkMH6yPNrRZ3nYN 5F82sSflVbmnfouKD+/gNVmRK7vcxqSBeZGRAXuvO6jdTbgUZskfDM3hmB+ucp0gi7u8 nYQxxzdolksbfrpJ7gS+u+qOeoVLxVuLI2/wF8sEGsIrcN8VJCRdO6FVbJBf2euZDmPl NQcXJ/FoG/38T3VOQm0kpO05GiEWuLgcYTvB3HaglgNdtHmfjTkOwmJG344iynpnXxEQ WGUg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature:dmarc-filter:delivered-to; bh=jn7HuYfKmeBSp4cDidN65NXPyZM0y1O5sBkz3BSSGKA=; b=csp/KAfhqdZ9JeDdSvYu7swMR19LdfSumeYCU4T6wIwkgrKEsZabiXsczZHvVOAP7X Os4Xtgd8qz+dQK3dbRADAp8bd9osniMDk+R8li7/RXhJdyG0SnhfwdzY0Ej+Cvz07WSd a2okJaS6dDXGYlD41c/zGK+ViQuRG2A/MONeIrT+QgiUe94/erfWDCB3zQykIGadamhD FEhgx2MDNMaKwXBO/zLRj1ypm/tc4FIrMGTIxgoTPCc9wrb6u1keDnPxl111vZPk+Blz 9IcFxFP3QdwQO5Yxm6lur2e0hm5iY0ylMtRaiRasrMSbJ9NKqpB6ZJGWNb2jKPKf51uh nwyA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@vrull.eu header.s=google header.b=n9B9Yiwp; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org" Received: from sourceware.org (server2.sourceware.org. [2620:52:3:1:0:246e:9693:128c]) by mx.google.com with ESMTPS id gg35-20020a17090689a300b0094f56d993a2si228164ejc.165.2023.05.25.05.37.20 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 May 2023 05:37:20 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) client-ip=2620:52:3:1:0:246e:9693:128c; Authentication-Results: mx.google.com; dkim=pass header.i=@vrull.eu header.s=google header.b=n9B9Yiwp; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org" Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id E74053856092 for ; Thu, 25 May 2023 12:36:51 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-lj1-x236.google.com (mail-lj1-x236.google.com [IPv6:2a00:1450:4864:20::236]) by sourceware.org (Postfix) with ESMTPS id 986E2385842C for ; Thu, 25 May 2023 12:36:25 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 986E2385842C Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=vrull.eu Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=vrull.eu Received: by mail-lj1-x236.google.com with SMTP id 38308e7fff4ca-2af290cf9b7so5199621fa.3 for ; Thu, 25 May 2023 05:36:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vrull.eu; s=google; t=1685018184; x=1687610184; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=jn7HuYfKmeBSp4cDidN65NXPyZM0y1O5sBkz3BSSGKA=; b=n9B9YiwpsApnUAVhNSTtocy7zNYf3moQTUKgsxVTpkJSr1wejMbyqE2aPDl0j2n3a7 bQZtKoAqqMBun7ovYAWoX857sTgG2mxYiF+Vfeiju0iShKqpGLCRUmsG037cAdlhWrx2 PNrGOh6epoydciPSr92CfXlEYe8k7AXCGU20+GS2NvWkTBnVszd7CJ3j7eWYdNGgEtfo j00w0rZck1GJbfcJi24uNXDjzPArFUnm9FyFMmn6nTn6hx8Fya5oz5GZyC6jmxbiaQYL JB6JTLDNsRQq79STit1Z6k/TzbyyagdZj8ZesQnKnfogBoxYKJ2peH9gcqGNDYSEQdbI 2Oqg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1685018184; x=1687610184; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=jn7HuYfKmeBSp4cDidN65NXPyZM0y1O5sBkz3BSSGKA=; b=csMYe6oxc4RkpoiMgTxn3S4f3GgxnlIsZHzoj4TOdYrooVG7psTyOhoevH2zbbnnyO Iiygntoaon0XsUXbQES646ryFtoKUjJQIyM+nqc6ezmr9kbxSzhOZQAFkG5kGYUfuG+7 jofLNoF9Gnyxi5GGEnVt/Aup9d/+X+v1N8cT6I/f+/Y7ugN10aBweQE7mdMJ217wK/qU AUxFs1iNZBfw4fgsOTz3mU+G3Qt80btqxN8d2J+z2mO5ek8nBi2f7Yx5pkDpm0180UW7 1+6FS06FWwWf63/bzo32I8f1nQ6qXKbbE8M+Sb/mkWr31nACEnd1NjymmwRaidIRWLet o/JQ== X-Gm-Message-State: AC+VfDxgtyDM0ZsAg+qz8ohnVMr2S0C+FRzpYSaIOc92zAkNX6zzgCUZ DlzzodK86pjjAji/32Y1vDzowGTFMxlswiGL9L93pQ== X-Received: by 2002:a2e:9187:0:b0:2ac:83bb:ab46 with SMTP id f7-20020a2e9187000000b002ac83bbab46mr957585ljg.30.1685018183905; Thu, 25 May 2023 05:36:23 -0700 (PDT) Received: from helsinki-03.engr ([2a01:4f9:6b:2a47::2]) by smtp.gmail.com with ESMTPSA id l7-20020a2eb687000000b002a774fb7923sm236631ljo.45.2023.05.25.05.36.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 May 2023 05:36:23 -0700 (PDT) From: Manolis Tsamis To: gcc-patches@gcc.gnu.org Cc: Richard Biener , Palmer Dabbelt , Philipp Tomsich , Kito Cheng , Manolis Tsamis Subject: [PATCH 2/2] cprop_hardreg: Enable propagation of the stack pointer if possible. Date: Thu, 25 May 2023 14:35:51 +0200 Message-Id: <20230525123550.1072506-3-manolis.tsamis@vrull.eu> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230525123550.1072506-1-manolis.tsamis@vrull.eu> References: <20230525123550.1072506-1-manolis.tsamis@vrull.eu> MIME-Version: 1.0 X-Spam-Status: No, score=-12.1 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, JMQ_SPF_NEUTRAL, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE 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.29 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 Sender: "Gcc-patches" X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1766869686817591015?= X-GMAIL-MSGID: =?utf-8?q?1766869686817591015?= Propagation of the stack pointer in cprop_hardreg is currenty forbidden in all cases, due to maybe_mode_change returning NULL. Relax this restriction and allow propagation when no mode change is requested. gcc/ChangeLog: * regcprop.cc (maybe_mode_change): Enable stack pointer propagation. Signed-off-by: Manolis Tsamis --- gcc/regcprop.cc | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/gcc/regcprop.cc b/gcc/regcprop.cc index f426f4fedcd..6cbfadb181f 100644 --- a/gcc/regcprop.cc +++ b/gcc/regcprop.cc @@ -422,7 +422,12 @@ maybe_mode_change (machine_mode orig_mode, machine_mode copy_mode, It's unclear if we need to do the same for other special registers. */ if (regno == STACK_POINTER_REGNUM) - return NULL_RTX; + { + if (orig_mode == new_mode) + return stack_pointer_rtx; + else + return NULL_RTX; + } if (orig_mode == new_mode) return gen_raw_REG (new_mode, regno);