From patchwork Mon May 22 18:38:34 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aldy Hernandez X-Patchwork-Id: 97563 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp1646480vqo; Mon, 22 May 2023 11:39:42 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6tKQayRqawoT4Jtz9eMHEbiEig0Il90V//mf/oK2wCIXxdAZh/R5doUexAxrXV47t6x/HA X-Received: by 2002:a17:907:3184:b0:94f:3521:396 with SMTP id xe4-20020a170907318400b0094f35210396mr9513323ejb.23.1684780782470; Mon, 22 May 2023 11:39:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684780782; cv=none; d=google.com; s=arc-20160816; b=TBMhV2/K1oSpsFPeEpRbwj4ExLQ0HzBqWUnPGR3z14xi8WsF27G4lG357UNTJz3v6c rhftYT/H8HbSD7tAhY488/76pXKywzf64bfiC/+pcNNVGX4yPPMpEcPGeI9A9J+ukUD/ d+q7ehtBq1k4wfVG45+A3RXrzoOqYne9Re9UUBZeVoy2nZx+Dxs82n65rRSy++P2/tXo 9a8XHqHyjwJEPeftfASYpcJUb/8L4FrSVPC2O0ofnWIweL+YGrOdma3QgKn0fyI/qTcS f2Wxh+rUnc3oYr04P9j1QEMdmM6ceH3gwZRJ7K060Op478spTPqjXNi82PfX2maOa3e+ h0mQ== 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=F3c7shr/m5fDs7SVUSPJyF6zO6hXPFk5+uzMAmKSF1g=; b=VVPaxFhoxTp47denX+Q5ImgdogxYBBBMeWaktfRsfmLcwwcHFp0eqkhduEyCa5Rn+d Sq7rNrt58VHYaMLp0Fi/snNejdl7JMNkaGlXMvOgb/HEPbwdWjBx36i3397iW7fxxqRK 2+gZt9mWCRpCSeLoP6IcU79XXegbo2facuVmPEr3n9zMujiOeCFCGlpYLI0PINZ8ekzq qDFHKGF8s7QWKGzW0vBhr3CBtrODh/sD/3yNLqZnAHoyVXl4CCQ+fn8xBW6+1PY7bfRs NZ4uEC5gc3Te0yJIJNhsQA8h7VvWDTr3mox+i67x72wCduPvik1wJNre6KVTPgAZshNV nm9A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b="U+MJOTn/"; 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 sourceware.org (server2.sourceware.org. [2620:52:3:1:0:246e:9693:128c]) by mx.google.com with ESMTPS id d12-20020a1709064c4c00b0096f93486376si4109997ejw.577.2023.05.22.11.39.42 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 May 2023 11:39:42 -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="U+MJOTn/"; 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 253973858C36 for ; Mon, 22 May 2023 18:39:41 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 253973858C36 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1684780781; bh=F3c7shr/m5fDs7SVUSPJyF6zO6hXPFk5+uzMAmKSF1g=; h=To:Cc:Subject:Date:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:From:Reply-To:From; b=U+MJOTn/l4GW6MWUAQ3X3pDVREbbRpoXY7YCxcU4AOy58Z0DEccmiGoEPLaXzRdLH H8/1qFBnagaksoL5tP038kOIVQ0CE2dFy6tOq3p5loGYknqckSf678dH28G0Ap9F/i CXlOtvdvBXt/cF44PFnlD/pgAS71DTu8c5U3tlj8= 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 A733B3858D35 for ; Mon, 22 May 2023 18:38:57 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org A733B3858D35 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-189-IxrU0OnfMUiU801vCzWGBg-1; Mon, 22 May 2023 14:38:55 -0400 X-MC-Unique: IxrU0OnfMUiU801vCzWGBg-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 4F368802E58 for ; Mon, 22 May 2023 18:38:55 +0000 (UTC) Received: from abulafia.quesejoda.com (unknown [10.39.192.26]) by smtp.corp.redhat.com (Postfix) with ESMTPS id DBFA3C1ED99; Mon, 22 May 2023 18:38:54 +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 34MIcrsx535782 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT); Mon, 22 May 2023 20:38:53 +0200 Received: (from aldyh@localhost) by abulafia.quesejoda.com (8.17.1/8.17.1/Submit) id 34MIcqLo535781; Mon, 22 May 2023 20:38:52 +0200 To: GCC patches Cc: Andrew MacLeod , Aldy Hernandez Subject: [COMMITTED] Implement some miscellaneous zero accessors for Value_Range. Date: Mon, 22 May 2023 20:38:34 +0200 Message-Id: <20230522183834.535767-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.3 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_H2, 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: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1766620693615884327?= X-GMAIL-MSGID: =?utf-8?q?1766620693615884327?= This adds some missing accessors to the type agnostic Value_Range class. They'll be used in the upcoming IPA work. gcc/ChangeLog: * value-range.h (class Value_Range): Implement set_zero, set_nonzero, and nonzero_p. --- gcc/value-range.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/gcc/value-range.h b/gcc/value-range.h index af81d6080da..171e6426c6e 100644 --- a/gcc/value-range.h +++ b/gcc/value-range.h @@ -542,6 +542,9 @@ public: bool contains_p (tree cst) const { return m_vrange->contains_p (cst); } bool singleton_p (tree *result = NULL) const { return m_vrange->singleton_p (result); } + void set_zero (tree type) { return m_vrange->set_zero (type); } + void set_nonzero (tree type) { return m_vrange->set_nonzero (type); } + bool nonzero_p () const { return m_vrange->nonzero_p (); } bool zero_p () const { return m_vrange->zero_p (); } wide_int lower_bound () const; // For irange/prange comparability. wide_int upper_bound () const; // For irange/prange comparability.