From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR01-HE1-obe.outbound.protection.outlook.com (mail-he1eur01on2075.outbound.protection.outlook.com [40.107.13.75]) by sourceware.org (Postfix) with ESMTPS id AFB263858D20 for ; Mon, 20 May 2024 11:20:23 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org AFB263858D20 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=arm.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org AFB263858D20 Authentication-Results: server2.sourceware.org; arc=pass smtp.remote-ip=40.107.13.75 ARC-Seal: i=3; a=rsa-sha256; d=sourceware.org; s=key; t=1716204025; cv=pass; b=nESD+KhssQ3FrNq5GN1q9zi4VqWyE1jF69gjt0QLwdnfu8N//WVD/U/43k9OeTPafLnPwyNPktaHp6Hn3p/MTSf19RA44Lw+ScYOzQsZ+kVCNRuA6fi+foXZ/tAC4MZViKWAvh0m3FOXYWawX4c6FOFCF4aIo+vrz8CfBzuBQEc= ARC-Message-Signature: i=3; a=rsa-sha256; d=sourceware.org; s=key; t=1716204025; c=relaxed/simple; bh=PJvU7RlKF5dmX29TvPbVg4ZlRlTBGORVEZ46yBOM+3M=; h=DKIM-Signature:DKIM-Signature:From:To:Subject:Date:Message-ID: MIME-Version; b=h5vlc8jKpMk0feDlh80oC2V+B0NkrPFMB0DQT8i1xJ7RkviqcFj7bhK2qL5ocZM2bQpTfdhHemKc8G1Gpm05TiF1TcV3ms6kU58yiYx+ib11yBXlV67Gh9aawKJxt8BRHvTtDup4gj61ut5IXWrf79Q1l4Xg3l3z4u8WHBGXjRc= ARC-Authentication-Results: i=3; server2.sourceware.org ARC-Seal: i=2; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=pass; b=Et+MmnkqdOg28ZiqrUvO/7NpbH6nRej5wKeQr+Luz9bGb8deHYp6CSQ515o8pqx37utrkJ8gNwnYwzJwe+HvNtGfPDQF3HXc7L5fbE/h4FjbSaPpfVIZ4NzptB8kHEorHSGoLN2hvL8SgWh1uv76TUm296cSs4h3ol//4U+CmouFU+ev6xnAfWElmy8R3STQfZ81/BCxn15Of665glJxtJlne2AE/sXWdyTXNEKXPfby90/0lvgYeG9sx7JfPbMYDjbnLQw9WRh+YcUf9tqIUcw2RmS7ypqI7YKFDNizorcKChQ5B96RqxssTtLIese8xycLxz6g4u9HhlVT8Rv9mg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=BJ+ybxKlRFt9S6RSd7bq9bMzm9NlSLoCjW+6bcaTyAA=; b=cJtT3L++4etZoDY8Eh7l6Th+798ZOqoqvultW8PZGjPTFEiMBHyTnks8SS4BURTcsj9oVXUZF3CsY/9CpkqnKLfIH4WXf/VN74OsZj8L/sn+H3c1KWP/IE13Gl765epifjWwC78/YSU9+5kQZBNDBz7hsTwtOxAzPBKILcQ7T7KemoB4bArYRLIs7/K8GemhJAPfe77GrDRvMR9z++oKmCczIq3hCvo9fCLZuHgH37kOkqApIkT69umqiy+LPGfgFoJHYP6UbeEHwO/J6KTJ0QLgxhJGCRu2eatFYK8aq1J+rcPuE3JabTywqBHBBq7uMx385rr2PAaT8ZrRYCrBwA== ARC-Authentication-Results: i=2; mx.microsoft.com 1; spf=pass (sender ip is 63.35.35.123) smtp.rcpttodomain=gcc.gnu.org smtp.mailfrom=arm.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=arm.com; dkim=pass (signature was verified) header.d=arm.com; arc=pass (0 oda=1 ltdi=1 spf=[1,1,smtp.mailfrom=arm.com] dkim=[1,1,header.d=arm.com] dmarc=[1,1,header.from=arm.com]) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=arm.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=BJ+ybxKlRFt9S6RSd7bq9bMzm9NlSLoCjW+6bcaTyAA=; b=ehbbMDabnB/hNfW4oJduHdYgjxJrQZv8HLPXJPviHvtVQXGExWVpvRXyROe7x91mXcQ5cF3NDcFp7DtDrpNARrEbfpqHKarlBZvNixsQs6i/rcytmlonTwHK5//AGwsxRQdxL13yCEzE54Z/NvRZP8SQBagbDc1YhCoAvX72ZXk= Received: from AS9PR04CA0165.eurprd04.prod.outlook.com (2603:10a6:20b:530::25) by DU5PR08MB10516.eurprd08.prod.outlook.com (2603:10a6:10:528::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7587.35; Mon, 20 May 2024 11:20:20 +0000 Received: from AMS0EPF00000192.eurprd05.prod.outlook.com (2603:10a6:20b:530:cafe::ae) by AS9PR04CA0165.outlook.office365.com (2603:10a6:20b:530::25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7587.35 via Frontend Transport; Mon, 20 May 2024 11:20:20 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123) smtp.mailfrom=arm.com; dkim=pass (signature was verified) header.d=arm.com;dmarc=pass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 63.35.35.123 as permitted sender) receiver=protection.outlook.com; client-ip=63.35.35.123; helo=64aa7808-outbound-1.mta.getcheckrecipient.com; pr=C Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by AMS0EPF00000192.mail.protection.outlook.com (10.167.16.218) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.7611.14 via Frontend Transport; Mon, 20 May 2024 11:20:20 +0000 Received: ("Tessian outbound 85e363419cbe:v315"); Mon, 20 May 2024 11:20:20 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: 551e0da7e2b4326e X-CR-MTA-TID: 64aa7808 Received: from e50006b59328.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 3F2944C2-115D-4D72-9034-5C81D2F1068F.1; Mon, 20 May 2024 11:20:13 +0000 Received: from EUR04-HE1-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id e50006b59328.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Mon, 20 May 2024 11:20:13 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=BQHyKF1p4Ci2Mq/ipFZleog6ESK6uKq+RMRgSGJp7MwHfdj3gGJCub099mpNyaQS98s0U1FKmcn+wRreTfQYPXw2mC7p6SFeQdtUC0YL2H8JeBw5V06lel2YQvgTTmnaLIoypuv6tGQoPr2LNGqaFRSn8/xV8lSaUoiv6hMYE2fNQMUJHc8DWGWeeEsldA2NRQ+ln2GaR0TqQflToKh8nWr2L5Hj3Yl4e9MsU3Y8QSWlv16oHTbS+qHDEZfuBqq2Xkk7jd/XE1gO6EIWd//h441RvWBPlmeHol8EpuyjYAkjVmpWmOCqtJ5AM79HG0M4tPwgq5yyq4ObdeQGhJpBZQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=BJ+ybxKlRFt9S6RSd7bq9bMzm9NlSLoCjW+6bcaTyAA=; b=NqTzAJDe6aacYUoxEXcBSbKjQaZleHjcYWwsOeaORLc34QrcAIqKJP8NDl68CCngjYdMEd1+cwRqI88EABsQW7Otg0obGWFnQ5v/Sw91x3TTjduzx5PI8Kh02Cf2yRn31+sjPe40kYMOEwZZqPmvwQiHiqyDOzKkpr00FWQJhOsRbO7no1CuYMjTSlzfP6NqEOZq+80rDm6EXz9BBXIbFQ2hAyWRiaZJgNjHUqlrPm0CiL6K7WTHDkStPok4iaI4H8jYsHExe8mo5UG+oFVBSt7dK8FFwkt/yShqgbMqEONnEKcNMiRJeRm+Rh0f3rL6X5sl4dAVCAnw7mZ8jueLtQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass header.d=arm.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=arm.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=BJ+ybxKlRFt9S6RSd7bq9bMzm9NlSLoCjW+6bcaTyAA=; b=ehbbMDabnB/hNfW4oJduHdYgjxJrQZv8HLPXJPviHvtVQXGExWVpvRXyROe7x91mXcQ5cF3NDcFp7DtDrpNARrEbfpqHKarlBZvNixsQs6i/rcytmlonTwHK5//AGwsxRQdxL13yCEzE54Z/NvRZP8SQBagbDc1YhCoAvX72ZXk= Received: from VI1PR08MB5325.eurprd08.prod.outlook.com (2603:10a6:803:13e::17) by PAWPR08MB9808.eurprd08.prod.outlook.com (2603:10a6:102:2ea::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7587.36; Mon, 20 May 2024 11:20:11 +0000 Received: from VI1PR08MB5325.eurprd08.prod.outlook.com ([fe80::89dc:c731:362b:7c69]) by VI1PR08MB5325.eurprd08.prod.outlook.com ([fe80::89dc:c731:362b:7c69%4]) with mapi id 15.20.7587.030; Mon, 20 May 2024 11:20:11 +0000 From: Tamar Christina To: "pan2.li@intel.com" , "gcc-patches@gcc.gnu.org" CC: "juzhe.zhong@rivai.ai" , "kito.cheng@gmail.com" , "richard.guenther@gmail.com" Subject: RE: [PATCH v1] Match: Extract integer_types_ternary_match helper to avoid code dup [NFC] Thread-Topic: [PATCH v1] Match: Extract integer_types_ternary_match helper to avoid code dup [NFC] Thread-Index: AQHaqaNtbo7TvNw33U2WEFeOO9kPL7Gf8Ovw Date: Mon, 20 May 2024 11:20:11 +0000 Message-ID: References: <20240519041651.1743716-1-pan2.li@intel.com> In-Reply-To: <20240519041651.1743716-1-pan2.li@intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: Authentication-Results-Original: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com; x-ms-traffictypediagnostic: VI1PR08MB5325:EE_|PAWPR08MB9808:EE_|AMS0EPF00000192:EE_|DU5PR08MB10516:EE_ X-MS-Office365-Filtering-Correlation-Id: 683c4015-4343-47b1-5d27-08dc78bed5d6 x-checkrecipientrouted: true nodisclaimer: true X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Untrusted: BCL:0;ARA:13230031|1800799015|376005|366007|38070700009; X-Microsoft-Antispam-Message-Info-Original: =?us-ascii?Q?pCjA1VQRgJfv3P5si1SbcN/KRQ20ITKBN7gWoA+A90UXTmeEfmYm2qCRIhCN?= =?us-ascii?Q?T48iEqz0gEL1G8l+kn7FhLa34U51IYtkB+A3zX1j2hJIkv0rMReTWjyA70px?= =?us-ascii?Q?rqTOnmvXvXhDScM2HtGDLGRV6tYRePahC+rDZ8lQb6JgC7FWpwGlATO9tKsL?= =?us-ascii?Q?jPXxIk3QnB5Ao5TSUuIekxuLv81XHb/jHUBrE0bB1EEpzR+1DTj4DFpAk/dC?= =?us-ascii?Q?5pt3uZqnh3ZhcFyaMbsfyAwI8a6h/nSaUnZRDKwcOVYb+KIWiJhz1SeVbyWb?= =?us-ascii?Q?CvavAsQlOhNV6AxJ359vIreOBWYI/Ij8F0W9s2xjsKP56o3Po1CmQNxBNoIZ?= =?us-ascii?Q?uOVCGOi8FwP5uoD0PFpWYwys+fpQbmhMGrv0pQVMIuRPksRh4XS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428l9XxJIx5dyXknGsvvfWd65Iyz6YKLN?= =?us-ascii?Q?e4rjrwcKQKeE7BymcTCGFbOfln1Ib1BuX0ykfrxgLwOiTA=3D=3D?= X-Forefront-Antispam-Report-Untrusted: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:VI1PR08MB5325.eurprd08.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(1800799015)(376005)(366007)(38070700009);DIR:OUT;SFP:1101; Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAWPR08MB9808 Original-Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com; X-EOPAttributedMessage: 0 X-MS-Exchange-Transport-CrossTenantHeadersStripped: AMS0EPF00000192.eurprd05.prod.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: 9975791e-f85f-437f-37ba-08dc78bed022 X-Microsoft-Antispam: BCL:0;ARA:13230031|82310400017|1800799015|36860700004|376005|35042699013; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?PRi02ggsiXqwzbRkL2CRjjJm1SI3Ccs8AtRC+kg/LFjhaO27jeWiZUxs8GZJ?= =?us-ascii?Q?5+9RELK+Qof6ltpYP1r7gLWZBn8ok7HltPQi0IToFiIHtOK9U/PXEm4xqHlc?= =?us-ascii?Q?Kzgw5Htm+QxXa3tqH0rViBjrpt8qBfvNhYzKIXnblNlXuFdSO1u+pFkQqs/a?= =?us-ascii?Q?6Sb6bp6CZ0BEu37sg/7IP6ViNkF89xeZjMHXU6lBo+jUIvXQUxPZruwulNgM?= =?us-ascii?Q?aSYXN19D1c/OhAAyTTLEFkbx9P9PGnPZVVrVy/yI9kVyP6504tfE83+pe4vq?= =?us-ascii?Q?S9AIWIezXFOJIEhMtIC0kMq+PtodJqlnRBQxMab5INpVU4obERw3x8pr2RQL?= =?us-asc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uAeT7mwUpe2rkC7g?= =?us-ascii?Q?Azum6hdmPF5cIjnXHtbPSSwgDdH27kGMd8RWyEoxNI/W+KKn9G4kNdhY3jKJ?= =?us-ascii?Q?zyX9NAkh+Wqu+3V7ROlVm+ufCcgjPlsGK+jQx3AbaCXTvmJ6GL2ESBLC4she?= =?us-ascii?Q?uqu86dpFGIUo/P548CFjizXlzD88?= X-Forefront-Antispam-Report: CIP:63.35.35.123;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:64aa7808-outbound-1.mta.getcheckrecipient.com;PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com;CAT:NONE;SFS:(13230031)(82310400017)(1800799015)(36860700004)(376005)(35042699013);DIR:OUT;SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 May 2024 11:20:20.5701 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 683c4015-4343-47b1-5d27-08dc78bed5d6 X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d;Ip=[63.35.35.123];Helo=[64aa7808-outbound-1.mta.getcheckrecipient.com] X-MS-Exchange-CrossTenant-AuthSource: AMS0EPF00000192.eurprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU5PR08MB10516 X-Spam-Status: No, score=-12.5 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FORGED_SPF_HELO,GIT_PATCH_0,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_NONE,TXREP,UNPARSEABLE_RELAY 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: > -----Original Message----- > From: pan2.li@intel.com > Sent: Sunday, May 19, 2024 5:17 AM > To: gcc-patches@gcc.gnu.org > Cc: juzhe.zhong@rivai.ai; kito.cheng@gmail.com; Tamar Christina > ; richard.guenther@gmail.com; Pan Li > > Subject: [PATCH v1] Match: Extract integer_types_ternary_match helper to = avoid > code dup [NFC] >=20 > From: Pan Li >=20 > There are sorts of match pattern for SAT related cases, there will be > some duplicated code to check the dest, op_0, op_1 are same tree types. > Aka ternary tree type matches. Thus, extract one helper function to > do this and avoid match code duplication. >=20 > The below test suites are passed for this patch: > * The rv64gcv fully regression test. > * The x86 bootstrap test. > * The x86 regression test. >=20 > gcc/ChangeLog: >=20 > * generic-match-head.cc (integer_types_ternary_match): New helper > function to check tenary tree type matches or not. > * gimple-match-head.cc (integer_types_ternary_match): Ditto but > for match. > * match.pd: Leverage above helper function to avoid code dup. >=20 Nice cleanup! This function isn't part of the machinery of match.pd and is instead part o= f a pattern. For these things we usually put them in tree.h/tree.cc and declare them at = the top of match.pd in the "define_predicates" list. This will also allow you to get rid of the code duplication. In addition s= uch functions which return a true/false we consider predicates, and name them ending with= _p. See e.g. bitmask_inv_cst_vector_p which is also defined in tree.h/tree.cc. Cheers, Tamar > Signed-off-by: Pan Li > --- > gcc/generic-match-head.cc | 17 +++++++++++++++++ > gcc/gimple-match-head.cc | 17 +++++++++++++++++ > gcc/match.pd | 25 +++++-------------------- > 3 files changed, 39 insertions(+), 20 deletions(-) >=20 > diff --git a/gcc/generic-match-head.cc b/gcc/generic-match-head.cc > index 0d3f648fe8d..cdd48c7a5cc 100644 > --- a/gcc/generic-match-head.cc > +++ b/gcc/generic-match-head.cc > @@ -59,6 +59,23 @@ types_match (tree t1, tree t2) > return TYPE_MAIN_VARIANT (t1) =3D=3D TYPE_MAIN_VARIANT (t2); > } >=20 > +/* Routine to determine if the types T1, T2 and T3 are effectively > + the same integer type for GENERIC. If T1, T2 or T3 is not a type, > + the test applies to their TREE_TYPE. */ > + > +static inline bool > +integer_types_ternary_match (tree t1, tree t2, tree t3) > +{ > + t1 =3D TYPE_P (t1) ? t1 : TREE_TYPE (t1); > + t2 =3D TYPE_P (t2) ? t2 : TREE_TYPE (t2); > + t3 =3D TYPE_P (t3) ? t3 : TREE_TYPE (t3); > + > + if (!INTEGRAL_TYPE_P (t1) || !INTEGRAL_TYPE_P (t2) || !INTEGRAL_TYPE_P > (t3)) > + return false; > + > + return types_match (t1, t2) && types_match (t1, t3); > +} > + > /* Return if T has a single use. For GENERIC, we assume this is > always true. */ >=20 > diff --git a/gcc/gimple-match-head.cc b/gcc/gimple-match-head.cc > index 5f8a1a1ad8e..91f2e56b8ef 100644 > --- a/gcc/gimple-match-head.cc > +++ b/gcc/gimple-match-head.cc > @@ -79,6 +79,23 @@ types_match (tree t1, tree t2) > return types_compatible_p (t1, t2); > } >=20 > +/* Routine to determine if the types T1, T2 and T3 are effectively > + the same integer type for GIMPLE. If T1, T2 or T3 is not a type, > + the test applies to their TREE_TYPE. */ > + > +static inline bool > +integer_types_ternary_match (tree t1, tree t2, tree t3) > +{ > + t1 =3D TYPE_P (t1) ? t1 : TREE_TYPE (t1); > + t2 =3D TYPE_P (t2) ? t2 : TREE_TYPE (t2); > + t3 =3D TYPE_P (t3) ? t3 : TREE_TYPE (t3); > + > + if (!INTEGRAL_TYPE_P (t1) || !INTEGRAL_TYPE_P (t2) || !INTEGRAL_TYPE_P > (t3)) > + return false; > + > + return types_match (t1, t2) && types_match (t1, t3); > +} > + > /* Return if T has a single use. For GIMPLE, we also allow any > non-SSA_NAME (ie constants) and zero uses to cope with uses > that aren't linked up yet. */ > diff --git a/gcc/match.pd b/gcc/match.pd > index 0f9c34fa897..b291e34bbe4 100644 > --- a/gcc/match.pd > +++ b/gcc/match.pd > @@ -3046,38 +3046,23 @@ DEFINE_INT_AND_FLOAT_ROUND_FN (RINT) > /* Unsigned Saturation Add */ > (match (usadd_left_part_1 @0 @1) > (plus:c @0 @1) > - (if (INTEGRAL_TYPE_P (type) > - && TYPE_UNSIGNED (TREE_TYPE (@0)) > - && types_match (type, TREE_TYPE (@0)) > - && types_match (type, TREE_TYPE (@1))))) > + (if (TYPE_UNSIGNED (type) && integer_types_ternary_match (type, @0, @1)= ))) >=20 > (match (usadd_left_part_2 @0 @1) > (realpart (IFN_ADD_OVERFLOW:c @0 @1)) > - (if (INTEGRAL_TYPE_P (type) > - && TYPE_UNSIGNED (TREE_TYPE (@0)) > - && types_match (type, TREE_TYPE (@0)) > - && types_match (type, TREE_TYPE (@1))))) > + (if (TYPE_UNSIGNED (type) && integer_types_ternary_match (type, @0, @1)= ))) >=20 > (match (usadd_right_part_1 @0 @1) > (negate (convert (lt (plus:c @0 @1) @0))) > - (if (INTEGRAL_TYPE_P (type) > - && TYPE_UNSIGNED (TREE_TYPE (@0)) > - && types_match (type, TREE_TYPE (@0)) > - && types_match (type, TREE_TYPE (@1))))) > + (if (TYPE_UNSIGNED (type) && integer_types_ternary_match (type, @0, @1)= ))) >=20 > (match (usadd_right_part_1 @0 @1) > (negate (convert (gt @0 (plus:c @0 @1)))) > - (if (INTEGRAL_TYPE_P (type) > - && TYPE_UNSIGNED (TREE_TYPE (@0)) > - && types_match (type, TREE_TYPE (@0)) > - && types_match (type, TREE_TYPE (@1))))) > + (if (TYPE_UNSIGNED (type) && integer_types_ternary_match (type, @0, @1)= ))) >=20 > (match (usadd_right_part_2 @0 @1) > (negate (convert (ne (imagpart (IFN_ADD_OVERFLOW:c @0 @1)) > integer_zerop))) > - (if (INTEGRAL_TYPE_P (type) > - && TYPE_UNSIGNED (TREE_TYPE (@0)) > - && types_match (type, TREE_TYPE (@0)) > - && types_match (type, TREE_TYPE (@1))))) > + (if (TYPE_UNSIGNED (type) && integer_types_ternary_match (type, @0, @1)= ))) >=20 > /* We cannot merge or overload usadd_left_part_1 and usadd_left_part_2 > because the sub part of left_part_2 cannot work with right_part_1. > -- > 2.34.1