From patchwork Tue Sep 27 08:44:53 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aldy Hernandez X-Patchwork-Id: 1484 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:5044:0:0:0:0:0 with SMTP id h4csp217245wrt; Tue, 27 Sep 2022 01:46:27 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5BTIZ4Bdte8X4sRSRk5ZEUgOCFMc53Ry4e11ZAmj1Zru0BKpr1q7zho/KiDFzJBMGlBxSq X-Received: by 2002:a17:906:cc13:b0:77d:46c2:f37c with SMTP id ml19-20020a170906cc1300b0077d46c2f37cmr21713337ejb.45.1664268387236; Tue, 27 Sep 2022 01:46:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1664268387; cv=none; d=google.com; s=arc-20160816; b=eQwUf4PxsqQObGLbCfCJRBbYQg/NZ7WrETc3SmwkMxWZ+1bB/2fodWvMQZwfKFA1Rr 3ADo3BBV69mn3azwcPHrBYCF7dgZHnNjSqAmcWbhU1JmM1wGVVxMY2tk2DK1XveXgoAE qAxwxS02KXE02WwC9U3cXwR/a9otPdPujk3Kz03hwrj8G0oi0t0h4eDoZKsMaunxg2XR ZBvtxUtNdJvVtsv2AsA3gznB/KegquvqNM08WoECxkRkiWg9hwE5xwiUTTJqS+u/sAPS VjB0xABiqplGhlb9pAx8QkMf68A0vtCVHPNGdjbAZ/Dc/+/59gKF6bqZCmpRkJ9SRDQZ QzaA== 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:to :dmarc-filter:delivered-to:dkim-signature:dkim-filter; bh=1JUIM4hkHTPjmOoHHM8qNdbzAXQ3ql1BApgjgPuXA+0=; b=MZRKvwcUwwLPUrzm5xyZETDN8mIu5P2xD8U+NxWt3LeluvdF3QVBvQD7OsB+5952ig a878846SRLUqMHStWrqz7Hyj287Wu7TgAcGKBK7NeEdvtzFvSKOWcz0eX98kXvC6HB+4 nGpKwQFuzKAu9b8D7cOTicPnd3c7/UHFBqvSSkXcVDuda6PfAbxbIbx6N/Vf/kY4MNsC 3FPBpjqSJqY5HrgiYvdFNEElBVPodYpUe39ihEWEE/UEjVwHA9UNO6xBQjw/M3qE3qVx WoCz5TAlwBPTFkQTv5EPTfjMeXdiqCbxcosd+8e0Pr1se5WvhcV2p4piYSyEGMkQH2X4 8Gaw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=ksMbzrOO; 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 hc34-20020a17090716a200b0078387a1b6b4si608259ejc.697.2022.09.27.01.46.26 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 27 Sep 2022 01:46:27 -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=ksMbzrOO; 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 D5B7F385AC3C for ; Tue, 27 Sep 2022 08:45:45 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org D5B7F385AC3C DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1664268345; bh=1JUIM4hkHTPjmOoHHM8qNdbzAXQ3ql1BApgjgPuXA+0=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=ksMbzrOOKyNK+KQm0tYKK2LPgJrakTAhIBeSKwZGepCG+DEw/SQu3VThwsbx+V8bM fWCxqcBSD3j2yobnoxReOlHKN50jrna0iueXpQGgWvJVKtDcuzxu5eZjp6qpVVT1sa VyvoPFttu5YJ1q5Ob5gkaooTuNxOruTVaBuNVUbk= 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.133.124]) by sourceware.org (Postfix) with ESMTPS id B4C763858010 for ; Tue, 27 Sep 2022 08:45:01 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org B4C763858010 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-664-BG6RgzWzPba-mNovPdpXeA-1; Tue, 27 Sep 2022 04:44:59 -0400 X-MC-Unique: BG6RgzWzPba-mNovPdpXeA-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id A39A38032F1 for ; Tue, 27 Sep 2022 08:44:59 +0000 (UTC) Received: from abulafia.quesejoda.com (unknown [10.39.195.18]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 132C3207B317; Tue, 27 Sep 2022 08:44:58 +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 28R8it173409543 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT); Tue, 27 Sep 2022 10:44:55 +0200 Received: (from aldyh@localhost) by abulafia.quesejoda.com (8.17.1/8.17.1/Submit) id 28R8it8f3409542; Tue, 27 Sep 2022 10:44:55 +0200 To: GCC patches Subject: [COMMITTED] Add an irange setter for wide_ints. Date: Tue, 27 Sep 2022 10:44:53 +0200 Message-Id: <20220927084453.3409529-1-aldyh@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.4 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-Spam-Status: No, score=-11.5 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, SPF_HELO_NONE, SPF_NONE, TXREP 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?1745111888310985502?= X-GMAIL-MSGID: =?utf-8?q?1745111888310985502?= Just the same way as we have real_value setters for franges, we should have a wide_int version for irange. This matches the irange constructor for wide_ints, and paves the way for the eventual conversion of irange to wide ints. gcc/ChangeLog: * value-range.h (irange::set): New version taking wide_int_ref. --- gcc/value-range.h | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/gcc/value-range.h b/gcc/value-range.h index 413e54bda6f..556e31aece1 100644 --- a/gcc/value-range.h +++ b/gcc/value-range.h @@ -117,6 +117,8 @@ class GTY((user)) irange : public vrange public: // In-place setters. virtual void set (tree, tree, value_range_kind = VR_RANGE) override; + void set (tree type, const wide_int_ref &, const wide_int_ref &, + value_range_kind = VR_RANGE); virtual void set_nonzero (tree type) override; virtual void set_zero (tree type) override; virtual void set_nonnegative (tree type) override; @@ -687,6 +689,13 @@ irange::varying_compatible_p () const return true; } +inline void +irange::set (tree type, const wide_int_ref &min, const wide_int_ref &max, + value_range_kind kind) +{ + set (wide_int_to_tree (type, min), wide_int_to_tree (type, max), kind); +} + inline bool vrange::varying_p () const {