From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: 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 EED563844033 for ; Sat, 4 May 2024 08:31:05 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org EED563844033 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 EED563844033 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=1714811478; cv=none; b=VC5g7AQzA28RgY32NF9+BN5HfVzITEoLFURGWK/GXSMFrg1nEgk14uec4LAWMI6dUUR8SxoFc9PLz0CqL0u6G82UnIaY5r33xbD0FIT0NJAs8C0tkMYpyBrrmJhW3xjRbXNRs+KjgvMenDPJHYkMXr4ognDJyliUyNq5dAM3kQ0= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1714811478; c=relaxed/simple; bh=1kPXfHg+lu4UOb6l+HIchFvI+3RNuj31eVKrslq4Ass=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=gh12a+8fW9ASbuMRiV8s1UWhMI0x3MwYf5VR8BG7Zp/s0iFwQQGFOj271W0aScZA+LPOiY6YYU/zZygE1EECoIqwzmnvnnXHp4jLrMid1CcySfOgAVajlD8JWsuTVQ6UDY9qnP6Tv2WBPA85PwpavHE0UMnHmlVz/+vdcJL7zM8= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1714811465; 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=EIY8AFih4tUTKiCxu/n7RVwcalb7AX0VuM9YCZugpGc=; b=bRX2fwZG63G5QTeiDhZDrvoZX+353QSLN5no60s969al6ItESoFv3BGpeLtL/4cMjLCRK+ aoYkfTk5nP3tLygriTbCiFGUOWzMV4huoeG6gAhJwpzDnOzF6xuEdrsg1yfNYWTEb9O2eQ SxaESc0qcUKh34lRmPsfLYPa3O9Supk= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-302-Euw5JgVOPRauzTT4Sp_UcA-1; Sat, 04 May 2024 04:31:01 -0400 X-MC-Unique: Euw5JgVOPRauzTT4Sp_UcA-1 Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) (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 mimecast-mx02.redhat.com (Postfix) with ESMTPS id 7E0D9800C8A for ; Sat, 4 May 2024 08:31:01 +0000 (UTC) Received: from abulafia.quesejoda.com (unknown [10.39.192.71]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 300B9492BC7; Sat, 4 May 2024 08:31:01 +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 4448Uxlg139816 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT); Sat, 4 May 2024 10:30:59 +0200 Received: (from aldyh@localhost) by abulafia.quesejoda.com (8.18.1/8.18.1/Submit) id 4448UxWQ139815; Sat, 4 May 2024 10:30:59 +0200 From: Aldy Hernandez To: GCC patches Cc: Andrew MacLeod , Aldy Hernandez Subject: [COMMITTED 08/23] Implement operator_identity for prange. Date: Sat, 4 May 2024 10:30:36 +0200 Message-ID: <20240504083056.139719-9-aldyh@redhat.com> In-Reply-To: <20240504083056.139719-1-aldyh@redhat.com> References: <20240504083056.139719-1-aldyh@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.10 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=WINDOWS-1252; x-default=true X-Spam-Status: No, score=-12.7 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,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 List-Id: gcc/ChangeLog: =09* range-op-mixed.h: Add overloaded declarations for fold_range, op1_rang= e, =09lhs_op1_relation, pointers_handled_p. =09* range-op-ptr.cc (operator_identity::fold_range): New. =09(operator_identity::lhs_op1_relation): New. =09(operator_identity::op1_range): New. =09(operator_identity::pointers_handled_p): New. --- gcc/range-op-mixed.h | 10 ++++++++++ gcc/range-op-ptr.cc | 47 ++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 57 insertions(+) diff --git a/gcc/range-op-mixed.h b/gcc/range-op-mixed.h index 8163a4b53ca..60aaea9563d 100644 --- a/gcc/range-op-mixed.h +++ b/gcc/range-op-mixed.h @@ -349,18 +349,28 @@ public: bool fold_range (irange &r, tree type, =09=09 const irange &op1, const irange &op2, =09=09 relation_trio rel =3D TRIO_VARYING) const final override; + bool fold_range (prange &r, tree type, +=09=09 const prange &op1, const prange &op2, +=09=09 relation_trio rel =3D TRIO_VARYING) const final override; bool fold_range (frange &r, tree type ATTRIBUTE_UNUSED, =09=09 const frange &op1, const frange &op2 ATTRIBUTE_UNUSED, =09=09 relation_trio =3D TRIO_VARYING) const final override; bool op1_range (irange &r, tree type, =09=09 const irange &lhs, const irange &op2, =09=09 relation_trio rel =3D TRIO_VARYING) const final override; + bool op1_range (prange &r, tree type, +=09=09 const prange &lhs, const prange &op2, +=09=09 relation_trio rel =3D TRIO_VARYING) const final override; bool op1_range (frange &r, tree type ATTRIBUTE_UNUSED, =09=09 const frange &lhs, const frange &op2 ATTRIBUTE_UNUSED, =09=09 relation_trio =3D TRIO_VARYING) const final override; relation_kind lhs_op1_relation (const irange &lhs, =09=09=09=09 const irange &op1, const irange &op2, =09=09=09=09 relation_kind rel) const final override; + relation_kind lhs_op1_relation (const prange &lhs, +=09=09=09=09 const prange &op1, const prange &op2, +=09=09=09=09 relation_kind rel) const final override; + bool pointers_handled_p (range_op_dispatch_type, unsigned) const final o= verride; }; =20 class operator_cst : public range_operator diff --git a/gcc/range-op-ptr.cc b/gcc/range-op-ptr.cc index 560c798b90a..08419bfc798 100644 --- a/gcc/range-op-ptr.cc +++ b/gcc/range-op-ptr.cc @@ -636,6 +636,53 @@ public: } } op_hybrid_max; =20 +bool +operator_identity::fold_range (prange &r, tree type ATTRIBUTE_UNUSED, +=09=09=09 const prange &lh ATTRIBUTE_UNUSED, +=09=09=09 const prange &rh ATTRIBUTE_UNUSED, +=09=09=09 relation_trio) const +{ + r =3D lh; + return true; +} + +relation_kind +operator_identity::lhs_op1_relation (const prange &lhs, +=09=09=09=09 const prange &op1 ATTRIBUTE_UNUSED, +=09=09=09=09 const prange &op2 ATTRIBUTE_UNUSED, +=09=09=09=09 relation_kind) const +{ + if (lhs.undefined_p ()) + return VREL_VARYING; + // Simply a copy, so they are equivalent. + return VREL_EQ; +} + +bool +operator_identity::op1_range (prange &r, tree type ATTRIBUTE_UNUSED, +=09=09=09 const prange &lhs, +=09=09=09 const prange &op2 ATTRIBUTE_UNUSED, +=09=09=09 relation_trio) const +{ + r =3D lhs; + return true; +} + +bool +operator_identity::pointers_handled_p (range_op_dispatch_type type, +=09=09=09=09 unsigned dispatch) const +{ + switch (type) + { + case DISPATCH_FOLD_RANGE: + case DISPATCH_OP1_RANGE: + case DISPATCH_LHS_OP1_RELATION: + return dispatch =3D=3D RO_PPP; + default: + return true; + } +} + // Initialize any pointer operators to the primary table =20 void --=20 2.44.0