From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: 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 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=linux.ibm.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=linux.ibm.com 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 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding; s=pp1; bh=gttb78Zqljj3chgPKjuwQ9Pl+GwrGi0mZin/iND34Ag=; b=lUvaRHXwUwTKhp8wyBb23zzRDJTKyjD/M8MvIyl3Vx2kOy4KyGsSZHCV71c/UJ42INgX Z+dajf0gv5/dKxP8uTfzrOncffQDaj58ZQseExtVVfH/2vlD1ZUWZv4cfBtC9sTIwI7s aQbnWiOpnysubyWTqlFhZwqwYEcW2YvTzWx/PHY2pKIKkaskMfgF5gmhVUAHN/oDbmVt PZGfvXxQ0+wEkwaJ/K1lolUzvhMcVf9nAHM8/mUxmEY4KAUQDaRZ8sPIYZJq8PZdhBeS IY5rhDyEdERat1IaBTlUnzuNTlU/acb821KctNFPvsziqfz+OEjc7Q5gAioNo/axPA7q xA== 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) From: Stefan Schulze Frielinghaus To: gcc-patches@gcc.gnu.org Cc: Stefan Schulze Frielinghaus 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 Content-Transfer-Encoding: 8bit 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 List-Id: 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); -- 2.37.2