From patchwork Wed Sep 7 14:20:25 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Schulze Frielinghaus X-Patchwork-Id: 1071 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:5044:0:0:0:0:0 with SMTP id h4csp1166809wrt; Wed, 7 Sep 2022 07:21:39 -0700 (PDT) X-Google-Smtp-Source: AA6agR73NPyQnZrJukXkTD1cf7WWlqKUEKTYpFTob0W85gOwnnNTmv2yuYyJSMCuuWmLcrmoY0GI X-Received: by 2002:aa7:c707:0:b0:44e:5193:1b0f with SMTP id i7-20020aa7c707000000b0044e51931b0fmr3245011edq.238.1662560499137; Wed, 07 Sep 2022 07:21:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1662560499; cv=none; d=google.com; s=arc-20160816; b=S7Kck/cy1Bs7zgPFvkhrQr+Vf+W7ste48TZ+HJTlgQRn3cSMXpNf89CehwZIGIdap8 kAzeIS3jTfUIDo9BA2gzMQsCZKoRQDK1YdV5DXWBnqbWOAVohHBGCSS5EVXUTVh7KSLS WWcWiZM9+/ui4cekPohGe0T8eFmdtQiSrPaShoE3wfwJR/vOhtZMSELapXYoqEDKn0sW 6WjS2EY4I/exNvHCw9I2cI101E24O/xtNPU1Fh5mE2y1i5rrdv5PIbeGIJCIE4UnXTwo fIEU4tCgmCAqJqLfFOcVMl2EuWXYLhBQSrOMa0Q19w5tE1NYirXpkfksTYJzVfuEl+yO HEYQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:reply-to:from: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:to:dmarc-filter:delivered-to:dkim-signature :dkim-filter; bh=gttb78Zqljj3chgPKjuwQ9Pl+GwrGi0mZin/iND34Ag=; b=MEXtjgGSkNxl7X2hIxp5e3abk5z0vOo8vcnzbbVWT1JinEeZZ1pxjZ1d0XPq8tniT/ DnhWI4liKA/69b5H6lZV8b7qXUTg1fRTql+NxuD331G1CWGguOb31ehX98JvQNixt13M n/Jxc831+t8c+vYJTVByjbkmHk9EJGn0bVfzJwp+iS1YNlyutTikCl9in1+/0mGBhsvK /JrBYN4vkjXyKfqpjVGsDKOat6yYpjbS31qok4GySFCO7HBW7w6sFytQE7LUJRfdStD3 CvbMbjZMy9zj214qgi6oZltIvUAheX38XJj05LvBVyLI/e1YOY2kbjsW2nJ1OxByxx8g S0hA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=Z8ALj5+T; 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=gnu.org Received: from sourceware.org (server2.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id lb20-20020a170907785400b0073da0e4b911si11487859ejc.514.2022.09.07.07.21.38 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 07 Sep 2022 07:21:39 -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=@gcc.gnu.org header.s=default header.b=Z8ALj5+T; 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=gnu.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id D41C3384D1A7 for ; Wed, 7 Sep 2022 14:21:28 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org D41C3384D1A7 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1662560488; bh=gttb78Zqljj3chgPKjuwQ9Pl+GwrGi0mZin/iND34Ag=; h=To:Subject:Date:In-Reply-To:References:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=Z8ALj5+Tk/qMNBTlNYJ5GtKUlGAT7FkgghCszZWy/NWNks+tUftRYVgHKONaRZNq6 /VunuiFa8O4znLsOKwiKuwomlYgcINB0+vmHpBVlWRPa+dmxrgQpyMqxYAJtS2kOWg Ey1iCx04y4RG/c6ZyRXKeaxV034AIGxxpA1Dug5o= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mx0a-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) by sourceware.org (Postfix) with ESMTPS id 22F8E3857C7C for ; Wed, 7 Sep 2022 14:20:45 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 22F8E3857C7C Received: from pps.filterd (m0098419.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 287EAUun008657 for ; Wed, 7 Sep 2022 14:20:43 GMT Received: from ppma04ams.nl.ibm.com (63.31.33a9.ip4.static.sl-reverse.com [169.51.49.99]) by mx0b-001b2d01.pphosted.com (PPS) with ESMTPS id 3jev93hskm-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Wed, 07 Sep 2022 14:20:43 +0000 Received: from pps.filterd (ppma04ams.nl.ibm.com [127.0.0.1]) by ppma04ams.nl.ibm.com (8.16.1.2/8.16.1.2) with SMTP id 287E68VH021498 for ; Wed, 7 Sep 2022 14:20:41 GMT Received: from b06avi18626390.portsmouth.uk.ibm.com (b06avi18626390.portsmouth.uk.ibm.com [9.149.26.192]) by ppma04ams.nl.ibm.com with ESMTP id 3jbxj8w9vf-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Wed, 07 Sep 2022 14:20:41 +0000 Received: from d06av23.portsmouth.uk.ibm.com (d06av23.portsmouth.uk.ibm.com [9.149.105.59]) by b06avi18626390.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 287EH7cD36766178 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 7 Sep 2022 14:17:07 GMT Received: from d06av23.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 57C88A404D; Wed, 7 Sep 2022 14:20:38 +0000 (GMT) Received: from d06av23.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 34F1FA4040; Wed, 7 Sep 2022 14:20:38 +0000 (GMT) Received: from t8345026.lnxne.boe (unknown [9.152.108.100]) by d06av23.portsmouth.uk.ibm.com (Postfix) with ESMTPS; Wed, 7 Sep 2022 14:20:38 +0000 (GMT) To: gcc-patches@gcc.gnu.org Subject: [PATCH 1/2] cselib: Keep track of further subvalue relations Date: Wed, 7 Sep 2022 16:20:25 +0200 Message-Id: <20220907142026.936922-2-stefansf@linux.ibm.com> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220907142026.936922-1-stefansf@linux.ibm.com> References: <20220907142026.936922-1-stefansf@linux.ibm.com> MIME-Version: 1.0 X-TM-AS-GCONF: 00 X-Proofpoint-GUID: 5vbnGA5Fcrmjec6m3E5uOH_poZt43nry X-Proofpoint-ORIG-GUID: 5vbnGA5Fcrmjec6m3E5uOH_poZt43nry X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.895,Hydra:6.0.528,FMLib:17.11.122.1 definitions=2022-09-07_08,2022-09-07_02,2022-06-22_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 adultscore=0 lowpriorityscore=0 suspectscore=0 clxscore=1015 impostorscore=0 mlxlogscore=542 phishscore=0 spamscore=0 malwarescore=0 priorityscore=1501 bulkscore=0 mlxscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2207270000 definitions=main-2209070055 X-Spam-Status: No, score=-8.4 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_MSPIKE_H2, 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: , X-Patchwork-Original-From: Stefan Schulze Frielinghaus via Gcc-patches From: Stefan Schulze Frielinghaus Reply-To: Stefan Schulze Frielinghaus 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?1743321037796549866?= X-GMAIL-MSGID: =?utf-8?q?1743321037796549866?= Whenever a new cselib value is created check whether a smaller value exists which is contained in the bigger one. If so add a subreg relation to locs of the smaller one. gcc/ChangeLog: * cselib.cc (new_cselib_val): Keep track of further subvalue relations. --- gcc/cselib.cc | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/gcc/cselib.cc b/gcc/cselib.cc index 6a5609786fa..9b582e5d3d6 100644 --- a/gcc/cselib.cc +++ b/gcc/cselib.cc @@ -1569,6 +1569,26 @@ new_cselib_val (unsigned int hash, machine_mode mode, rtx x) e->locs = 0; e->next_containing_mem = 0; + scalar_int_mode int_mode; + if (REG_P (x) && is_int_mode (mode, &int_mode) + && REG_VALUES (REGNO (x)) != NULL + && (!cselib_current_insn || !DEBUG_INSN_P (cselib_current_insn))) + { + rtx copy = shallow_copy_rtx (x); + scalar_int_mode narrow_mode_iter; + FOR_EACH_MODE_UNTIL (narrow_mode_iter, int_mode) + { + PUT_MODE_RAW (copy, narrow_mode_iter); + cselib_val *v = cselib_lookup (copy, narrow_mode_iter, 0, VOIDmode); + if (v) + { + rtx sub = lowpart_subreg (narrow_mode_iter, e->val_rtx, int_mode); + if (sub) + new_elt_loc_list (v, sub); + } + } + } + if (dump_file && (dump_flags & TDF_CSELIB)) { fprintf (dump_file, "cselib value %u:%u ", e->uid, hash);