From patchwork Fri Nov 11 13:53:18 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aldy Hernandez X-Patchwork-Id: 1702659 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=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=NEdRY43n; dkim-atps=neutral Received: from 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 4N80ZL2Xxzz23lT for ; Sat, 12 Nov 2022 00:54:50 +1100 (AEDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 471683858430 for ; Fri, 11 Nov 2022 13:54:48 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 471683858430 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1668174888; bh=JP5VaJuNM5V9MGPWvvpT3zeP2rtuMsmOoaPuzUH5PBM=; h=To:Cc:Subject:Date:In-Reply-To:References:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From:Reply-To:From; b=NEdRY43nko6ak/BTmQGcry90OWFVM3cK4GoZaz7AOns/u5BxPq2wbn1mZ63pBnrxL 3Lh0mSm1VvJmtQ+WTsEVidRQxTa40vFVu5KjDbBRWxL3fBOYOWJBn8JU5+mUxD7Tvy uhL0/EgcutNEpZLYLZD0sfoOBDdrrM5qe+JqgejI= 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 65DD33858CDA for ; Fri, 11 Nov 2022 13:53:28 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 65DD33858CDA 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-653-z8wfg-KCPOuiz44fMCTvOA-1; Fri, 11 Nov 2022 08:53:27 -0500 X-MC-Unique: z8wfg-KCPOuiz44fMCTvOA-1 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id DA6A885A583 for ; Fri, 11 Nov 2022 13:53:26 +0000 (UTC) Received: from abulafia.quesejoda.com (unknown [10.39.192.220]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 9208940C1022; Fri, 11 Nov 2022 13:53:26 +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 2ABDrPMT235463 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT); Fri, 11 Nov 2022 14:53:25 +0100 Received: (from aldyh@localhost) by abulafia.quesejoda.com (8.17.1/8.17.1/Submit) id 2ABDrPFi235462; Fri, 11 Nov 2022 14:53:25 +0100 To: GCC patches Cc: Andrew MacLeod , Aldy Hernandez Subject: [COMMITTED] [range-ops] Remove specialized fold_range methods for various operators. Date: Fri, 11 Nov 2022 14:53:18 +0100 Message-Id: <20221111135318.235387-5-aldyh@redhat.com> In-Reply-To: <20221111135318.235387-1-aldyh@redhat.com> References: <20221111135318.235387-1-aldyh@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.2 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_H2, 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+incoming=patchwork.ozlabs.org@gcc.gnu.org Sender: "Gcc-patches" Remove some specialized fold_range methods that were merely setting maybe nonzero masks, as these are now subsumed by the generic version. gcc/ChangeLog: * range-op.cc (operator_mult::fold_range): Remove. (operator_div::fold_range): Remove. (operator_bitwise_and): Remove. --- gcc/range-op.cc | 52 ------------------------------------------------- 1 file changed, 52 deletions(-) diff --git a/gcc/range-op.cc b/gcc/range-op.cc index 0b01cf48fdf..6fa3b151596 100644 --- a/gcc/range-op.cc +++ b/gcc/range-op.cc @@ -1790,13 +1790,9 @@ cross_product_operator::wi_cross_product (irange &r, tree type, class operator_mult : public cross_product_operator { - using range_operator::fold_range; using range_operator::op1_range; using range_operator::op2_range; public: - virtual bool fold_range (irange &r, tree type, - const irange &lh, const irange &rh, - relation_trio = TRIO_VARYING) const final override; virtual void wi_fold (irange &r, tree type, const wide_int &lh_lb, const wide_int &lh_ub, @@ -1815,18 +1811,6 @@ public: relation_trio) const final override; } op_mult; -bool -operator_mult::fold_range (irange &r, tree type, - const irange &lh, const irange &rh, - relation_trio trio) const -{ - if (!cross_product_operator::fold_range (r, type, lh, rh, trio)) - return false; - - update_known_bitmask (r, MULT_EXPR, lh, rh); - return true; -} - bool operator_mult::op1_range (irange &r, tree type, const irange &lhs, const irange &op2, @@ -1979,23 +1963,8 @@ public: virtual bool wi_op_overflows (wide_int &res, tree type, const wide_int &, const wide_int &) const final override; - virtual bool fold_range (irange &r, tree type, - const irange &lh, const irange &rh, - relation_trio trio) const final override; }; -bool -operator_div::fold_range (irange &r, tree type, - const irange &lh, const irange &rh, - relation_trio trio) const -{ - if (!cross_product_operator::fold_range (r, type, lh, rh, trio)) - return false; - - update_known_bitmask (r, m_code, lh, rh); - return true; -} - bool operator_div::wi_op_overflows (wide_int &res, tree type, const wide_int &w0, const wide_int &w1) const @@ -2834,14 +2803,9 @@ operator_logical_and::op2_range (irange &r, tree type, class operator_bitwise_and : public range_operator { - using range_operator::fold_range; using range_operator::op1_range; using range_operator::op2_range; public: - virtual bool fold_range (irange &r, tree type, - const irange &lh, - const irange &rh, - relation_trio rel = TRIO_VARYING) const; virtual bool op1_range (irange &r, tree type, const irange &lhs, const irange &op2, @@ -2865,22 +2829,6 @@ private: const irange &op2) const; } op_bitwise_and; -bool -operator_bitwise_and::fold_range (irange &r, tree type, - const irange &lh, - const irange &rh, - relation_trio) const -{ - if (range_operator::fold_range (r, type, lh, rh)) - { - if (!r.undefined_p () && !lh.undefined_p () && !rh.undefined_p ()) - r.set_nonzero_bits (wi::bit_and (lh.get_nonzero_bits (), - rh.get_nonzero_bits ())); - return true; - } - return false; -} - // Optimize BIT_AND_EXPR, BIT_IOR_EXPR and BIT_XOR_EXPR of signed types // by considering the number of leading redundant sign bit copies.