Message ID | 20230828035253.3745942-1-apinski@marvell.com |
---|---|
State | Accepted |
Headers |
Return-Path: <gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:a7d1:0:b0:3f2:4152:657d with SMTP id p17csp3098959vqm; Sun, 27 Aug 2023 20:55:06 -0700 (PDT) X-Google-Smtp-Source: AGHT+IG5LdkLxVOlHlv67NXrdZtoU3gCV6lZdOhKHW/8BD7ZqYavNMnPXjHA0tay9wfYo7mRCbit X-Received: by 2002:a17:906:7695:b0:9a1:bd82:de35 with SMTP id o21-20020a170906769500b009a1bd82de35mr11440597ejm.3.1693194906402; Sun, 27 Aug 2023 20:55:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1693194906; cv=none; d=google.com; s=arc-20160816; b=0PFVp+kiTGuzqhIe1P0c6nd7hCwm7SUGOHZm7YqO7jhaVclJhLH9JOMMytO8klCMrO r3Zq6kFnYxZHCmG9orXRUuYdtaZNcCuUQ6z/uSIq3+MoelGAEf9qSX3/dxm6COufE9IY 9vnD7IcP+nWLm0dReKX9B0AemcUeXnvag4qExjBiMOV5AYGsTDaLvtm+zsigBJxDrUjh aUEN8B1kfcIh8VIYgn5TM46LcCywH2OBqgcM4yQ7Npf9S8HTe0ybRvEfD4M7VFB6Xs62 xFD7Jn1thPNXvOBJ/+W4rEYeVBLuLfraOgyBRblMyrO8FUPgvnpEceRwkp9iBEQHx/nS JSbA== 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:cc :to:dmarc-filter:delivered-to:dkim-signature:dkim-filter; bh=qDR2rB0E/8uj2zv0dxQlsIjtNP7dtaikDxL+VpS9Tvo=; fh=XbcmRug6/SzczusyoNU1I7Lu5oY0AN2u0mWDzKoxdSs=; b=QZrDnrzIkOlVGRJcJeh9lwCQ6+/dZp3i5q0L3N/EwBazGPE6fj2wAdAx4WhdH+wnJL LHkdcr3AVbe0HoXqNT1z5gzbwVGEqKdLOlnSj0FjU7YMGfHthP6tqYR3lz9aWzFkC26V gj4yrv8fJcAb6Yl0sn2ONFmUDDm/QUBNPdg+HunN9ieSksENCgcj0KBmtwCCqAgt9NNM ZN9DFRbjLZT4evmvTarFOMXmp7MvrtHsVx6Qki5gkOt/34JAHkURzhHxSHwfgk56sZvv n2b5u4Z5ninpZAgTI9WNZa1GkexWil07KDd5RBur8YMblYJjIRL9cZeHx1Fxe9RAl+mt tkfg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b="AH/upcbR"; 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 (server2.sourceware.org. [2620:52:3:1:0:246e:9693:128c]) by mx.google.com with ESMTPS id t14-20020a170906c38e00b00992f2becb47si1951470ejz.7.2023.08.27.20.55.05 for <ouuuleilei@gmail.com> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 27 Aug 2023 20:55:06 -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="AH/upcbR"; 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 8DAB23853D2B for <ouuuleilei@gmail.com>; Mon, 28 Aug 2023 03:53:51 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 8DAB23853D2B DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1693194831; bh=qDR2rB0E/8uj2zv0dxQlsIjtNP7dtaikDxL+VpS9Tvo=; h=To:CC:Subject:Date:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:From:Reply-To:From; b=AH/upcbRL0p+i7pfRCcOZsuSOwTS83t8mrc1uz3QWYYAyZ3LsCzrzf/bOT8I/fVyp N+MRl0M7OnfPVbkQN1gij6ByqpUs9NG0p66TejC7lBPxClYph9A1fNQQnJMo+M4beD bOw7KWsuJ4Rc/AlpcpPydV2HBskb0lgTUUovcnaM= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mx0b-0016f401.pphosted.com (mx0a-0016f401.pphosted.com [67.231.148.174]) by sourceware.org (Postfix) with ESMTPS id 56CE63858D33 for <gcc-patches@gcc.gnu.org>; Mon, 28 Aug 2023 03:53:04 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 56CE63858D33 Received: from pps.filterd (m0045849.ppops.net [127.0.0.1]) by mx0a-0016f401.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 37RLrWRS021622 for <gcc-patches@gcc.gnu.org>; Sun, 27 Aug 2023 20:53:03 -0700 Received: from dc5-exch01.marvell.com ([199.233.59.181]) by mx0a-0016f401.pphosted.com (PPS) with ESMTPS id 3sqerq3rb5-2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT) for <gcc-patches@gcc.gnu.org>; Sun, 27 Aug 2023 20:53:03 -0700 Received: from DC5-EXCH01.marvell.com (10.69.176.38) by DC5-EXCH01.marvell.com (10.69.176.38) with Microsoft SMTP Server (TLS) id 15.0.1497.48; Sun, 27 Aug 2023 20:53:02 -0700 Received: from maili.marvell.com (10.69.176.80) by DC5-EXCH01.marvell.com (10.69.176.38) with Microsoft SMTP Server id 15.0.1497.48 via Frontend Transport; Sun, 27 Aug 2023 20:53:01 -0700 Received: from vpnclient.wrightpinski.org.com (unknown [10.69.242.187]) by maili.marvell.com (Postfix) with ESMTP id 807A33F7099; Sun, 27 Aug 2023 20:53:01 -0700 (PDT) To: <gcc-patches@gcc.gnu.org> CC: Andrew Pinski <apinski@marvell.com> Subject: [PATCH] MATCH: Remove redundant pattern for `(x | y) & ~x` Date: Sun, 27 Aug 2023 20:52:53 -0700 Message-ID: <20230828035253.3745942-1-apinski@marvell.com> X-Mailer: git-send-email 2.31.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Proofpoint-ORIG-GUID: qPVktUqKpQeubpXpEkC0BiAAYHQlaecY X-Proofpoint-GUID: qPVktUqKpQeubpXpEkC0BiAAYHQlaecY X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.267,Aquarius:18.0.957,Hydra:6.0.601,FMLib:17.11.176.26 definitions=2023-08-27_22,2023-08-25_01,2023-05-22_02 X-Spam-Status: No, score=-14.6 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_LOW, SPF_HELO_NONE, SPF_PASS, 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 <gcc-patches.gcc.gnu.org> List-Unsubscribe: <https://gcc.gnu.org/mailman/options/gcc-patches>, <mailto:gcc-patches-request@gcc.gnu.org?subject=unsubscribe> List-Archive: <https://gcc.gnu.org/pipermail/gcc-patches/> List-Post: <mailto:gcc-patches@gcc.gnu.org> List-Help: <mailto:gcc-patches-request@gcc.gnu.org?subject=help> List-Subscribe: <https://gcc.gnu.org/mailman/listinfo/gcc-patches>, <mailto:gcc-patches-request@gcc.gnu.org?subject=subscribe> From: Andrew Pinski via Gcc-patches <gcc-patches@gcc.gnu.org> Reply-To: Andrew Pinski <apinski@marvell.com> Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org Sender: "Gcc-patches" <gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org> X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1775443542251524983 X-GMAIL-MSGID: 1775443542251524983 |
Series |
MATCH: Remove redundant pattern for `(x | y) & ~x`
|
|
Checks
Context | Check | Description |
---|---|---|
snail/gcc-patch-check | success | Github commit url |
Commit Message
Andrew Pinski
Aug. 28, 2023, 3:52 a.m. UTC
After r14-2885-gb9237226fdc938, this pattern becomes redundant as we match it using bitwise_inverted_equal_p. There is already a testcase (gcc.dg/nand.c) for this pattern and it still passes after the removal. OK? Bootstrapped and tested on x86_64-linux-gnu with no regressions. gcc/ChangeLog: PR tree-optimization/111146 * match.pd (`(x | y) & ~x`, `(x & y) | ~x`): Remove redundant pattern. --- gcc/match.pd | 8 -------- 1 file changed, 8 deletions(-)
Comments
On Mon, Aug 28, 2023 at 5:54 AM Andrew Pinski via Gcc-patches <gcc-patches@gcc.gnu.org> wrote: > > After r14-2885-gb9237226fdc938, this pattern becomes > redundant as we match it using bitwise_inverted_equal_p. > > There is already a testcase (gcc.dg/nand.c) for this pattern > and it still passes after the removal. > > OK? Bootstrapped and tested on x86_64-linux-gnu with no regressions. OK. > gcc/ChangeLog: > > PR tree-optimization/111146 > * match.pd (`(x | y) & ~x`, `(x & y) | ~x`): Remove > redundant pattern. > --- > gcc/match.pd | 8 -------- > 1 file changed, 8 deletions(-) > > diff --git a/gcc/match.pd b/gcc/match.pd > index fa598d5ca2e..0076392c522 100644 > --- a/gcc/match.pd > +++ b/gcc/match.pd > @@ -1556,14 +1556,6 @@ DEFINE_INT_AND_FLOAT_ROUND_FN (RINT) > (bit_ior:c (bit_xor:s @0 @1) (bit_not:s (bit_ior:s @0 @1))) > (bit_not (bit_and @0 @1))) > > -/* (x | y) & ~x -> y & ~x */ > -/* (x & y) | ~x -> y | ~x */ > -(for bitop (bit_and bit_ior) > - rbitop (bit_ior bit_and) > - (simplify > - (bitop:c (rbitop:c @0 @1) (bit_not@2 @0)) > - (bitop @1 @2))) > - > /* (x & y) ^ (x | y) -> x ^ y */ > (simplify > (bit_xor:c (bit_and @0 @1) (bit_ior @0 @1)) > -- > 2.31.1 >
diff --git a/gcc/match.pd b/gcc/match.pd index fa598d5ca2e..0076392c522 100644 --- a/gcc/match.pd +++ b/gcc/match.pd @@ -1556,14 +1556,6 @@ DEFINE_INT_AND_FLOAT_ROUND_FN (RINT) (bit_ior:c (bit_xor:s @0 @1) (bit_not:s (bit_ior:s @0 @1))) (bit_not (bit_and @0 @1))) -/* (x | y) & ~x -> y & ~x */ -/* (x & y) | ~x -> y | ~x */ -(for bitop (bit_and bit_ior) - rbitop (bit_ior bit_and) - (simplify - (bitop:c (rbitop:c @0 @1) (bit_not@2 @0)) - (bitop @1 @2))) - /* (x & y) ^ (x | y) -> x ^ y */ (simplify (bit_xor:c (bit_and @0 @1) (bit_ior @0 @1))