From patchwork Mon Jul 17 07:56:45 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aldy Hernandez X-Patchwork-Id: 1808576 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=2620:52:3:1:0:246e:9693:128c; helo=server2.sourceware.org; envelope-from=gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.a=rsa-sha256 header.s=default header.b=crVuTGr7; dkim-atps=neutral Received: from server2.sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4R4DvG5YCjz20Cs for ; Mon, 17 Jul 2023 17:57:14 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 89CEB3858433 for ; Mon, 17 Jul 2023 07:57:12 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 89CEB3858433 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1689580632; bh=IvoZk+6ddwd3Sn1ya38C57aIykBZxnE6bTsmOEFlZCA=; h=To:Cc:Subject:Date:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:From:Reply-To:From; b=crVuTGr7IT59Zez57mNtxEiS0r3UHsDjbyNuQLFtneBw1V4ofmAkvaOwGCcAoPLhy X2zQ5rgDLys1QanZM4iUcnlTC0Z3J+/5rSavpVl5ZLtPFMV2e8ey5rCpRscCU5O145 s2WN/ij68lgP2olWMWCFVp8E0DH8F6oJs9oA7zmM= 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 1B5453858D1E for ; Mon, 17 Jul 2023 07:56:53 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 1B5453858D1E 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-553-U0Ra9HFJM0KoEbEhm7H32A-1; Mon, 17 Jul 2023 03:56:50 -0400 X-MC-Unique: U0Ra9HFJM0KoEbEhm7H32A-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 82C8F830DAC for ; Mon, 17 Jul 2023 07:56:50 +0000 (UTC) Received: from abulafia.quesejoda.com (unknown [10.39.193.153]) by smtp.corp.redhat.com (Postfix) with ESMTPS id A5CD8C2C862; Mon, 17 Jul 2023 07:56:49 +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 36H7ultn243669 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT); Mon, 17 Jul 2023 09:56:47 +0200 Received: (from aldyh@localhost) by abulafia.quesejoda.com (8.17.1/8.17.1/Submit) id 36H7ulVN243668; Mon, 17 Jul 2023 09:56:47 +0200 To: GCC patches Cc: Andrew MacLeod , Aldy Hernandez Subject: [PATCH] Export value/mask known bits from CCP. Date: Mon, 17 Jul 2023 09:56:45 +0200 Message-Id: <20230717075645.243653-1-aldyh@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.8 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+incoming=patchwork.ozlabs.org@gcc.gnu.org Sender: "Gcc-patches" Currently CCP 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: * tree-ssa-ccp.cc (ccp_finalize): Export value/mask known bits. --- gcc/tree-ssa-ccp.cc | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/gcc/tree-ssa-ccp.cc b/gcc/tree-ssa-ccp.cc index 0d0f02a8442..64d5fa81334 100644 --- a/gcc/tree-ssa-ccp.cc +++ b/gcc/tree-ssa-ccp.cc @@ -1020,11 +1020,9 @@ ccp_finalize (bool nonzero_p) else { unsigned int precision = TYPE_PRECISION (TREE_TYPE (val->value)); - wide_int nonzero_bits - = (wide_int::from (val->mask, precision, UNSIGNED) - | wi::to_wide (val->value)); - nonzero_bits &= get_nonzero_bits (name); - set_nonzero_bits (name, nonzero_bits); + wide_int value = wi::to_wide (val->value); + wide_int mask = wide_int::from (val->mask, precision, UNSIGNED); + set_bitmask (name, value, mask); } }