From patchwork Fri Jun 28 09:30:53 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aldy Hernandez X-Patchwork-Id: 1953848 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=CVNKABWb; dkim-atps=neutral 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=server2.sourceware.org; envelope-from=gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=patchwork.ozlabs.org) Received: from server2.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 (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4W9VZH0Vnlz1yhT for ; Fri, 28 Jun 2024 19:31:51 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id E680E382EF1B for ; Fri, 28 Jun 2024 09:31:45 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from us-smtp-delivery-44.mimecast.com (us-smtp-delivery-44.mimecast.com [205.139.111.44]) by sourceware.org (Postfix) with ESMTPS id 2BA4C3883014 for ; Fri, 28 Jun 2024 09:31:20 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 2BA4C3883014 Authentication-Results: sourceware.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=none smtp.mailfrom=localhost.redhat.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 2BA4C3883014 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=205.139.111.44 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1719567081; cv=none; b=tWp4btqGV8rE9yjJWeTMVpa+Np2r5oSfYsrIiP32dTYeJlhXwor1x2CeEfce2iKok0rSMUOKq3QTY17AKoMIPiE9NedSlBiZjZm5fBZfBcMLhbEJwwuUllbRldnv0Tp6b9ij2OdE0NUSO0TssmGUkj6LGsqYGsn83ijsAcZhQZo= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1719567081; c=relaxed/simple; bh=wsmcW3l+OKJn9nda2+iq8RDMF0GcUqJxexG3/XzqTro=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=EcZTnXFQh1DPTMUOLrWkEgOpDuV1602u3a0a6hcUneV2Ro1rnve8lbHB169TvUxI8/okXTVqpF/xarxP3PUQFdEVpQGObFYDDwHF0iZH3zdqYBHcW9lslikLnOheuBY0BraCLaWzbiRMV/UnUWzv7W5Kwor+8YItVlAGaTZmgT4= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1719567078; 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; bh=+zltLlzyTNkDl6muqq9yImjZy3hxlL3eRPc4v45CmKQ=; b=CVNKABWb6eSqn2lm2sbXA4U6wmw6G7P3hJegsoKvWf1VAGFV9i4ZrpxB4UKv01NdPWinns j6hmNQ27nsZ8LdsxS+hRwFnR0enadOFHK+ir5QD8MpmMf/8Ip32syjlNBqyllLkyCubpnV wHW1f8DBnHgkBnqunzmyj72TY8mqj44= Received: from mx-prod-mc-02.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-50-puIGy3plN6-AJjIY9pJbUw-1; Fri, 28 Jun 2024 05:31:15 -0400 X-MC-Unique: puIGy3plN6-AJjIY9pJbUw-1 Received: from mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.17]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-02.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id D96BA194511E for ; Fri, 28 Jun 2024 09:31:14 +0000 (UTC) Received: from abulafia.quesejoda.com (unknown [10.39.193.85]) by mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 193E219560A3; Fri, 28 Jun 2024 09:31:13 +0000 (UTC) Received: from abulafia.quesejoda.com (localhost [127.0.0.1]) by abulafia.quesejoda.com (8.18.1/8.17.1) with ESMTPS id 45S9VBg01837310 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT); Fri, 28 Jun 2024 11:31:11 +0200 Received: (from aldyh@localhost) by abulafia.quesejoda.com (8.18.1/8.18.1/Submit) id 45S9VBLH1837309; Fri, 28 Jun 2024 11:31:11 +0200 From: Aldy Hernandez To: GCC patches Cc: Andrew MacLeod , Aldy Hernandez Subject: [PATCH] Remove unused hybrid_* operators in range-ops. Date: Fri, 28 Jun 2024 11:30:53 +0200 Message-ID: <20240628093109.1837267-1-aldyh@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.17 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-Spam-Status: No, score=-12.2 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, KAM_ASCII_DIVIDERS, NO_DNS_FOR_FROM, RCVD_IN_DNSWL_LOW, 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.30 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org Now that the dust has settled on the prange work, we can remove the hybrid operators. I will push this once tests complete. gcc/ChangeLog: * range-op-ptr.cc (class hybrid_and_operator): Remove. (class hybrid_or_operator): Same. (class hybrid_min_operator): Same. (class hybrid_max_operator): Same. --- gcc/range-op-ptr.cc | 156 -------------------------------------------- 1 file changed, 156 deletions(-) diff --git a/gcc/range-op-ptr.cc b/gcc/range-op-ptr.cc index 9421d3cd21d..1f41236e710 100644 --- a/gcc/range-op-ptr.cc +++ b/gcc/range-op-ptr.cc @@ -612,162 +612,6 @@ operator_pointer_diff::op1_op2_relation_effect (irange &lhs_range, tree type, rel); } -// ---------------------------------------------------------------------- -// Hybrid operators for the 4 operations which integer and pointers share, -// but which have different implementations. Simply check the type in -// the call and choose the appropriate method. -// Once there is a PRANGE signature, simply add the appropriate -// prototypes in the rmixed range class, and remove these hybrid classes. - -class hybrid_and_operator : public operator_bitwise_and -{ -public: - using range_operator::update_bitmask; - using range_operator::op1_range; - using range_operator::op2_range; - using range_operator::lhs_op1_relation; - bool op1_range (irange &r, tree type, - const irange &lhs, const irange &op2, - relation_trio rel = TRIO_VARYING) const final override - { - if (INTEGRAL_TYPE_P (type)) - return operator_bitwise_and::op1_range (r, type, lhs, op2, rel); - else - return false; - } - bool op2_range (irange &r, tree type, - const irange &lhs, const irange &op1, - relation_trio rel = TRIO_VARYING) const final override - { - if (INTEGRAL_TYPE_P (type)) - return operator_bitwise_and::op2_range (r, type, lhs, op1, rel); - else - return false; - } - relation_kind lhs_op1_relation (const irange &lhs, - const irange &op1, const irange &op2, - relation_kind rel) const final override - { - if (!lhs.undefined_p () && INTEGRAL_TYPE_P (lhs.type ())) - return operator_bitwise_and::lhs_op1_relation (lhs, op1, op2, rel); - else - return VREL_VARYING; - } - void update_bitmask (irange &r, const irange &lh, - const irange &rh) const final override - { - if (!r.undefined_p () && INTEGRAL_TYPE_P (r.type ())) - operator_bitwise_and::update_bitmask (r, lh, rh); - } - - void wi_fold (irange &r, tree type, const wide_int &lh_lb, - const wide_int &lh_ub, const wide_int &rh_lb, - const wide_int &rh_ub) const final override - { - if (INTEGRAL_TYPE_P (type)) - return operator_bitwise_and::wi_fold (r, type, lh_lb, lh_ub, - rh_lb, rh_ub); - else - return op_pointer_and.wi_fold (r, type, lh_lb, lh_ub, rh_lb, rh_ub); - } -} op_hybrid_and; - -// Temporary class which dispatches routines to either the INT version or -// the pointer version depending on the type. Once PRANGE is a range -// class, we can remove the hybrid. - -class hybrid_or_operator : public operator_bitwise_or -{ -public: - using range_operator::update_bitmask; - using range_operator::op1_range; - using range_operator::op2_range; - using range_operator::lhs_op1_relation; - bool op1_range (irange &r, tree type, - const irange &lhs, const irange &op2, - relation_trio rel = TRIO_VARYING) const final override - { - if (INTEGRAL_TYPE_P (type)) - return operator_bitwise_or::op1_range (r, type, lhs, op2, rel); - else - return op_pointer_or.op1_range (r, type, lhs, op2, rel); - } - bool op2_range (irange &r, tree type, - const irange &lhs, const irange &op1, - relation_trio rel = TRIO_VARYING) const final override - { - if (INTEGRAL_TYPE_P (type)) - return operator_bitwise_or::op2_range (r, type, lhs, op1, rel); - else - return op_pointer_or.op2_range (r, type, lhs, op1, rel); - } - void update_bitmask (irange &r, const irange &lh, - const irange &rh) const final override - { - if (!r.undefined_p () && INTEGRAL_TYPE_P (r.type ())) - operator_bitwise_or::update_bitmask (r, lh, rh); - } - - void wi_fold (irange &r, tree type, const wide_int &lh_lb, - const wide_int &lh_ub, const wide_int &rh_lb, - const wide_int &rh_ub) const final override - { - if (INTEGRAL_TYPE_P (type)) - return operator_bitwise_or::wi_fold (r, type, lh_lb, lh_ub, - rh_lb, rh_ub); - else - return op_pointer_or.wi_fold (r, type, lh_lb, lh_ub, rh_lb, rh_ub); - } -} op_hybrid_or; - -// Temporary class which dispatches routines to either the INT version or -// the pointer version depending on the type. Once PRANGE is a range -// class, we can remove the hybrid. - -class hybrid_min_operator : public operator_min -{ - using range_operator::update_bitmask; -public: - void update_bitmask (irange &r, const irange &lh, - const irange &rh) const final override - { - if (!r.undefined_p () && INTEGRAL_TYPE_P (r.type ())) - operator_min::update_bitmask (r, lh, rh); - } - - void wi_fold (irange &r, tree type, const wide_int &lh_lb, - const wide_int &lh_ub, const wide_int &rh_lb, - const wide_int &rh_ub) const final override - { - if (INTEGRAL_TYPE_P (type)) - return operator_min::wi_fold (r, type, lh_lb, lh_ub, rh_lb, rh_ub); - else - return op_ptr_min_max.wi_fold (r, type, lh_lb, lh_ub, rh_lb, rh_ub); - } -} op_hybrid_min; - -class hybrid_max_operator : public operator_max -{ - using range_operator::update_bitmask; -public: - void update_bitmask (irange &r, const irange &lh, - const irange &rh) const final override - { - if (!r.undefined_p () && INTEGRAL_TYPE_P (r.type ())) - operator_max::update_bitmask (r, lh, rh); - } - - void wi_fold (irange &r, tree type, const wide_int &lh_lb, - const wide_int &lh_ub, const wide_int &rh_lb, - const wide_int &rh_ub) const final override - { - if (INTEGRAL_TYPE_P (type)) - return operator_max::wi_fold (r, type, lh_lb, lh_ub, rh_lb, rh_ub); - else - return op_ptr_min_max.wi_fold (r, type, lh_lb, lh_ub, rh_lb, rh_ub); - } -} op_hybrid_max; - bool operator_identity::fold_range (prange &r, tree type ATTRIBUTE_UNUSED, const prange &lh ATTRIBUTE_UNUSED,