From patchwork Fri Sep 13 05:59:11 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Li, Pan2" X-Patchwork-Id: 1985002 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=intel.com header.i=@intel.com header.a=rsa-sha256 header.s=Intel header.b=K4drT1XP; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=8.43.85.97; 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 [8.43.85.97]) (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 4X4kF23NXRz1y1y for ; Fri, 13 Sep 2024 16:00:38 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 8891C3858D26 for ; Fri, 13 Sep 2024 06:00:36 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.16]) by sourceware.org (Postfix) with ESMTPS id 341B13858D26 for ; Fri, 13 Sep 2024 06:00:10 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 341B13858D26 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=intel.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=intel.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 341B13858D26 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=192.198.163.16 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1726207218; cv=none; b=GFw0TeKkg9h1YImTrsrc/CrtEJqBE+Ry5h+HyvEIWGZiqjFYeXXue8pVbIYexNKUhBLk2Zu7Xu0PWUEZYvptVnhh4Fvx+hAZstifu8VQAbKvONdIkjRS/6bbBiYWzLlQBo/E0rmi+f5etNuTH7TTakdA/sQ15EdWGMkoddkLfDo= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1726207218; c=relaxed/simple; bh=peypP4qZOwKH9MbLLNkqXVz0S75OVTEEmrXw+bMFH3I=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=aoSYlcgmKdL1KgZwX1f/bM6SzC2NT3BGPNYb8NkbcmAX8AFi4IrPx3q9u8m+ZpmyAPR4G5K0JdaCz+PrHIabOo2iqHFnYv1ZC3XHPjsjl3QmWdOuRFL3v2uXz1A6yrL6cdXt8bD0rTzbuBw42G+qYrcMfaEXm3RWFNZ9SStKKsM= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1726207210; x=1757743210; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=peypP4qZOwKH9MbLLNkqXVz0S75OVTEEmrXw+bMFH3I=; b=K4drT1XP8DNmz7EUdQkcBcleE37ljPlYW0R9EVuY7Rr2yItRnCfxmCsK lKxH/PGHGraRS2LF5+Y0uMMbBjvqMB2mMQOqURP46w8VLnGMX1ShRe9U2 Y+jLd6tnG+ioaUEao6fOOG4l0kxu2sj1YKRpDU8IA7Muv1D9sUzr1Hi/a gTp22wKyWG2TiLcCmurTjIcBHxYkehpLt4/X6K0++qMjfKMVBl74FuO3C uchiU1CLLyItUizITCxY6G9m6uFqomVguH3zuyFVBV6MAWpfdqASVYC0g 4J2HivUFPjgu+njMlvNWZuL8nk8aMm/1avK7OBkWJ+VKnljSpFGJ8a6zw g==; X-CSE-ConnectionGUID: i07xK0PoSd6ZBMgQptdDYw== X-CSE-MsgGUID: /7XBlnqnSYuZugjYSsjQqw== X-IronPort-AV: E=McAfee;i="6700,10204,11193"; a="13507097" X-IronPort-AV: E=Sophos;i="6.10,225,1719903600"; d="scan'208";a="13507097" Received: from fmviesa003.fm.intel.com ([10.60.135.143]) by fmvoesa110.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 Sep 2024 23:00:09 -0700 X-CSE-ConnectionGUID: zeTA8QV/RamBdOtr+W+geA== X-CSE-MsgGUID: 7FUTAYqTSR2sLn73g+v00A== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.10,225,1719903600"; d="scan'208";a="72051710" Received: from panli.sh.intel.com ([10.239.154.73]) by fmviesa003.fm.intel.com with ESMTP; 12 Sep 2024 23:00:07 -0700 From: pan2.li@intel.com To: gcc-patches@gcc.gnu.org Cc: richard.guenther@gmail.com, Tamar.Christina@arm.com, juzhe.zhong@rivai.ai, kito.cheng@gmail.com, jeffreyalaw@gmail.com, rdapp.gcc@gmail.com, Pan Li Subject: [PATCH v1] Match: Remove unnecessary types_match for case 1 of signed SAT_ADD Date: Fri, 13 Sep 2024 13:59:11 +0800 Message-ID: <20240913055911.1316232-1-pan2.li@intel.com> X-Mailer: git-send-email 2.43.0 MIME-Version: 1.0 X-Spam-Status: No, score=-11.5 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, 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 From: Pan Li Given all commutative binary operators requires types matching for both operands. Remove the types_match check for case 1 of the signed SAT_ADD, because we have (bit_xor @0 @1), which ensure the operands have the correct TREE type. The below test suites are passed for this patch. * The rv64gcv fully regression test. * The x86 bootstrap test. * The x86 fully regression test. gcc/ChangeLog: * match.pd: Remove the types_match check for signed SAT_ADD case 1. Signed-off-by: Pan Li --- gcc/match.pd | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/gcc/match.pd b/gcc/match.pd index 4cef965c9c7..5566c0e4c41 100644 --- a/gcc/match.pd +++ b/gcc/match.pd @@ -3204,8 +3204,7 @@ DEFINE_INT_AND_FLOAT_ROUND_FN (RINT) integer_zerop) (bit_xor:c (negate (convert (lt @0 integer_zerop))) max_value) @2) - (if (INTEGRAL_TYPE_P (type) && !TYPE_UNSIGNED (type) - && types_match (type, @0, @1)))) + (if (INTEGRAL_TYPE_P (type) && !TYPE_UNSIGNED (type)))) /* Signed saturation add, case 2: T sum = (T)((UT)X + (UT)Y)