| Message ID | patch-20589-tamar@arm.com |
|---|---|
| State | New |
| Headers |
Return-Path: <gcc-patches-bounces~patchwork=sourceware.org@gcc.gnu.org> X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from vm01.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 359784BA23CD for <patchwork@sourceware.org>; Wed, 3 Jun 2026 07:52:43 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 359784BA23CD Authentication-Results: sourceware.org; dkim=pass (1024-bit key, unprotected) header.d=arm.com header.i=@arm.com header.a=rsa-sha256 header.s=selector1 header.b=ThGGVYBG; dkim=pass (1024-bit key) header.d=arm.com header.i=@arm.com header.a=rsa-sha256 header.s=selector1 header.b=ThGGVYBG X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from AM0PR83CU005.outbound.protection.outlook.com (mail-westeuropeazlp170100001.outbound.protection.outlook.com [IPv6:2a01:111:f403:c201::1]) by sourceware.org (Postfix) with ESMTPS id 217CB4BA2E08 for <gcc-patches@gcc.gnu.org>; Wed, 3 Jun 2026 07:51:32 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 217CB4BA2E08 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 217CB4BA2E08 Authentication-Results: sourceware.org; arc=pass smtp.remote-ip=2a01:111:f403:c201::1 ARC-Seal: i=3; a=rsa-sha256; d=sourceware.org; s=key; t=1780473092; cv=pass; b=pGCFOqZ91zF2BeWbAOI05IVXmcJbTJ82kml8BU2t81awpDF2J6CscDx1fuYKsrhbu6yMh4lKHELZk7CSAdbuxfeio8FDaPrhLdNQAdgSWnZqbUPobcblyjCsD6cZ+fctnpWlU980CBf1+9rIIqAgCOTzTbPOEBte5SjIpwl7uZM= ARC-Message-Signature: i=3; a=rsa-sha256; d=sourceware.org; s=key; t=1780473092; c=relaxed/simple; bh=PRdrfj61rGRevMCXWwKFaGypS+zyQBpK/YmUf5+q5GU=; h=DKIM-Signature:DKIM-Signature:Date:From:To:Subject:Message-ID: MIME-Version; b=mhe7ORNtIMEb8wdFlAelK043j5RWb5C6+GOZuOQO18y0YSsmDa8uKcyyEoUAohagVBAnSgkKqIhGGhQ/h3ejRtM7cDvB0M+E+QvR/qZKdGlJwOo4pE6wi8YHXtrG/jkrfqozC4vNrXoPqiDSm0FLBx5FIa2AYNFnEui4n6qSM+Q= ARC-Authentication-Results: i=3; sourceware.org; dkim=pass (1024-bit key, unprotected) header.d=arm.com header.i=@arm.com header.a=rsa-sha256 header.s=selector1 header.b=ThGGVYBG; dkim=pass (1024-bit key) header.d=arm.com header.i=@arm.com header.a=rsa-sha256 header.s=selector1 header.b=ThGGVYBG DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 217CB4BA2E08 ARC-Seal: i=2; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=pass; b=fvsMFCrqjPilr1Ca29nhwb/G1qbDOXrpwTp4qbW0OmYXD7BsfqR6LcLWJl3V/j4i/klt+vIpF7MFl0/0Q2NvroO/yorSoBwb5uz8YXiz+nIfRdYkm/qWjTIVFiYEN8vavxCLgyy5wAeQO1c57pRjHKm2in9AjgkjJiY9YLkcR6YEbCRmtt47190rq9400Vz5SEdx5I6I1YZXdIbRRmYXdLv4FbkOdP1z0TvChNxRbhsZ00RdnmuzFON383RnskhcH0ZC9HFM6dObB5G3smwT3PdV0VDsbrRB4E1/R1PrYlpOnInmbfTFDSK8fgEsaq2QaJWIcMJ3tmBOuPHK7gkzSw== ARC-Message-Signature: i=2; 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=3FbMq8qK8ov133ubyLm5TdnJOM0xOOkb7wvPRG2tz/w=; b=JlG0AX/48MQb7XFSWlPDGq5yJrJvfABWR/xxWkazM/R1SlW1q0Q8871dGz+UAWIiUOmVnuGuaxulyQHXB/a5r0HXskdZem1wzu0KCeIwrx3/2aTmNUSQiDPiiQJ8BMy9RruBS9G4CiKRemvVuB0ii/NOZMe0En/6ZoJ9E/IqrQcDanblwDuFAWSpQs1gLZ9w0F+/cFUTS02tK3xgz16X31gkguQLIL3wdkLCDZ4LVCPstirquM9xHGYlMFmnsWVsYosUByG4R6bfvU8lUfr7SPzVzqRciKuV0qBkRuYqtpxOeAwk6dwYwHFGMaTFFj0tcJuoqIww79jPYR6M71eQhg== ARC-Authentication-Results: i=2; mx.microsoft.com 1; spf=pass (sender ip is 4.158.2.129) 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=3FbMq8qK8ov133ubyLm5TdnJOM0xOOkb7wvPRG2tz/w=; b=ThGGVYBGRAH4zW9r4vj96NI7e33kiwKXER49tyYcgttYHZlk74Xy8L/oOPxv+Q7dml9W17Nbnq6ci8G/Gxgjme1OA2CJE2lUvqD51H3L4bCgylhxDd9DWELC7Q9KE+vsmB3zU55WRswL2ffB3umkD98bEu3EpW874quStWOTWWc= Received: from CWLP265CA0321.GBRP265.PROD.OUTLOOK.COM (2603:10a6:401:57::21) by AS4PR08MB7479.eurprd08.prod.outlook.com (2603:10a6:20b:4e6::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.71.15; Wed, 3 Jun 2026 07:51:26 +0000 Received: from AM4PEPF00027A65.eurprd04.prod.outlook.com (2603:10a6:401:57:cafe::94) by CWLP265CA0321.outlook.office365.com (2603:10a6:401:57::21) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.21.92.7 via Frontend Transport; Wed, 3 Jun 2026 07:51:26 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 4.158.2.129) 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 4.158.2.129 as permitted sender) receiver=protection.outlook.com; client-ip=4.158.2.129; helo=outbound-uk1.az.dlp.m.darktrace.com; pr=C Received: from outbound-uk1.az.dlp.m.darktrace.com (4.158.2.129) by AM4PEPF00027A65.mail.protection.outlook.com (10.167.16.86) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.21.92.5 via Frontend Transport; Wed, 3 Jun 2026 07:51:26 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=EJMX0jr6ZVrNn9EpKPUUu3Y0uTqd+yxQ4iII5Z2v0Wrs/8REQ1WBhPnx1xrzAhHXCADy0TBkR+G2SL5YBSS9kVgKuFen47cBiSCMQ7BNnO4f0oy04I/GXNK3gRlANTkqMaWxViuFRAA5TaG3JY8xg0T2wan1qyvg95mctNF2l+emDtRhzQtFRdkUzH3+dzhCEBXSOYAZHfN0YrXZN08RvXnSAn7+OmbGuuD+5vBqCrxgLaKo4V7hVZf15SZQGFb35QCydOyf+WUPXC1kBybhLEkxjlT14Pxkek738IP47g7IYKrzhKuEbDYw8ag/raVc8lmHxisO0PEPdph+fWWQsg== 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=3FbMq8qK8ov133ubyLm5TdnJOM0xOOkb7wvPRG2tz/w=; b=u31L+OeTjsduvi7/pyABpZmiNbTEVWN8AZzZXGWIYgmrUfAgTMuBhzZV9MN0hT2oYVw7tMgVVU1lJ6XbEOjrc4Zu4pz0sYNCg5kvlggNNbMyePiR/azRnjRh9S4G2IdG7ls+7C7Y5Ig8VaH5KV5K2vvmbGZuIrfCEqNL1H0LtEpbCrm7PHnNKwslnbGw7dEyxALDwMy3XKIsNu+fck8Qt7fkQa1uWcN8lyto1G1K3Ylga/fD2vWFYTO2ojpyfzz0cd889t1aWLH/uKG8OJA5aUKWJLxBJeViMc/P4UcKN4Ju7IVcvDbIy/c4Y77nLKd67dPPShz72SEBpMXPeK4zKA== 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=3FbMq8qK8ov133ubyLm5TdnJOM0xOOkb7wvPRG2tz/w=; b=ThGGVYBGRAH4zW9r4vj96NI7e33kiwKXER49tyYcgttYHZlk74Xy8L/oOPxv+Q7dml9W17Nbnq6ci8G/Gxgjme1OA2CJE2lUvqD51H3L4bCgylhxDd9DWELC7Q9KE+vsmB3zU55WRswL2ffB3umkD98bEu3EpW874quStWOTWWc= Authentication-Results-Original: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com; Received: from VI0PR08MB10392.eurprd08.prod.outlook.com (2603:10a6:800:210::10) by AM9PR08MB6306.eurprd08.prod.outlook.com (2603:10a6:20b:2d6::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.92.7; Wed, 3 Jun 2026 07:50:22 +0000 Received: from VI0PR08MB10392.eurprd08.prod.outlook.com ([fe80::cd7c:e19a:2072:75cc]) by VI0PR08MB10392.eurprd08.prod.outlook.com ([fe80::cd7c:e19a:2072:75cc%4]) with mapi id 15.21.0092.006; Wed, 3 Jun 2026 07:50:22 +0000 Date: Wed, 3 Jun 2026 08:50:20 +0100 From: Tamar Christina <tamar.christina@arm.com> To: gcc-patches@gcc.gnu.org Cc: nd@arm.com, rguenther@suse.de, rdapp.gcc@gmail.com Subject: [PATCH][vect]: gate COMPLEX_MUL on FP_CONTRACT_FAST [PR125431] Message-ID: <patch-20589-tamar@arm.com> Content-Type: multipart/mixed; boundary="rcennfZIrrepeECD" Content-Disposition: inline X-ClientProxiedBy: LO4P123CA0341.GBRP123.PROD.OUTLOOK.COM (2603:10a6:600:18c::22) To VI0PR08MB10392.eurprd08.prod.outlook.com (2603:10a6:800:210::10) MIME-Version: 1.0 X-MS-TrafficTypeDiagnostic: VI0PR08MB10392:EE_|AM9PR08MB6306:EE_|AM4PEPF00027A65:EE_|AS4PR08MB7479:EE_ X-MS-Office365-Filtering-Correlation-Id: f87cb0b9-8b6d-4276-fa08-08dec144ea16 x-checkrecipientrouted: true NoDisclaimer: true X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Untrusted: BCL:0; ARA:13230040|366016|1800799024|376014|6049299003|4053099003|18002099003|6133799003|56012099006|11063799006; X-Microsoft-Antispam-Message-Info-Original: 4Jq2rpEsNujkFzgTZnX2+eNiaHJv+sURis19/v3iG+MStfdG0FojC8lzO1GU0LxaChPQ2kGFF8hT4Q3HjkTl24g502c4KLoOCNDqP99sz/w3P3sKnSCZGIR6XRHrKPZTSHbP/h+YBoiqFneXxMAh8Ym/jhDXr0U2DNfvZYd7lfgoDsadNG8VnopLz4GKjIey8NEyCN9my00hR8KWc3GH8NDPNGn2DfLlxPS4T40/XP0iCg1AchbX/ectr9e4yNMU6x8SRhRJ0GB+mMI/3oTaxExP+fsR16cvSkvdiQpLncSa7EXVhn+Ukg2jJFVHotYpgZ7Bml1Zxx2OeaDzNHmYumrzQqutH0wPs+oRGua+2I3DcSIJbZGkxY47r19OgsZ3Q97EBm5Rl96+ertZcpofFvp9h8s764EjZ5rxtNDZ+6oIiKUmtX2s9WzeWZkq1hCObb/dZft/FEwSTajN+KuSrxTx6WBpb0hgokYCfRPsaV4VH22N3yJ7viHyRKB0ixqH0sI/VuuxcbOV0VmMQGJo8KTrRl0SAXLwk5wfpRYrvEeIkIrUx6b49NEr13rdvaHfuxTHc0N+DNS6Ih7L7L1rHbwKADofFCxB4ileLLFCVvBcBCvqngtZHygF4LVi0BrcoLaNO/KB2/rMbWltDYMm+g== X-Forefront-Antispam-Report-Untrusted: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:VI0PR08MB10392.eurprd08.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230040)(366016)(1800799024)(376014)(6049299003)(4053099003)(18002099003)(6133799003)(56012099006)(11063799006); DIR:OUT; SFP:1101; X-Exchange-RoutingPolicyChecked: A+/3Ficbp+K7RLKb0hXkzLW8RdHfrVPA5V7U/iXcaLOtz/SJhCEs8EArjwOSIhO/RkTk+ezFXChPRdmCjDt3Vold7e/FRIKQKlZCAbC2z9BsEM0yMbPcyLqO3SLjo2/sOzuAgiNTv7pn2DrmKIBdeCaOI/Ac2XMAbICBadNi55PX4HTD/juLVhXlzKP5eaPSkZO60tI2xrxn59dccYIBLY4B4qX/BLH0YvnyXznYwPb9DEO9bw4+scsPaDZcAqt4P86CawaHsHG1fJ1ps6Z+NhwKUAC1hVvkO6R1VPXyxe9DxVd+TVySVhYp76zVSG9AhS4/9MjBuCfCiXprnIiO6w== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM9PR08MB6306 X-EOPAttributedMessage: 0 X-MS-Exchange-Transport-CrossTenantHeadersStripped: AM4PEPF00027A65.eurprd04.prod.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: a666d88d-67da-4606-0ae1-08dec144c3f1 X-Microsoft-Antispam: BCL:0; ARA:13230040|6049299003|14060799003|30052699003|82310400026|36860700016|1800799024|35042699022|376014|56012099006|11063799006|18002099003|6133799003|4053099003|13003099007; X-Microsoft-Antispam-Message-Info: exHlJ03KYK6FPVxpW4rFSxJwKvY+J0cgjsHlqN1pxr45NH7TEELC0BIzNHNEozmFyEHjMExTAzG2YuzA83EG1vmajpvNfaKW/wCs4hZf1cbgGKX8SkMlRldyMrO4QbW7qyYSDSqfT6FEGZkBdZhIy1LAynZOHn38jk+HHNhIYMoUVNIreZZqRPJRtX3qJ4RKNRsvihpo2+G9g3CJveMBt8beZ7fyCGsetj+lH1FG1YPX71Qs5VcjgmDeH8M9OMtsY7hdcB2Af/21c5ijXmqolPIapN8dPZzT6+JQ2Zs9gKJhpAkqbMc2cVXMuI1oryuJrD7yN3nubfYfbZl51DsaX15TgsOEkoXiz4/Xx9kKfD+iuIrG4ZCnk8gWuTx6iMEyfnbwL2V6tWMlXJ7TjYNaTc1RpU1yM01ANEnDwvo1TU7PgSn6rxwYbbBAjvYalyYXF0NVR+ueae5pwRrwCRYzO2zZq+sXCTvEGiHopv1uCO7E8cTnyrux/jvkYO1p74AnzTyU4UVztiP8DERfX1BvOTcTSsUzeup0SsZjE1yBO2BL6DkBnAveWz21rhhF/FgJtxfKsfV/UGgO6Ai/JmMHCKQsYkh7SrWz0Zk+z9r5fA6X5ViC+R5XMC/geRFQY+5RIGkCGrC4v2ZpwDfDswF8RC9zp0jJDyqcGVDUP6R9r1nNjrGQDEjsC9dVCVsXqkqq X-Forefront-Antispam-Report: CIP:4.158.2.129; CTRY:GB; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:outbound-uk1.az.dlp.m.darktrace.com; PTR:InfoDomainNonexistent; CAT:NONE; SFS:(13230040)(6049299003)(14060799003)(30052699003)(82310400026)(36860700016)(1800799024)(35042699022)(376014)(56012099006)(11063799006)(18002099003)(6133799003)(4053099003)(13003099007); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 1t9r9JvfjwHeGpypc1ws6StBSWAxqkjUnaIWakV+ihncOLqDWliomw7qgrrbQ6oBexe2hrczvgf1Osbt8BaXkv1KZzcYUEhH5GLwa0ge/mW4o++JCeHRWrXUfI0KAYnJDwazk8yhIKZFyQIjk4Ymvtp92hW5QDNfyeXaIZ81I/4Efnv8hIOuD/0stZg4uP4jUO9Dnah1VWyjkNFVjqXgpZkgv1HuD/dsCI718mTcPPxAX1jJ1/+TJIvYtS8hzag6Ud1OA9o4l/ElwmOcvbO21jUOcnfysGDfykrFsUeguKg05LwsI4ed2lSsLovOBT2JTaQoRe44uMt1+XDxqQFjv+cp19paShtnGE+yCygbGMfPwnEJZprOkGIEdeW1b8bHbSr5u+oD+0EW5KwiFF6ESQpajH9QuK0VyLp/+uLvYXlEEYlnWZ7iyezaCUHgocrz X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Jun 2026 07:51:26.1519 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: f87cb0b9-8b6d-4276-fa08-08dec144ea16 X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d; Ip=[4.158.2.129]; Helo=[outbound-uk1.az.dlp.m.darktrace.com] X-MS-Exchange-CrossTenant-AuthSource: AM4PEPF00027A65.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS4PR08MB7479 X-Spam-Status: No, score=-11.4 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FORGED_SPF_HELO, GIT_PATCH_0, KAM_LOTSOFHASH, RCVD_IN_DNSWL_BLOCKED, SPF_HELO_PASS, SPF_NONE, TXREP, URIBL_BLOCKED shortcircuit=no autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on 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> Errors-To: gcc-patches-bounces~patchwork=sourceware.org@gcc.gnu.org |
| Series |
[vect] : gate COMPLEX_MUL on FP_CONTRACT_FAST [PR125431]
|
|
Checks
| Context | Check | Description |
|---|---|---|
| linaro-tcwg-bot/tcwg_gcc_build--master-arm | fail | Patch failed to apply |
Commit Message
Tamar Christina
June 3, 2026, 7:50 a.m. UTC
The checks for FP_CONTRACT_FAST were in the wrong place for complex_mul. The location it was in would only block FMA but not MUL. It would also not really reject the forming of the FMA, it would just create an invalid collection of nodes which would fail analysis later on. However complex multiplication is also a contraction, since it's doing real = a*c - b*d imag = a*d + b*c This moves the checks up to earliest possible location and actually just returns and adds the missing check for FMS. Bootstrapped Regtested on aarch64-none-linux-gnu, arm-none-linux-gnueabihf, x86_64-pc-linux-gnu -m32, -m64 and no issues. Pushed. Thanks, Tamar gcc/ChangeLog: PR tree-optimization/125431 * tree-vect-slp-patterns.cc (complex_mul_pattern::matches, complex_fms_pattern::matches): Gate on FP contraction. gcc/testsuite/ChangeLog: PR tree-optimization/125431 * gfortran.dg/vect/pr125431.f90: New test. --- --
Comments
On Wed, 3 Jun 2026, Tamar Christina wrote: > The checks for FP_CONTRACT_FAST were in the wrong place for complex_mul. > > The location it was in would only block FMA but not MUL. It would also not > really reject the forming of the FMA, it would just create an invalid collection > of nodes which would fail analysis later on. > > However complex multiplication is also a contraction, since it's doing > > real = a*c - b*d > imag = a*d + b*c > > This moves the checks up to earliest possible location and actually just returns > and adds the missing check for FMS. > > Bootstrapped Regtested on aarch64-none-linux-gnu, > arm-none-linux-gnueabihf, x86_64-pc-linux-gnu > -m32, -m64 and no issues. > > Pushed. Thanks - can you also see to backport to 16 and 15 (this friday is RC for 15.3), but leave a short while to figure where the "loop vectorized" scan will fail? > > Thanks, > Tamar > > gcc/ChangeLog: > > PR tree-optimization/125431 > * tree-vect-slp-patterns.cc (complex_mul_pattern::matches, > complex_fms_pattern::matches): Gate on FP contraction. > > gcc/testsuite/ChangeLog: > > PR tree-optimization/125431 > * gfortran.dg/vect/pr125431.f90: New test. > > --- > diff --git a/gcc/testsuite/gfortran.dg/vect/pr125431.f90 b/gcc/testsuite/gfortran.dg/vect/pr125431.f90 > new file mode 100644 > index 0000000000000000000000000000000000000000..fe11b5eface9978c916783619677a10a7759c43d > --- /dev/null > +++ b/gcc/testsuite/gfortran.dg/vect/pr125431.f90 > @@ -0,0 +1,16 @@ > +! { dg-do compile } > +! { dg-additional-options "-O2 -ffp-contract=off" } > +! { dg-additional-options "-march=armv8.3-a" { target { aarch64*-*-* } } } > + > +subroutine foo(a,b,c) > + > + complex :: a(6,6) > + complex :: b(6,6) > + complex :: c(6,6) > + > + c = MATMUL(a, b) > + > +end subroutine foo > + > +! { dg-final { scan-tree-dump "LOOP VECTORIZED" "vect" { target { vect_float } } } } > +! { dg-final { scan-tree-dump-not "Found COMPLEX_MUL" "vect" } } > diff --git a/gcc/tree-vect-slp-patterns.cc b/gcc/tree-vect-slp-patterns.cc > index c0031a129a445160998f70bf9c18e1ef70464eed..181281c2154bedfc8e8c6b1bde1226e194ba99e5 100644 > --- a/gcc/tree-vect-slp-patterns.cc > +++ b/gcc/tree-vect-slp-patterns.cc > @@ -1038,6 +1038,11 @@ complex_mul_pattern::matches (complex_operation_t op, > if (op != MINUS_PLUS) > return IFN_LAST; > > + /* It's only valid to form FMAs and MUL with -ffp-contract=fast. */ > + if (flag_fp_contract_mode != FP_CONTRACT_FAST > + && FLOAT_TYPE_P (SLP_TREE_VECTYPE (*node))) > + return IFN_LAST; > + > auto childs = *ops; > auto l0node = SLP_TREE_CHILDREN (childs[0]); > > @@ -1050,11 +1055,8 @@ complex_mul_pattern::matches (complex_operation_t op, > auto_vec<slp_tree> left_op, right_op; > slp_tree add0 = NULL; > > - /* Check if we may be a multiply add. It's only valid to form FMAs > - with -ffp-contract=fast. */ > + /* Check if we may be a multiply add. */ > if (!mul0 > - && (flag_fp_contract_mode == FP_CONTRACT_FAST > - || !FLOAT_TYPE_P (SLP_TREE_VECTYPE (*node))) > && vect_match_expression_p (l0node[0], PLUS_EXPR)) > { > auto vals = SLP_TREE_CHILDREN (l0node[0]); > @@ -1285,6 +1287,11 @@ complex_fms_pattern::matches (complex_operation_t op, > if (!vect_match_expression_p (root, MINUS_EXPR)) > return IFN_LAST; > > + /* It's only valid to form FMSs with -ffp-contract=fast. */ > + if (flag_fp_contract_mode != FP_CONTRACT_FAST > + && FLOAT_TYPE_P (SLP_TREE_VECTYPE (*ref_node))) > + return IFN_LAST; > + > /* TODO: Support invariants here, with the new layout CADD now > can match before we get a chance to try CFMS. */ > auto nodes = SLP_TREE_CHILDREN (root); > > >
> -----Original Message----- > From: Richard Biener <rguenther@suse.de> > Sent: 03 June 2026 09:01 > To: Tamar Christina <Tamar.Christina@arm.com> > Cc: gcc-patches@gcc.gnu.org; nd <nd@arm.com>; rdapp.gcc@gmail.com > Subject: Re: [PATCH][vect]: gate COMPLEX_MUL on FP_CONTRACT_FAST > [PR125431] > > On Wed, 3 Jun 2026, Tamar Christina wrote: > > > The checks for FP_CONTRACT_FAST were in the wrong place for > complex_mul. > > > > The location it was in would only block FMA but not MUL. It would also not > > really reject the forming of the FMA, it would just create an invalid collection > > of nodes which would fail analysis later on. > > > > However complex multiplication is also a contraction, since it's doing > > > > real = a*c - b*d > > imag = a*d + b*c > > > > This moves the checks up to earliest possible location and actually just > returns > > and adds the missing check for FMS. > > > > Bootstrapped Regtested on aarch64-none-linux-gnu, > > arm-none-linux-gnueabihf, x86_64-pc-linux-gnu > > -m32, -m64 and no issues. > > > > Pushed. > > Thanks - can you also see to backport to 16 and 15 (this friday is RC > for 15.3), but leave a short while to figure where the > "loop vectorized" scan will fail? Sure, will do :) Cheers, Tamar > > > > > Thanks, > > Tamar > > > > gcc/ChangeLog: > > > > PR tree-optimization/125431 > > * tree-vect-slp-patterns.cc (complex_mul_pattern::matches, > > complex_fms_pattern::matches): Gate on FP contraction. > > > > gcc/testsuite/ChangeLog: > > > > PR tree-optimization/125431 > > * gfortran.dg/vect/pr125431.f90: New test. > > > > --- > > diff --git a/gcc/testsuite/gfortran.dg/vect/pr125431.f90 > b/gcc/testsuite/gfortran.dg/vect/pr125431.f90 > > new file mode 100644 > > index > 0000000000000000000000000000000000000000..fe11b5eface9978c916 > 783619677a10a7759c43d > > --- /dev/null > > +++ b/gcc/testsuite/gfortran.dg/vect/pr125431.f90 > > @@ -0,0 +1,16 @@ > > +! { dg-do compile } > > +! { dg-additional-options "-O2 -ffp-contract=off" } > > +! { dg-additional-options "-march=armv8.3-a" { target { aarch64*-*-* } } } > > + > > +subroutine foo(a,b,c) > > + > > + complex :: a(6,6) > > + complex :: b(6,6) > > + complex :: c(6,6) > > + > > + c = MATMUL(a, b) > > + > > +end subroutine foo > > + > > +! { dg-final { scan-tree-dump "LOOP VECTORIZED" "vect" { target { > vect_float } } } } > > +! { dg-final { scan-tree-dump-not "Found COMPLEX_MUL" "vect" } } > > diff --git a/gcc/tree-vect-slp-patterns.cc b/gcc/tree-vect-slp-patterns.cc > > index > c0031a129a445160998f70bf9c18e1ef70464eed..181281c2154bedfc8e8c6 > b1bde1226e194ba99e5 100644 > > --- a/gcc/tree-vect-slp-patterns.cc > > +++ b/gcc/tree-vect-slp-patterns.cc > > @@ -1038,6 +1038,11 @@ complex_mul_pattern::matches > (complex_operation_t op, > > if (op != MINUS_PLUS) > > return IFN_LAST; > > > > + /* It's only valid to form FMAs and MUL with -ffp-contract=fast. */ > > + if (flag_fp_contract_mode != FP_CONTRACT_FAST > > + && FLOAT_TYPE_P (SLP_TREE_VECTYPE (*node))) > > + return IFN_LAST; > > + > > auto childs = *ops; > > auto l0node = SLP_TREE_CHILDREN (childs[0]); > > > > @@ -1050,11 +1055,8 @@ complex_mul_pattern::matches > (complex_operation_t op, > > auto_vec<slp_tree> left_op, right_op; > > slp_tree add0 = NULL; > > > > - /* Check if we may be a multiply add. It's only valid to form FMAs > > - with -ffp-contract=fast. */ > > + /* Check if we may be a multiply add. */ > > if (!mul0 > > - && (flag_fp_contract_mode == FP_CONTRACT_FAST > > - || !FLOAT_TYPE_P (SLP_TREE_VECTYPE (*node))) > > && vect_match_expression_p (l0node[0], PLUS_EXPR)) > > { > > auto vals = SLP_TREE_CHILDREN (l0node[0]); > > @@ -1285,6 +1287,11 @@ complex_fms_pattern::matches > (complex_operation_t op, > > if (!vect_match_expression_p (root, MINUS_EXPR)) > > return IFN_LAST; > > > > + /* It's only valid to form FMSs with -ffp-contract=fast. */ > > + if (flag_fp_contract_mode != FP_CONTRACT_FAST > > + && FLOAT_TYPE_P (SLP_TREE_VECTYPE (*ref_node))) > > + return IFN_LAST; > > + > > /* TODO: Support invariants here, with the new layout CADD now > > can match before we get a chance to try CFMS. */ > > auto nodes = SLP_TREE_CHILDREN (root); > > > > > > > > -- > Richard Biener <rguenther@suse.de> > SUSE Software Solutions Germany GmbH, > Frankenstrasse 146, 90461 Nuernberg, Germany; > GF: Jochen Jaser, Andrew McDonald, Werner Knoblich; (HRB 36809, AG > Nuernberg)
diff --git a/gcc/testsuite/gfortran.dg/vect/pr125431.f90 b/gcc/testsuite/gfortran.dg/vect/pr125431.f90 new file mode 100644 index 0000000000000000000000000000000000000000..fe11b5eface9978c916783619677a10a7759c43d --- /dev/null +++ b/gcc/testsuite/gfortran.dg/vect/pr125431.f90 @@ -0,0 +1,16 @@ +! { dg-do compile } +! { dg-additional-options "-O2 -ffp-contract=off" } +! { dg-additional-options "-march=armv8.3-a" { target { aarch64*-*-* } } } + +subroutine foo(a,b,c) + + complex :: a(6,6) + complex :: b(6,6) + complex :: c(6,6) + + c = MATMUL(a, b) + +end subroutine foo + +! { dg-final { scan-tree-dump "LOOP VECTORIZED" "vect" { target { vect_float } } } } +! { dg-final { scan-tree-dump-not "Found COMPLEX_MUL" "vect" } } diff --git a/gcc/tree-vect-slp-patterns.cc b/gcc/tree-vect-slp-patterns.cc index c0031a129a445160998f70bf9c18e1ef70464eed..181281c2154bedfc8e8c6b1bde1226e194ba99e5 100644 --- a/gcc/tree-vect-slp-patterns.cc +++ b/gcc/tree-vect-slp-patterns.cc @@ -1038,6 +1038,11 @@ complex_mul_pattern::matches (complex_operation_t op, if (op != MINUS_PLUS) return IFN_LAST; + /* It's only valid to form FMAs and MUL with -ffp-contract=fast. */ + if (flag_fp_contract_mode != FP_CONTRACT_FAST + && FLOAT_TYPE_P (SLP_TREE_VECTYPE (*node))) + return IFN_LAST; + auto childs = *ops; auto l0node = SLP_TREE_CHILDREN (childs[0]); @@ -1050,11 +1055,8 @@ complex_mul_pattern::matches (complex_operation_t op, auto_vec<slp_tree> left_op, right_op; slp_tree add0 = NULL; - /* Check if we may be a multiply add. It's only valid to form FMAs - with -ffp-contract=fast. */ + /* Check if we may be a multiply add. */ if (!mul0 - && (flag_fp_contract_mode == FP_CONTRACT_FAST - || !FLOAT_TYPE_P (SLP_TREE_VECTYPE (*node))) && vect_match_expression_p (l0node[0], PLUS_EXPR)) { auto vals = SLP_TREE_CHILDREN (l0node[0]); @@ -1285,6 +1287,11 @@ complex_fms_pattern::matches (complex_operation_t op, if (!vect_match_expression_p (root, MINUS_EXPR)) return IFN_LAST; + /* It's only valid to form FMSs with -ffp-contract=fast. */ + if (flag_fp_contract_mode != FP_CONTRACT_FAST + && FLOAT_TYPE_P (SLP_TREE_VECTYPE (*ref_node))) + return IFN_LAST; + /* TODO: Support invariants here, with the new layout CADD now can match before we get a chance to try CFMS. */ auto nodes = SLP_TREE_CHILDREN (root);