From patchwork Mon Aug 5 10:36:05 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Feng Xue OS X-Patchwork-Id: 1969020 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=os.amperecomputing.com header.i=@os.amperecomputing.com header.a=rsa-sha256 header.s=selector2 header.b=ogeWxgCn; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=2620:52:3:1:0:246e:9693:128c; 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 [IPv6:2620:52:3:1:0:246e:9693:128c]) (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 4WctCT4NBFz1yYD for ; Mon, 5 Aug 2024 20:36:37 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 6DE223858401 for ; Mon, 5 Aug 2024 10:36:35 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from NAM11-CO1-obe.outbound.protection.outlook.com (mail-co1nam11on20700.outbound.protection.outlook.com [IPv6:2a01:111:f403:2416::700]) by sourceware.org (Postfix) with ESMTPS id 483723858401 for ; Mon, 5 Aug 2024 10:36:13 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 483723858401 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=os.amperecomputing.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=os.amperecomputing.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 483723858401 Authentication-Results: server2.sourceware.org; arc=pass smtp.remote-ip=2a01:111:f403:2416::700 ARC-Seal: i=2; a=rsa-sha256; d=sourceware.org; s=key; t=1722854174; cv=pass; b=WXlgi6gFYn2/HM55Hhe9qU6VZg86938C8vt2yP7UB/z2CNBtMC39f095Hit4SX0m58HaKYZaks3ftf4fK8wLf0/EpNh6K69hENXe8cTNKPUUkDqa5sZpGASx4MVKbqJmptxaXsZVxGRMIO9xSsYRh+VMZypdmgtwGn+bTzJLUUM= ARC-Message-Signature: i=2; a=rsa-sha256; d=sourceware.org; s=key; t=1722854174; c=relaxed/simple; bh=jKWLPsMNN/mWQxtBtwd2NGDJZaYmqQDEoo0g8QgY+rM=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=MxoRmWxhiKPM2VfpueGIaq8DTl2k1JefRG+C7PYji+uQU+V5he88CoyHubhyNlml7e9JpLJuT8vCgpKR5orGujvutIoNacCDW6c3jcfREe52kQ3xGTOTWmFwiKuK/4zBGYOT7syX4zqYiaQlGADLKIxODkRPZ0vkAJgamTMDB1o= ARC-Authentication-Results: i=2; server2.sourceware.org ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=KDFqUdUutD4OwGUQITffJQtMvk3Rht9CqtLb0+LcyJwcQw5lWmimPIIp4aX7uzRrhEMM3InuVlCxKKGgz3utT78ivWXuSeviHeX1PFh5PxHTh1QK9kKtQg8cVMxxE+UNgbhZbMrhNTdVeaGBcyOcmk0pGH9Y+kGlrwdo/cKDVHYtQTXQQg975H6dMYQ1162M9WhSKBZY7QwvWdOeWZpuCGAAo2sOrpPFmRpfFnKSJrN6MTfz0i4lQNc9ER/E9b/+lJ+ut/U/BOXeU33m94OaDI445Ap3Dv7WR27wsVpXKpYKhTttze2TocLZa/9KbNWJxo9JCpeLpkl1Xcx3QmxEFw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=3dehXUEemumWa7/AK7w/mz6pc3XSxbXTS2bpO8N9CKU=; b=F0cRuuZNq55So5FssdQQnJKMkoOmPBiOjpbNfIZN5HxWGDLt87cJ8CTJzYHIYu6WdtFNVzwlTP6V5L8gN/gOzGJYGwoqAf1omfFGGbIKnC0Pc48EZ14V5II1gVC7NYtpnqeEwwelIrQsiVJZuQrCnlQ7NeNUJLMldv4fWBCZxweMsnTpa3k1LEMKivi9wcq4yUKFQPhsSiBxpqiTOEvv9tJgAK3MRKXAtiXimn3P1Xie/1WlBA+8WlkSDu/b61YfmX4SzEt2cllyWKYQEUYBu+o9SP6JeRbXj+crfd4HIES95METfeWNNhD+i+N9stinT4UR8ifci5+vP8cgGUioHw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=os.amperecomputing.com; dmarc=pass action=none header.from=os.amperecomputing.com; dkim=pass header.d=os.amperecomputing.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=os.amperecomputing.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=3dehXUEemumWa7/AK7w/mz6pc3XSxbXTS2bpO8N9CKU=; b=ogeWxgCnMKBQ/wMW4IDobqgfVQH+WX41ZAquGkIv2hwg+CiszFb+0FiRwMlqIjyJc5NqlrCnxoRJcLfLfPhRZCxZMworOGgiLusT8G4I7/PHEv0kFeKnd4UkKSjpriRoade3D9lOuCoiMUjZLI46OWLvqCJ89qhDSFwcfwBog+g= Received: from LV2PR01MB7839.prod.exchangelabs.com (2603:10b6:408:14f::13) by BY3PR01MB6724.prod.exchangelabs.com (2603:10b6:a03:369::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7828.23; Mon, 5 Aug 2024 10:36:05 +0000 Received: from LV2PR01MB7839.prod.exchangelabs.com ([fe80::2ac3:5a77:36fd:9c63]) by LV2PR01MB7839.prod.exchangelabs.com ([fe80::2ac3:5a77:36fd:9c63%4]) with mapi id 15.20.7828.023; Mon, 5 Aug 2024 10:36:05 +0000 From: Feng Xue OS To: Richard Biener , "gcc-patches@gcc.gnu.org" Subject: [PATCH] vect: Add missed opcodes in vect_get_smallest_scalar_type [PR115228] Thread-Topic: [PATCH] vect: Add missed opcodes in vect_get_smallest_scalar_type [PR115228] Thread-Index: AQHa5yMqSglfq1nzcEKiZlCR6mj9IQ== Date: Mon, 5 Aug 2024 10:36:05 +0000 Message-ID: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: msip_labels: MSIP_Label_5b82cb1d-c2e0-4643-920a-bbe7b2d7cc47_Enabled=True; MSIP_Label_5b82cb1d-c2e0-4643-920a-bbe7b2d7cc47_SiteId=3bc2b170-fd94-476d-b0ce-4229bdc904a7; MSIP_Label_5b82cb1d-c2e0-4643-920a-bbe7b2d7cc47_SetDate=2024-08-05T10:36:05.296Z; MSIP_Label_5b82cb1d-c2e0-4643-920a-bbe7b2d7cc47_Name=Confidential; MSIP_Label_5b82cb1d-c2e0-4643-920a-bbe7b2d7cc47_ContentBits=0; MSIP_Label_5b82cb1d-c2e0-4643-920a-bbe7b2d7cc47_Method=Standard; authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=os.amperecomputing.com; x-ms-publictraffictype: Email x-ms-traffictypediagnostic: LV2PR01MB7839:EE_|BY3PR01MB6724:EE_ x-ms-office365-filtering-correlation-id: 4910abd8-4de9-498a-7ed3-08dcb53a6919 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; ARA:13230040|1800799024|366016|376014|38070700018; x-microsoft-antispam-message-info: =?iso-8859-1?q?U67ae2f3MkNumdVr3BEf9a9FmL?= =?iso-8859-1?q?bwb97cIpebEOQWd0cHT2naF75NKmwgJjB2dAkWuzOJJ+GFkPB0bCypbA/wIt?= =?iso-8859-1?q?5S0lPBtSceNdiaO60y+2mxM5yFVwzD7VTIptBd3vPVRI435P0Xbf6QUjgnK6?= =?iso-8859-1?q?HgjfUb9hTIQ3nHWYkiDukKXhy8Wo3cDMdhoL4+gHAj3tp/CsNYckWSCvxw5c?= =?iso-8859-1?q?qpiTKUQiXPqRmDD0EUpeD4hV8miF1yc/4IiyHI5hBY9GI+TVGfBjVBQHRvfG?= =?iso-8859-1?q?vYA9xnjPglFyKnNVFLO+QdPHoOR5yOEe28GWh8CYpB24GqdEbU/RWECzBY2A?= =?iso-8859-1?q?ecJJrZuAaf038j8CVCr59+k0JI6aJ3ckOhmeOYz+Jp1W6svw4INjIpoN0DAS?= =?iso-8859-1?q?PxDTihonekA966RrDCMAGjtA+WsPVlC6H4EH2gPRQOnsfHJTm08W6VHHIr+C?= =?iso-8859-1?q?k6dK+UXDvbaxfvbKpjbucUAIbVCQVSINPx7/IYKWX5PODg5evKARycnK+wVr?= =?iso-8859-1?q?SnSGL/SFRaVdMrrkpkMzEFn2WGpI07OZPKIgUe6C9bhl5KVuA7VGALHx0UmC?= =?iso-8859-1?q?QduvwtorrEcOU+mDlAjz2THzOJGcy0hL4SdDP9zzSeLqmDdPSxD8+dtGAWg4?= =?iso-8859-1?q?GoOOndgrNXiELDVsePcdXWFXArnqeU/VYK5gbnkZz8IhvU4eJdtZaIQ7j538?= =?iso-8859-1?q?hV2tYuHRWNbmiUH7b/eJdPSJw0biN0Ikk94ar9BsXSijBUdXqdYiw7yDv+My?= =?iso-8859-1?q?7ZH3aEx2Y9M8Ire2K4oO4WPpm3E/Url2XFpilVfo8RQb6swclPLWoJxoZ2Ft?= =?iso-8859-1?q?c+qWyoqwhCPemo/CsZeJZap3iNp+bbHzK+txpkejUnQJgzPe64t2M+GSgIyA?= =?iso-8859-1?q?Hty8wdwBmKSwELl2/GBzwFA7BnG7+RL/bGxQ7FrW+ZialBVz+J/kT/15c+S+?= =?iso-8859-1?q?SM+/3WxFjeFCkgyh9TFCBnxN4MGsJ1ebJCYrU6DYZieqwmAi4DE/FAnHt1ou?= =?iso-8859-1?q?NqL9Ykpaz68VI8DwPOa2/nzRQSVagDQ8z/ZOJmf1EtNc7XsQxVcrWwuRu5Er?= =?iso-8859-1?q?X9vb3EAHITZkza7r609m5oGlPqZT7sOIdlx3QRaYvCz74KjvBh42/Eqs8ZUO?= =?iso-8859-1?q?32+vcYOO/ygljGgLdXDTcMkcmOnk/3qVWFKTDF3SWWnKM3y6qzG5MqPE3BYB?= =?iso-8859-1?q?sVTsg8xnue6c9CbV+eEXD+nsbx4S+8ehWhrIfSWA33hcK0PuhlSrE7IeWB9J?= =?iso-8859-1?q?cp9yQ0K6jqZsudwSY81TkhITr8IlpmRQEuhx5eEB02PEf5S8LULv7vLYdAy6?= =?iso-8859-1?q?zzHwji9VERy3Vmx9gCrXI+3GiAtZZzJfz0Bytn+9FLuFkt0UmLw2D8dNX+NN?= =?iso-8859-1?q?7oq9DRT6qWH6Jwv0+nELgrYZi8CvQ4Xhem3E8ZYpL1o+9n3c7tgSC/wk+Ctu?= =?iso-8859-1?q?Gy4mDJQIsqcAN/20Pkmb2JjQ=3D=3D?= x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:LV2PR01MB7839.prod.exchangelabs.com; PTR:; CAT:NONE; SFS:(13230040)(1800799024)(366016)(376014)(38070700018); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?iso-8859-1?q?CkPiTr/gclIK7x542SvQBOY?= =?iso-8859-1?q?9Ido7lJxIWxi9duAr7tOF6QSPY+FwnT7PwkC5pDbDn9p8qITbk36NpYGELTA?= =?iso-8859-1?q?BTiVsdqoGmiAISdljOThThCyJ435xHNkqZEEsRL0FsF+xFIFzyxSUFIQkMWU?= =?iso-8859-1?q?wbKH69UyoOEm15V3D/xZplgHNITuaFDvNbQMfq9pBdQrJU1YwfXi6eKBrkoI?= =?iso-8859-1?q?u25w+n+nnQCJeho9Kx+zYaPT/GTK8v75a/Akh4+E/zsVZF7zdqf44+XM4utC?= =?iso-8859-1?q?6gL/nw01oPFe07XX6VBLjCiy7CWEmZUic1KWEWo1ohWpVzlUIYBbIzvBEiwO?= =?iso-8859-1?q?fFgPXKI7G8O86WlLppzamsXBvoE46402CoHhSgCMBXQaZm5ZWOBXGbICFloB?= =?iso-8859-1?q?yCig4HLPATMI7kCesl5FOobDKWa+tOD3NjknO3J6KOlsHHLyFPOweP2+1LYt?= =?iso-8859-1?q?e4o1D51NE6GozB2zPqi3NuZZMfROBeQBtjmSUbqhPIXJqhI+krk/ZDg1s+vh?= =?iso-8859-1?q?GOAUIqo67FhVkCgcg1FUqNB5DaxBfw74iw1x0E5lrrb7dJOR7uYddLRkvB21?= =?iso-8859-1?q?zcCzKt+1jk1S+34ifB7i/oBIaLwobqY5t/YJX4ho4sOiG0rnf4s6fEU4sDdX?= =?iso-8859-1?q?ZEHZFAJanDkOS1x0a6t4SeGngnm5XfZvSHzayaTLHh8hyQYk5SV6k1207bxg?= =?iso-8859-1?q?p6l65IWSRsqvhqwn4H7i3dITUOIyFA1wCc24vQg00Est7TPjn+nLWFrAvLVj?= =?iso-8859-1?q?21ESIag4ahq3AwosHKW/1NYZCaA21F/+cIeXPqvShlMd0Ol/2bygAPA9NsXh?= =?iso-8859-1?q?y4zqVdxptB3Gcppf/t9pMZjdTDjJ2XyHqLikNrDYlhp3q93X5qSk98o4SZPv?= =?iso-8859-1?q?C33D2D6NuyMHWAHMC4+i6AQhNr8OTg/3s8T+iDmspMjZkhmO7kVyNi5OxViQ?= =?iso-8859-1?q?0xw8jKcS9GYQwUVtG6ZVEKY3RCI8Qcdd9s8JPWoEq+uRqXNwwHdfIoZGti/p?= =?iso-8859-1?q?MBYsTUAjWLUJf8q/v2U4OoOO4Qk4gemmLiM0bmSyeaplEysHUzX/4MhXufCf?= =?iso-8859-1?q?t9vQSDz4A3MRggQ7ckQHWa2D5NdFtbJsU2z1yDdqg7p7693fwkTtnJPzRJWi?= =?iso-8859-1?q?J1rh1sDNN955V8+/hY77wvMKHqeW287nBNXWd9PHcVS3RdXaI5UwgU6j4aJ+?= =?iso-8859-1?q?6ArSaSH5YRbioPTwLBd7uQAF+ZZuYiZXmLOVaUaKWU0Y0M1qbsIDKV0foWO7?= =?iso-8859-1?q?nBNgi67BppIJIuPlXvhAyhiJ5MTru7m9i7GpFo/XtJtvuY5Dx4drQmEZixL/?= =?iso-8859-1?q?Mvp5JktY5Sz207zmy2LP6b6eIMDlfJzfktGnOiyqto5EJupNpqJ6jxJR6GqG?= =?iso-8859-1?q?EPYUKN+bmxigp0BYGIAvEM/h2NVkD++DxhyAqwSqpcAxgvWNB6cDvwjehkfd?= =?iso-8859-1?q?WPoXtYStmDnZsDFtmCuK8aAVp6WPf5H0mDmzRBcPuyi1PrbSRXx/oV5yfBWo?= =?iso-8859-1?q?F9rugsMieaXJ4IB/gmQZjUHUXoMVHXrK9M7/5lGHLri5n4dx+d94HkktEwOA?= =?iso-8859-1?q?0cuzSC5zOq48PxhfxuJNoXG4BHHcGvOGJc9HlZzqhQGUsnSw1nTmAMe7vnJc?= =?iso-8859-1?q?yT/OKPbXBrWoDXnoBZ56Ha2IAqzsuAH8RG7IYbA=3D=3D?= MIME-Version: 1.0 X-OriginatorOrg: os.amperecomputing.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: LV2PR01MB7839.prod.exchangelabs.com X-MS-Exchange-CrossTenant-Network-Message-Id: 4910abd8-4de9-498a-7ed3-08dcb53a6919 X-MS-Exchange-CrossTenant-originalarrivaltime: 05 Aug 2024 10:36:05.5550 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 3bc2b170-fd94-476d-b0ce-4229bdc904a7 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: 7JLzyks7IFOjwi+LOcygpojLzMjCP1x80Cd8INCneuckSj6eHZPm21oQ7eL8ClVHj1QUFp1p7RYpacFIf6Sw927LUcD5PmWs574kDtsv5/w= X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY3PR01MB6724 X-Spam-Status: No, score=-12.4 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, GIT_PATCH_0, SPF_HELO_PASS, 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 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces~incoming=patchwork.ozlabs.org@gcc.gnu.org Some opcodes are missed when determining the smallest scalar type for a vectorizable statement. Currently, this bug does not cause any problem, because vect_get_smallest_scalar_type is only used to compute max nunits vectype, and even statement with missed opcode is incorrectly bypassed, the max nunits vectype could also be rightly deduced from def statements for operands of the statement. In the future, if this function will be called to do other thing, we may get something wrong. So fix it in this patch. Thanks, Feng --- gcc/ * tree-vect-data-refs.cc (vect_get_smallest_scalar_type): Add missed opcodes that involve widening operation. --- gcc/tree-vect-data-refs.cc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/gcc/tree-vect-data-refs.cc b/gcc/tree-vect-data-refs.cc index 39fd887a96b..5b0d548f847 100644 --- a/gcc/tree-vect-data-refs.cc +++ b/gcc/tree-vect-data-refs.cc @@ -162,7 +162,10 @@ vect_get_smallest_scalar_type (stmt_vec_info stmt_info, tree scalar_type) if (gimple_assign_cast_p (assign) || gimple_assign_rhs_code (assign) == DOT_PROD_EXPR || gimple_assign_rhs_code (assign) == WIDEN_SUM_EXPR + || gimple_assign_rhs_code (assign) == SAD_EXPR || gimple_assign_rhs_code (assign) == WIDEN_MULT_EXPR + || gimple_assign_rhs_code (assign) == WIDEN_MULT_PLUS_EXPR + || gimple_assign_rhs_code (assign) == WIDEN_MULT_MINUS_EXPR || gimple_assign_rhs_code (assign) == WIDEN_LSHIFT_EXPR || gimple_assign_rhs_code (assign) == FLOAT_EXPR) {