From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: 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 3827D3857736 for ; Wed, 26 Apr 2023 08:34:23 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 3827D3857736 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1682498062; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=7KZtKOGcjevaDA++B6kHJviyO5rBqBAPsZ+TgSssMUQ=; b=PNe0YDYQcNbLhOxdlkfHF6Jsj3Ev5O45je7tf2ZAoYZDWfRqRJardm9dd66CixxyhPXcbB yDbj92b/kXD0E83gvRqQJ9Uaz65NQbbF5/2N+Pju5nJwcFvUb0g2oSnR+RYbPtwFdewRy5 ve/oWVKXt2y7RbcVmyfbH/j1FHPMv/E= Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-368-9QHIT39JPmSazvDzlxgt0w-1; Wed, 26 Apr 2023 04:34:21 -0400 X-MC-Unique: 9QHIT39JPmSazvDzlxgt0w-1 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 3719F1C0896B for ; Wed, 26 Apr 2023 08:34:21 +0000 (UTC) Received: from abulafia.quesejoda.com (unknown [10.39.195.54]) by smtp.corp.redhat.com (Postfix) with ESMTPS id C2B564C82F; Wed, 26 Apr 2023 08:34:20 +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 33Q8YIra313630 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT); Wed, 26 Apr 2023 10:34:18 +0200 Received: (from aldyh@localhost) by abulafia.quesejoda.com (8.17.1/8.17.1/Submit) id 33Q8YIY7313629; Wed, 26 Apr 2023 10:34:18 +0200 From: Aldy Hernandez To: GCC patches Cc: Andrew MacLeod , Aldy Hernandez Subject: [COMMITTED] Remove irange::constant_p. Date: Wed, 26 Apr 2023 10:33:27 +0200 Message-Id: <20230426083328.313566-8-aldyh@redhat.com> In-Reply-To: <20230426083328.313566-1-aldyh@redhat.com> References: <20230426083328.313566-1-aldyh@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.5 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.7 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 List-Id: gcc/ChangeLog: * value-range-pretty-print.cc (vrange_printer::visit): Remove constant_p use. * value-range.cc (irange::constant_p): Remove. (irange::get_nonzero_bits_from_range): Remove constant_p use. * value-range.h (class irange): Remove constant_p. (irange::num_pairs): Remove constant_p use. --- gcc/value-range-pretty-print.cc | 13 ------------- gcc/value-range.cc | 14 -------------- gcc/value-range.h | 8 ++++++-- 3 files changed, 6 insertions(+), 29 deletions(-) diff --git a/gcc/value-range-pretty-print.cc b/gcc/value-range-pretty-print.cc index d20e2562431..a11c5a621f8 100644 --- a/gcc/value-range-pretty-print.cc +++ b/gcc/value-range-pretty-print.cc @@ -63,19 +63,6 @@ vrange_printer::visit (const irange &r) const pp_string (pp, "VARYING"); return; } - // Handle legacy symbolics. - if (!r.constant_p ()) - { - if (r.kind () == VR_ANTI_RANGE) - pp_character (pp, '~'); - pp_character (pp, '['); - dump_generic_node (pp, r.min (), 0, TDF_NONE, false); - pp_string (pp, ", "); - dump_generic_node (pp, r.max (), 0, TDF_NONE, false); - pp_character (pp, ']'); - print_irange_bitmasks (r); - return; - } for (unsigned i = 0; i < r.num_pairs (); ++i) { pp_character (pp, '['); diff --git a/gcc/value-range.cc b/gcc/value-range.cc index ebadea8b917..58ae2c157db 100644 --- a/gcc/value-range.cc +++ b/gcc/value-range.cc @@ -1351,16 +1351,6 @@ irange::operator== (const irange &other) const return nz1 == nz2; } -/* Return TRUE if this is a constant range. */ - -bool -irange::constant_p () const -{ - return (m_num_ranges > 0 - && TREE_CODE (min ()) == INTEGER_CST - && TREE_CODE (max ()) == INTEGER_CST); -} - /* If range is a singleton, place it in RESULT and return TRUE. Note: A singleton can be any gimple invariant, not just constants. So, [&x, &x] counts as a singleton. */ @@ -2835,10 +2825,6 @@ irange::invert () wide_int irange::get_nonzero_bits_from_range () const { - // For legacy symbolics. - if (!constant_p ()) - return wi::shwi (-1, TYPE_PRECISION (type ())); - wide_int min = lower_bound (); wide_int max = upper_bound (); wide_int xorv = min ^ max; diff --git a/gcc/value-range.h b/gcc/value-range.h index 1012d007261..2442f8eed70 100644 --- a/gcc/value-range.h +++ b/gcc/value-range.h @@ -169,7 +169,6 @@ public: // Deprecated legacy public methods. tree min () const; // DEPRECATED tree max () const; // DEPRECATED - bool constant_p () const; // DEPRECATED bool legacy_verbose_union_ (const class irange *); // DEPRECATED bool legacy_verbose_intersect (const irange *); // DEPRECATED @@ -692,7 +691,12 @@ inline unsigned irange::num_pairs () const { if (m_kind == VR_ANTI_RANGE) - return constant_p () ? 2 : 1; + { + bool constant_p = (TREE_CODE (min ()) == INTEGER_CST + && TREE_CODE (max ()) == INTEGER_CST); + gcc_checking_assert (constant_p); + return 2; + } else return m_num_ranges; } -- 2.40.0