From patchwork Mon Jul 17 07:58:35 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aldy Hernandez X-Patchwork-Id: 121102 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:c923:0:b0:3e4:2afc:c1 with SMTP id j3csp967138vqt; Mon, 17 Jul 2023 00:59:30 -0700 (PDT) X-Google-Smtp-Source: APBJJlEAx0T2IU7EOSXOj7C/N9mD/eSgdHg1fQ3kayswyaLLkiDInVCMtHpn0hMjOPDysnJl2ZEh X-Received: by 2002:a05:6402:1510:b0:51d:f904:ff0c with SMTP id f16-20020a056402151000b0051df904ff0cmr11003076edw.29.1689580770752; Mon, 17 Jul 2023 00:59:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689580770; cv=none; d=google.com; s=arc-20160816; b=NS99u+xMHJUB/gcsYKc9usgEbGEEXIwZ2UGQCC+yu0c8o80DvqPU+xokNF+iGmh6x4 /jZTKlwQTYiQgsDLux0mo0h7VwXy4sMF+TeLu5yazhIQPI7FBOqDH0HPxk79bQo29ky4 +hTfuEBZJ4zZR4jSkvWgLrzuvifcTTFrU0NNg6OuzS1L5lTrlcqtf3CWrQFSkyJ/CaAI wXHVyjwg9olY1v8m7NwEPyGC7wMLCYC3kd3vt0Pp1yXcGLCME152+pxNsj3wWOefnyR8 vdqBoEZyhJoCQJytd7wW8UixW0pq0fSVl0tsMpFmZGqsCKlTQFhVU4OHA1gOaNcq2jkf Q7MQ== 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:message-id:date:subject:cc :to:dmarc-filter:delivered-to:dkim-signature:dkim-filter; bh=7MCFFG1fsfKJPaTmHiJ1g5wqNpGQEKmJ0xyZOzSJXZs=; fh=8Wv9Q4byB+RANPB/IaRWsgj1YW927JQIDuq4AMMsBqg=; b=V32UvhCIRVj3XTP6MxupnMTZniThNrKgCS+44W+4JWx8rlihV2f0ogPEPbGOFMb37N FJORt5qXXxsS+TetMe1ykwbZU7O7Qi5HzEKW0MnJb7ayfaTZ9uS7FeSjxcXJB7qZ42md S9iAnxejWmKuZzz0SCFkecyfiy644s0OL+BmuYktRVS3jtuHyuhffXSJ1L1/BQsuNHGR q7x/nueis+i25Tui+mZSjdn10hSBDVJlULP2n/3emGYrLfZXT+oBmEx8ACDtY4rpopgf Px5edkalBpww5tbmZDVYLeaNvDVUvQcfmsckkQWXwDutH7i7hDvGPzWPJd6jBI+mPERH ixBw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=x+319XIb; 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"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gnu.org Received: from server2.sourceware.org (server2.sourceware.org. [2620:52:3:1:0:246e:9693:128c]) by mx.google.com with ESMTPS id y13-20020a50e60d000000b0051df91e0b95si14018090edm.253.2023.07.17.00.59.30 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 Jul 2023 00:59:30 -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=@gcc.gnu.org header.s=default header.b=x+319XIb; 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"; 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 9DAB93858C50 for ; Mon, 17 Jul 2023 07:59:29 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 9DAB93858C50 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1689580769; bh=7MCFFG1fsfKJPaTmHiJ1g5wqNpGQEKmJ0xyZOzSJXZs=; h=To:Cc:Subject:Date:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:From:Reply-To:From; b=x+319XIba+TeGcM/pTPLkOW8tDLa1gvcBp8J0CJzTklstR+Nd+b3HbXHGTtVoX0bS aY7KukP9BG+dvbphOeaNh3iemnZ6SdQ5sYrhwubz2ZiEgbQrf3m7BzlL005sGHBRq7 ACMHfjp9V0OiN3Iq1TFJpCZrtAk8R8htbqT/PEwI= 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 073C53858D1E for ; Mon, 17 Jul 2023 07:58:46 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 073C53858D1E Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-333-QDcf6QisP5-KIwLVdCOHYQ-1; Mon, 17 Jul 2023 03:58:45 -0400 X-MC-Unique: QDcf6QisP5-KIwLVdCOHYQ-1 Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.rdu2.redhat.com [10.11.54.9]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 18AB4800969; Mon, 17 Jul 2023 07:58:45 +0000 (UTC) Received: from abulafia.quesejoda.com (unknown [10.39.193.153]) by smtp.corp.redhat.com (Postfix) with ESMTPS id A70B2492B01; Mon, 17 Jul 2023 07:58:44 +0000 (UTC) Received: from abulafia.quesejoda.com (localhost [127.0.0.1]) by abulafia.quesejoda.com (8.17.1/8.17.1) with ESMTPS id 36H7wgJe244298 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT); Mon, 17 Jul 2023 09:58:42 +0200 Received: (from aldyh@localhost) by abulafia.quesejoda.com (8.17.1/8.17.1/Submit) id 36H7wgDL244297; Mon, 17 Jul 2023 09:58:42 +0200 To: GCC patches Cc: Andrew MacLeod , Martin Jambor , Aldy Hernandez Subject: [PATCH] Export value/mask known bits from IPA. Date: Mon, 17 Jul 2023 09:58:35 +0200 Message-Id: <20230717075834.244277-1-aldyh@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.9 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-Spam-Status: No, score=-11.4 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H4, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_NONE, 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: Aldy Hernandez via Gcc-patches From: Aldy Hernandez Reply-To: Aldy Hernandez Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org Sender: "Gcc-patches" X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1771653846231039677 X-GMAIL-MSGID: 1771653846231039677 Currently IPA throws away the known 1 bits because VRP and irange have traditionally only had a way of tracking known 0s (set_nonzero_bits). With the ability to keep all the known bits in the irange, we can now save this between passes. OK? gcc/ChangeLog: * ipa-prop.cc (ipcp_update_bits): Export value/mask known bits. --- gcc/ipa-prop.cc | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/gcc/ipa-prop.cc b/gcc/ipa-prop.cc index d2b998f8af5..5d790ff1265 100644 --- a/gcc/ipa-prop.cc +++ b/gcc/ipa-prop.cc @@ -5853,10 +5853,9 @@ ipcp_update_bits (struct cgraph_node *node, ipcp_transformation *ts) { unsigned prec = TYPE_PRECISION (TREE_TYPE (ddef)); signop sgn = TYPE_SIGN (TREE_TYPE (ddef)); - - wide_int nonzero_bits = wide_int::from (bits[i]->mask, prec, UNSIGNED) - | wide_int::from (bits[i]->value, prec, sgn); - set_nonzero_bits (ddef, nonzero_bits); + wide_int mask = wide_int::from (bits[i]->mask, prec, UNSIGNED); + wide_int value = wide_int::from (bits[i]->value, prec, sgn); + set_bitmask (ddef, value, mask); } else {