Message ID | 20230717075645.243653-1-aldyh@redhat.com |
---|---|
State | Accepted |
Headers |
Return-Path: <gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:c923:0:b0:3e4:2afc:c1 with SMTP id j3csp966604vqt; Mon, 17 Jul 2023 00:57:37 -0700 (PDT) X-Google-Smtp-Source: APBJJlENu820ncqXZIcXRA8xK6vJLorgW12GeSq7ckUw7D0Q8fuj2Kvd9UKzOZGUKPkdflUcrn30 X-Received: by 2002:a05:6512:31c9:b0:4f9:5933:8eea with SMTP id j9-20020a05651231c900b004f959338eeamr8310948lfe.3.1689580657612; Mon, 17 Jul 2023 00:57:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689580657; cv=none; d=google.com; s=arc-20160816; b=KJRSZ2qiuRXlhlQj4KONI9OqeA3ZCvT2RF8i4n132GpI55Pt8CykHaTKtCF119amA0 kag2fPQL0XzXbqLIbbJiNIoM/0vRFe+MRmI1kbeoIh73GTvDOjxjFE3eeOZRviZLVuFz fCOEev8x4r4Dg7ndHLBfqTx4U6KBTfgox/2HfyqTa6F+DoFDJew4awAhsaNpQDHfYkx5 TmNVLk46F8ZI8mHJ5d7o0lphd5nAGP2sa5s5FOPpGIvSfbvt3KmYi4LlkOFsNrl6sHYn ucAZgrrj27/th6ZX+M1TeSJ9KQpF3dy7Wgy+rpLQTfFSMYXaweYJtcDnxEIQJqkrR698 y9EA== 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=IvoZk+6ddwd3Sn1ya38C57aIykBZxnE6bTsmOEFlZCA=; fh=96E5hNVsweIFOeUztpxi6Fa1ymOnLCviJJ16c5FIeFk=; b=Qz9LwxbFOb7BaFbO13BAm0G9IjL1uDMawmSB+iIzUF4ZIYG+1qpSvDECwQRunPcL1N StdGUGBU9WoaqMRBO/VfJ6u4DV5WhF6ZBDmnO6VzBKZMpbYDm5RlQVEDg3PEm8Nxo7d4 h/8yh11TBbq2afT70Ryb3oVXOEp4gARoGFQ0Ae3X0+mPxSiip9ID52HZgp42Yjeg/tUU AssdPtGF11oK/3nm6IZRjgvfZNtLARmJyztCiRxT16itWyAOEqxUK17QbhAZk6/NiOh0 JRji7LIBgidGeCuzIOpesbAUrAMD40zBVAZKhSnx0XQohgJUMcneu/GvBf+/Sur94/0I sTqw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=aHra3nnM; 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 (ip-8-43-85-97.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id v10-20020aa7d64a000000b0051e472983d1si12596244edr.524.2023.07.17.00.57.37 for <ouuuleilei@gmail.com> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 Jul 2023 00:57:37 -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=aHra3nnM; 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 4BC7B3858436 for <ouuuleilei@gmail.com>; Mon, 17 Jul 2023 07:57:36 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 4BC7B3858436 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1689580656; 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=aHra3nnM//alkvprIahP7HZsKfXRmPGdEX3Z2QPVvXW5Q6tEF8ozperc21xOiw5v9 kUc6Bq/AzvyHqQwToM34ZODnnUhFaIV7Hby/5Qr81Hg5T3P6+rQImFVPTcFT4fddbO x3702v7fC/+urHxSivEDi1E66F10rUECJxx9hiC4= 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 <gcc-patches@gcc.gnu.org>; 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 <gcc-patches@gcc.gnu.org>; 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 <gcc-patches@gcc.gnu.org> Cc: Andrew MacLeod <amacleod@redhat.com>, Aldy Hernandez <aldyh@redhat.com> 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 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="US-ASCII"; x-default=true 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 <gcc-patches.gcc.gnu.org> List-Unsubscribe: <https://gcc.gnu.org/mailman/options/gcc-patches>, <mailto:gcc-patches-request@gcc.gnu.org?subject=unsubscribe> List-Archive: <https://gcc.gnu.org/pipermail/gcc-patches/> List-Post: <mailto:gcc-patches@gcc.gnu.org> List-Help: <mailto:gcc-patches-request@gcc.gnu.org?subject=help> List-Subscribe: <https://gcc.gnu.org/mailman/listinfo/gcc-patches>, <mailto:gcc-patches-request@gcc.gnu.org?subject=subscribe> From: Aldy Hernandez via Gcc-patches <gcc-patches@gcc.gnu.org> Reply-To: Aldy Hernandez <aldyh@redhat.com> Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org Sender: "Gcc-patches" <gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org> X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1771653727511742811 X-GMAIL-MSGID: 1771653727511742811 |
Series |
Export value/mask known bits from CCP.
|
|
Checks
Context | Check | Description |
---|---|---|
snail/gcc-patch-check | success | Github commit url |
Commit Message
Aldy Hernandez
July 17, 2023, 7:56 a.m. UTC
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(-)
Comments
On Mon, Jul 17, 2023 at 9:57 AM Aldy Hernandez via Gcc-patches <gcc-patches@gcc.gnu.org> wrote: > > 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? 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); > } > } > > -- > 2.40.1 >
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); } }