From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx0b-0016f401.pphosted.com (mx0a-0016f401.pphosted.com [67.231.148.174]) by sourceware.org (Postfix) with ESMTPS id 56CE63858D33 for ; Mon, 28 Aug 2023 03:53:04 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 56CE63858D33 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=marvell.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=marvell.com 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 ; Sun, 27 Aug 2023 20:53:03 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h=from : to : cc : subject : date : message-id : mime-version : content-transfer-encoding : content-type; s=pfpt0220; bh=qDR2rB0E/8uj2zv0dxQlsIjtNP7dtaikDxL+VpS9Tvo=; b=Ai/fyaMaBxf9857f+E6KXzyk/p8913erNUhsUqPAW2QGg6OvYMdtEsHSw25GkA63hTjo zinSZE20EY0hKsotltfZ9MynEt4iPXo2dTWSKqzSulzSv7gk6jP3wU5q0RfBZz9yueKD 0b4GfDN3b4xIXUE6/+Cb9HjNjWMpH/exMy9+vxglH3+fk9CeA7OsFyvE1dw6zPuVn4vj g/yA8cj3nFEOf1THgNScrv+vz6nsGrDHH3jiiSsp/ajtjJyXNlQ4x4p1vWerWxMmHgLo F1tkL2gtNdaydQnjxAhPzR2S0QarorN6Q/QTzkbFh1NgL9UY3yCV3NClap8zJplmnvaM 5g== 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 ; 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) From: Andrew Pinski To: CC: Andrew Pinski 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 List-Id: 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(-) 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