[6/7] middle-end: add vec_init support for variable length subvector concatenation.
Message ID | Z1BIgVXdh83tporj@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 server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 004683858C62 for <patchwork@sourceware.org>; Wed, 4 Dec 2024 12:27:12 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 004683858C62 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=NOqvqcrr; dkim=pass (1024-bit key) header.d=arm.com header.i=@arm.com header.a=rsa-sha256 header.s=selector1 header.b=NOqvqcrr X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from EUR05-AM6-obe.outbound.protection.outlook.com (mail-am6eur05on2062b.outbound.protection.outlook.com [IPv6:2a01:111:f403:2612::62b]) by sourceware.org (Postfix) with ESMTPS id 5CAB03858C54 for <gcc-patches@gcc.gnu.org>; Wed, 4 Dec 2024 12:18:36 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 5CAB03858C54 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 5CAB03858C54 Authentication-Results: server2.sourceware.org; arc=pass smtp.remote-ip=2a01:111:f403:2612::62b ARC-Seal: i=3; a=rsa-sha256; d=sourceware.org; s=key; t=1733314720; cv=pass; b=oxXZJPjghzExrCv6JBBuoK653sLttDhVKwKYP+WTjvo++Lf5rwEgp558406hFAGxALQwT9jZN0hGbzht/fI3PPTzXkScTbZ+rZphTkblZ61TtdB/4JwiBSOQXWsdk3R9IcuhosP4GLJmu/1excPBhp+OHOOHoxwzbdtmSX94NlU= ARC-Message-Signature: i=3; a=rsa-sha256; d=sourceware.org; s=key; t=1733314720; c=relaxed/simple; bh=Xu+zs4oRzhe/GfIK4dc23OqSXPhDvHtEY76Bs5FdPic=; h=DKIM-Signature:DKIM-Signature:Date:From:To:Subject:Message-ID: MIME-Version; b=wGkFOvKfQdruUbIrRjHE+pRQBzIEhuWgX958cShWV74TmwBycFLRbhGRliK+2nkoA4nHrc5roD0J0PLRija/fzszq2msK1V0M+xNssNdJuAf56evbC5jEZGhw4ABbkjnEYR/suSreXtW9Flc3GciLtsZxZC6OCUSq2Ml+cRy7Ok= ARC-Authentication-Results: i=3; server2.sourceware.org ARC-Seal: i=2; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=pass; b=Y87/AGhB6Di9KNY0+qZDllw2xSqR4HCje9DmeapswF8QNkmztPXmXDSxk8RDvcX73J7hUBJdstEwCq137vZFYr+3HzEgwLIQHa/DkXbeUda3o15FfX2IQlDRg0Trjac6nQXANgwBwZIkdMmfi0fQDb8fF2tS+kdpW4rLhK54pP3HikSsfebYMR+iS2A76Rn/6+XvriadgJBalv+UvUyRDUj3NHZOnRtmJAJT9UXt800kzvNVfxKVfGmZ2ouwT9UiqEsYFXe/PqbKvRIXPz4YzmDoYPo1h6vhqINSKRx5XonVzzuGoNnUZm7+jfhaEEDV2DsKiww8JsMAZ4bzkg87gg== 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=/bIEu1ukd/xC7AmgJRDm0TANYd6LEcWYCR/8asZUQuo=; b=pBY8LiaAEMGTSUJ60xrqkdg7mRZGgyyl0hX6Jf6OfejC8uU6FDK7oNOxlsOSY1FfZ5FBk9Rv5Oed3/nQDVYStZIVnHxJtb9fy/lIH/ZdzMfkgrwp9J7/gkZ9Vy1LgnjJ2/YNm9Rt7WM9ZXNoN8iL7UdfKd8Se9jlbfleOktk++HNb5yDHz1HVk8sOrso7+pBmIqsY1JITkABJjTZ0Iaav3X3H6RORgC3V3i+gX8Hhqc8K90w0RVGCPmvWjKIYR0KMY5n+/ZcsEahK7mE5Jyl3WtQ8BPGaz1CWhDpcD0F7sp72NoWWWbMxM6Xfn+BRHuLnplxRZIV4+YKd+qaufYQYg== 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=/bIEu1ukd/xC7AmgJRDm0TANYd6LEcWYCR/8asZUQuo=; b=NOqvqcrrgkhep0qTIDMTEm48gNySa8kJk+BfkTQVx52JkNucK27zkKQYV0p42IY7wTkgZ0nZNi0xt88FGsqaMgS+2zLBbk9DEQ7OnUh7PlwH2p3tK3yvHtPmIjBdxzQ1dXxLIi1ZAZZUvT5l+rFRhTl0KqM6p0PV5fiYPoa0M6M= Received: from AS8PR04CA0125.eurprd04.prod.outlook.com (2603:10a6:20b:127::10) by DU0PR08MB9348.eurprd08.prod.outlook.com (2603:10a6:10:420::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8207.18; Wed, 4 Dec 2024 12:18:27 +0000 Received: from AMS1EPF00000043.eurprd04.prod.outlook.com (2603:10a6:20b:127:cafe::cb) by AS8PR04CA0125.outlook.office365.com (2603:10a6:20b:127::10) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.8207.18 via Frontend Transport; Wed, 4 Dec 2024 12:18:26 +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 AMS1EPF00000043.mail.protection.outlook.com (10.167.16.40) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.8230.7 via Frontend Transport; Wed, 4 Dec 2024 12:18:26 +0000 Received: ("Tessian outbound 54dc4e234ee1:v522"); Wed, 04 Dec 2024 12:18:26 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: 3b94b38c0136546e X-TessianGatewayMetadata: 9EDaXU6IDnzTnFOZ2zQsxdlCVjQgJR9lUDIuFz48AkXwcBcec5AkGS2x0zZtsaKyfRmJ9CmDsc9PLCLSN33edyWZHBjgC5+LJ2owUgV8QG+eabn4dYeZjb4ixSxWQ9f+Al/SMCi52jiaIg07mSHZUg== X-CR-MTA-TID: 64aa7808 Received: from L7a81d59238c2.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 39DA87B1-1DD5-4FAF-8D99-81606E3C0780.1; Wed, 04 Dec 2024 12:18:14 +0000 Received: from EUR02-AM0-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id L7a81d59238c2.1 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384); Wed, 04 Dec 2024 12:18:14 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=RCQeVMSYHXvxpXSKphZh+1fgnIUPT2FhVJLaFgkvbKSS2Jj0aXFBzeKQAO6JO2JEbPEKwMKozM12btvC1GUtwAkotoeTcqnykRO8hEHRKaDmUHijZEgLRnK0DrDmLak/y2WsP6jEdnQMBH/woj7aMQyM05ErisUzrDLUw9nUZRJN7lK1eRV7R+KEeDSjWhocrD3r6+hA6fUfAdxpu56nRzqekBd5akUZJ8bsjyM9fJ+eEjRanhzYZJ7oZs87+hU6Iw0LsV0vW2H4uglh3t9fKfwJN7kkCQ0XAmIs5rdJlUxAZlVDSN9BOl0+BJ+njmp72YzvPlzAUmrRcos0GY4fUA== 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=/bIEu1ukd/xC7AmgJRDm0TANYd6LEcWYCR/8asZUQuo=; b=UhkkxhOht/fW0sMY8exLQyaVGHG+N8A7JT6vp8tNmSrY1lo9ePMkwtw5l5NIs3+pIPvx1YDuB5jQrqKJ6smc8cqai7fISuY97o9GyQRrBPW8gONol3Y2Nx1brZOnIlgTGYyXc91Eni2GO2Np4klmRDO/+j7L5hhLRBR4adAHOEr5T04Lj7aR1L3c2bwMqDxSeUHYXopvPVjPOnTEhvNdgM6rxQFa3oatMtXtfRqtRsQ7By6CUd2TBKRL4WH/5UfUT9G7R0D2qJMFy2iIA1BuGFXivgYuLp5mO0RxVJqducAofWfWvA8sL+5UnD/p1naHBJzpBjF7HbHd+Z4iSh4xtw== 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=/bIEu1ukd/xC7AmgJRDm0TANYd6LEcWYCR/8asZUQuo=; b=NOqvqcrrgkhep0qTIDMTEm48gNySa8kJk+BfkTQVx52JkNucK27zkKQYV0p42IY7wTkgZ0nZNi0xt88FGsqaMgS+2zLBbk9DEQ7OnUh7PlwH2p3tK3yvHtPmIjBdxzQ1dXxLIi1ZAZZUvT5l+rFRhTl0KqM6p0PV5fiYPoa0M6M= Authentication-Results-Original: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com; Received: from VI1PR08MB5325.eurprd08.prod.outlook.com (2603:10a6:803:13e::17) by AS8PR08MB6390.eurprd08.prod.outlook.com (2603:10a6:20b:31b::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8230.11; Wed, 4 Dec 2024 12:18: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%2]) with mapi id 15.20.8207.017; Wed, 4 Dec 2024 12:18:11 +0000 Date: Wed, 4 Dec 2024 12:18:09 +0000 From: Tamar Christina <tamar.christina@arm.com> To: gcc-patches@gcc.gnu.org Cc: nd@arm.com, rguenther@suse.de, richard.sandiford@arm.com Subject: [PATCH 6/7]middle-end: add vec_init support for variable length subvector concatenation. Message-ID: <Z1BIgVXdh83tporj@arm.com> Content-Type: multipart/mixed; boundary="uC1vPapHmPKNthJ9" Content-Disposition: inline In-Reply-To: <patch-19026-tamar@arm.com> X-ClientProxiedBy: LO4P123CA0659.GBRP123.PROD.OUTLOOK.COM (2603:10a6:600:316::11) To VI1PR08MB5325.eurprd08.prod.outlook.com (2603:10a6:803:13e::17) MIME-Version: 1.0 X-MS-TrafficTypeDiagnostic: VI1PR08MB5325:EE_|AS8PR08MB6390:EE_|AMS1EPF00000043:EE_|DU0PR08MB9348:EE_ X-MS-Office365-Filtering-Correlation-Id: d7b3f6e9-640c-49b2-4ae2-08dd145dc16a x-checkrecipientrouted: true NoDisclaimer: true X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Untrusted: BCL:0;ARA:13230040|1800799024|376014|366016; X-Microsoft-Antispam-Message-Info-Original: XWG4ES/wMN/4fBUXQakI2VQKwidd6lNw+3ynT60NHq8jptwN0bw1pO1TftOuYXAbhZ4h896e3vp1Ybcz7agL5shlewqK9ZbaEGx9UuTCYCZeF3YtPdcfojqI/HzgHRSYUjWCQmE2WPEuJqFGiYlIO5xaO04J0bkt8DRRFCdgmNPcuP9fdm7rXQYUgVJ3g6Oa7UfU4W02bbyMpLNZ9OjV7HhQKPDZR+JCM0hvTXNDpoYiFh7Iyw7ybBhT6YPOIqVhVyAz5FwgQECU5i3i1qvC8vqCLYiKpOldUZF5EpQYZySNjMubp3elSiIVk80+b1NbyJteg9iQV+VTWkDN4HM+bu+vzmnQgWkEm7O1vrLGUqMitmLCPs+eud0n1sQB38hTRYcEioJTN6wD+lrufjUVkPGG9/gIQt3IqaoI2voWR5/jKXaoVi4mJivP4ChJpCh6lbKzWhzmsCJ4/yAN2OopZUvSmibiQl3qh/NTSy8xOajKU7Klure7pnmlZFOhWZoEotqPvl4KrIwNW64hvXYhIdjdFcsW8c3mJMinvZhbNtN8+MWAojxOEZ20xAFaPhEGKdfHX4FOwndLP3cP5oZsD7ZhIWvftl/CbMu2JLqaLoEviN2mMcs+dIGIS6S/bTPNuAqrzf7xCS3SVMwgNdFr4B8nTLeNTr2JCrADRtie/Z4cfIDQPPOqfhop79MtlW58pLJOSU7akfXqJIR3t/OZUJt1oj/l4QpYUXu/AJppBaUVkgZyRMI2EAvE3u2FkpPnA2f1Eiixfiih129YSZ4lv4HA4W7ZKh8Sdsgm7ocZ1XvNmwMlpMk75LZqzomxtrNhopASPdWHlOSFphzFu7HY7cLpjm0OXUeVbIdTWUAIZu6H1zgd2sX9bCpiDcZmyEFRh5YRVFDAfbFBajAEYGAwwFHxAFHGEuSwHL4YCiGlMMuZZgbaLlg7LPkIdEaRQ7/5HQfoGpwk35tpJXzvVwW5mwcRyB4yqdtZadzwhzofNowB0eZn4A9VupL4LUuB0GTytd6AK/2WQ/PEOKCYP1D5ZnjY8OXOuCSFPHzPcS/7BM2P40ElRGgL8gyGq3wR70p04LP3FZoAKuJwoxbu9dOrWY9kbGGnY2t23Sb92iDgA8hZQ35o4d194f3LNKt81OTXHHp3/VqhHiKvSt4cUrVirSQdRWtLnsgvIjOlEQl2GkYZwMKfB/AZ+jITwNrt7QcuhAFsYXRQPWzYhspUQqe83U32CJKKkrudXDAVXWkx6rmmj1aVvwJ5UNjSynfyWdpfBhmWzdXcHxpJ8CWhpyZBzudmYZE3Kmtmx3oFaO56fRUsMCw+yDBY5yOKksS0VLnZj6LOg4K+v1ElxJ1jCBvvDE3Zqvs5fl/ecSi+J/9NPjg= 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:(13230040)(1800799024)(376014)(366016); DIR:OUT; SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR08MB6390 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-SkipListedInternetSender: ip=[2603:10a6:803:13e::17]; domain=VI1PR08MB5325.eurprd08.prod.outlook.com X-MS-Exchange-Transport-CrossTenantHeadersStripped: AMS1EPF00000043.eurprd04.prod.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: 6fd532e8-30c6-47c1-93d2-08dd145db80f X-Microsoft-Antispam: BCL:0; ARA:13230040|36860700013|82310400026|35042699022|1800799024|376014|14060799003; X-Microsoft-Antispam-Message-Info: =?utf-8?q?tZ5HH0dFilLidhO7ihmacz7fytf5ua9?= =?utf-8?q?G9AJ78jGjiMaHXyeQuRppk03PnXJ4o0LXp3kAmyOvbCmevFX2+H4WxPABjbtWm6oZ?= =?utf-8?q?KU1a5oYWboFf22KAqjst9yLLrpwAJKAC1Z7SiVHPfN8vWF5I0UCmAyyap1sEj9V2V?= =?utf-8?q?m2bQBIdbSxECG1Qmqih601BUz2CgtLw7bYiDRAitEo5T4ge6cCyOQl+coUFA2ODl0?= =?utf-8?q?uKCMoooTnb/aEJtIiVSLx9eN52NmSd3utPybGFBLeRG0NXBGdlwRWdBcfGjmDOh8M?= =?utf-8?q?G5MwnP3k8dvOpP4s8dVZgItjJ20Bfro7/KimVZRTOVHHMLYTzizV9hHuOEhDtmNiV?= =?utf-8?q?B+drBSVFzj4gIGKiH/zRHJ0Rx7t/3F9b3INeyO4jE3jU88fLGumD6oUlgoTwf8le6?= =?utf-8?q?kUqPDvutgRD9TE3CM1vypobjtcUDG2hAy9Ee+keXWkxocNPXT5NcpIzW3WcJjPjao?= =?utf-8?q?6f1X0CS0JO1klRuevVZa5SFTo0hPC4avJOAspZfP5Z6WPxpBIkdLQOSiqEw/T2WGS?= =?utf-8?q?A4N+HX4PR6ZU7ARlAE/Oa4w7KBYX7mf0OuD3+TqCfRom+BebUTyLxQ4k1Gp4gE0Hv?= =?utf-8?q?CMekXA3Oy2G+2BFpR5oFe03oTRNivwleVbfsb7JiRmHFrUN9v4XHSFLbNWVc92gIq?= =?utf-8?q?WBWaYcrROt1Z2KiFO5K9KKcZAz3ty5EiY7aaAC5/oGz1cc/XpGlWtWqDCZt3DkXCr?= =?utf-8?q?7grIth7BrQp0IamoZ5kRppjx4BPPcubu9gVbFyGD0sYu0vgzIPJldSNcYlLuEJ5Om?= =?utf-8?q?0pfeopDXrYV/5BchB1leMLh11mYirld+vBEetNpBw1Fk3C7BFsRMmFhUmxyHam3Fv?= =?utf-8?q?ulwIt9imyE9TO4QpluuwrX4Ucdfw1LvDvJnqWY2YjkH6SZ/ZBtc9eZLSQPyqnxFzg?= =?utf-8?q?Jb4iXJqrbuwPelbEvifc3dI8oJBto3hZWGrZqTQRfoyw8PPIP2M0mAH/rYpQ+b6a0?= =?utf-8?q?l3dBA3lQYcEDK61YRRw3xovwSmcb0CQ+1XfQtZT5hLm3ZGSOEqKTZEZQLZd8iIwBE?= =?utf-8?q?NVrlhhFJco6DaMaRnnGJHL1rqtWWLgb4tz5XpdW/jsFY3v+c/xAoTBByxu/nrHKRZ?= =?utf-8?q?EscMrn1howUYc228rfdJ+0BVHfqw03vd22THwKowERxw0DpoYmwLKDF4tdqhxJwBI?= =?utf-8?q?ZP6mbUhl5JiBkYObuo5No7TcGNbYeE4AnVSzUZDH3Cf9uKlrK06Pk/Q0sEqnKXzLi?= =?utf-8?q?jR9jm7zN+oaGoBWjCrEJ4pJm1NHjWOAn79av6vpYy3LhyV04dgxfB0+1t76it6dE0?= =?utf-8?q?tphW5NeWD/DSLwhvToUO3gQmq39QwvKcv7lNOT52eevBNlvWNFEa1fCLog77NZgzg?= =?utf-8?q?D6K5FoHud1oFK315v6cfClP7skHd/Eo+2SiGhfInSfeiJlIGlUmkjYqYQ+7TxLNiA?= =?utf-8?q?jXx7UUWuBbV?= 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:64aa7808-outbound-1.mta.getcheckrecipient.com; CAT:NONE; SFS:(13230040)(36860700013)(82310400026)(35042699022)(1800799024)(376014)(14060799003); DIR:OUT; SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Dec 2024 12:18:26.5336 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: d7b3f6e9-640c-49b2-4ae2-08dd145dc16a 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: AMS1EPF00000043.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU0PR08MB9348 X-Spam-Status: No, score=-12.4 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FORGED_SPF_HELO, GIT_PATCH_0, SPF_HELO_PASS, SPF_NONE, TXREP, UNPARSEABLE_RELAY, URIBL_BLOCKED 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 <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 |
None
|
|
Commit Message
Tamar Christina
Dec. 4, 2024, 12:18 p.m. UTC
Hi All, For architectures where the vector-length is a compile-time variable, rather representing a runtime constant, as is the case with SVE it is perfectly reasonable that such vector be made up of two (or more) subvector components of a compatible sub-length variable. One example of this would be the concatenation of two VNx4QI vectors into a single VNx8QI vector. This patch adds initial support for the enablement of this feature in the middle-end, removing the `.is_constant()' constraint on the vector's number of elements, instead making the constant no. of elements the multiple of the number of subvectors (which must then also be of variable length, such that their polynomial ratio then results in a compile-time constant) required to fill the vector. gcc/ChangeLog: PR target/96342 * expr.cc (store_constructor): add support for variable-length vectors. Co-authored-by: Tamar Christina <tamar.christina@arm.com> Bootstrapped Regtested on aarch64-none-linux-gnu, arm-none-linux-gnueabihf, x86_64-pc-linux-gnu -m32, -m64 and no issues. Ok for master? Thanks, Tamar --- --
Comments
On Wed, 4 Dec 2024, Tamar Christina wrote: > Hi All, > > For architectures where the vector-length is a compile-time variable, > rather representing a runtime constant, as is the case with SVE it is > perfectly reasonable that such vector be made up of two (or more) subvector > components of a compatible sub-length variable. > > One example of this would be the concatenation of two VNx4QI vectors > into a single VNx8QI vector. > > This patch adds initial support for the enablement of this feature in > the middle-end, removing the `.is_constant()' constraint on the vector's > number of elements, instead making the constant no. of elements the > multiple of the number of subvectors (which must then also be of > variable length, such that their polynomial ratio then results in a > compile-time constant) required to fill the vector. > > gcc/ChangeLog: > > PR target/96342 > * expr.cc (store_constructor): add support for variable-length > vectors. > > Co-authored-by: Tamar Christina <tamar.christina@arm.com> > > Bootstrapped Regtested on aarch64-none-linux-gnu, > arm-none-linux-gnueabihf, x86_64-pc-linux-gnu > -m32, -m64 and no issues. > > Ok for master? > > Thanks, > Tamar > > --- > diff --git a/gcc/expr.cc b/gcc/expr.cc > index 2d90d7aac296077cc0bda8a1b4732b1cd44a610d..8bdec1cbf78ce338c135a6660bcb3abc75884c0c 100644 > --- a/gcc/expr.cc > +++ b/gcc/expr.cc > @@ -7962,11 +7962,11 @@ store_constructor (tree exp, rtx target, int cleared, poly_int64 size, > > n_elts = TYPE_VECTOR_SUBPARTS (type); > if (REG_P (target) > - && VECTOR_MODE_P (mode) > - && n_elts.is_constant (&const_n_elts)) > + && VECTOR_MODE_P (mode)) > { > machine_mode emode = eltmode; > bool vector_typed_elts_p = false; > + auto nunits = GET_MODE_NUNITS (emode); > > if (CONSTRUCTOR_NELTS (exp) > && (TREE_CODE (TREE_TYPE (CONSTRUCTOR_ELT (exp, 0)->value)) > @@ -7976,22 +7976,30 @@ store_constructor (tree exp, rtx target, int cleared, poly_int64 size, > gcc_assert (known_eq (CONSTRUCTOR_NELTS (exp) > * TYPE_VECTOR_SUBPARTS (etype), > n_elts)); > + > emode = TYPE_MODE (etype); > vector_typed_elts_p = true; > + nunits = TYPE_VECTOR_SUBPARTS (etype); > } > - icode = convert_optab_handler (vec_init_optab, mode, emode); > - if (icode != CODE_FOR_nothing) > - { > - unsigned int n = const_n_elts; > > - if (vector_typed_elts_p) > + /* For a non-const type vector, we check it is made up of similarly > + non-const type vectors. */ > + if (exact_div (n_elts, nunits).is_constant (&const_n_elts)) I think this is guaranteed by tree-cfg.cc:4767? So I think we can simply set const_n_elts to CONSTRUCTOR_NELTS for vector_typed_elts_p? That said - by refactoring to separate the vector elt from scalar elt case this might look more obvious (also no need to clear RTVEC_ELT in that case)? > + { > + icode = convert_optab_handler (vec_init_optab, mode, emode); > + if (icode != CODE_FOR_nothing) > { > - n = CONSTRUCTOR_NELTS (exp); > - vec_vec_init_p = true; > + unsigned int n = const_n_elts; > + > + if (vector_typed_elts_p) > + { > + n = CONSTRUCTOR_NELTS (exp); > + vec_vec_init_p = true; > + } > + vector = rtvec_alloc (n); > + for (unsigned int k = 0; k < n; k++) > + RTVEC_ELT (vector, k) = CONST0_RTX (emode); > } > - vector = rtvec_alloc (n); > - for (unsigned int k = 0; k < n; k++) > - RTVEC_ELT (vector, k) = CONST0_RTX (emode); > } > } > > > > > >
> -----Original Message----- > From: Richard Biener <rguenther@suse.de> > Sent: Wednesday, December 4, 2024 2:53 PM > To: Tamar Christina <Tamar.Christina@arm.com> > Cc: gcc-patches@gcc.gnu.org; nd <nd@arm.com>; Richard Sandiford > <Richard.Sandiford@arm.com> > Subject: Re: [PATCH 6/7]middle-end: add vec_init support for variable length > subvector concatenation. > > On Wed, 4 Dec 2024, Tamar Christina wrote: > > > Hi All, > > > > For architectures where the vector-length is a compile-time variable, > > rather representing a runtime constant, as is the case with SVE it is > > perfectly reasonable that such vector be made up of two (or more) subvector > > components of a compatible sub-length variable. > > > > One example of this would be the concatenation of two VNx4QI vectors > > into a single VNx8QI vector. > > > > This patch adds initial support for the enablement of this feature in > > the middle-end, removing the `.is_constant()' constraint on the vector's > > number of elements, instead making the constant no. of elements the > > multiple of the number of subvectors (which must then also be of > > variable length, such that their polynomial ratio then results in a > > compile-time constant) required to fill the vector. > > > > gcc/ChangeLog: > > > > PR target/96342 > > * expr.cc (store_constructor): add support for variable-length > > vectors. > > > > Co-authored-by: Tamar Christina <tamar.christina@arm.com> > > > > Bootstrapped Regtested on aarch64-none-linux-gnu, > > arm-none-linux-gnueabihf, x86_64-pc-linux-gnu > > -m32, -m64 and no issues. > > > > Ok for master? > > > > Thanks, > > Tamar > > > > --- > > diff --git a/gcc/expr.cc b/gcc/expr.cc > > index > 2d90d7aac296077cc0bda8a1b4732b1cd44a610d..8bdec1cbf78ce338c135a666 > 0bcb3abc75884c0c 100644 > > --- a/gcc/expr.cc > > +++ b/gcc/expr.cc > > @@ -7962,11 +7962,11 @@ store_constructor (tree exp, rtx target, int cleared, > poly_int64 size, > > > > n_elts = TYPE_VECTOR_SUBPARTS (type); > > if (REG_P (target) > > - && VECTOR_MODE_P (mode) > > - && n_elts.is_constant (&const_n_elts)) > > + && VECTOR_MODE_P (mode)) > > { > > machine_mode emode = eltmode; > > bool vector_typed_elts_p = false; > > + auto nunits = GET_MODE_NUNITS (emode); > > > > if (CONSTRUCTOR_NELTS (exp) > > && (TREE_CODE (TREE_TYPE (CONSTRUCTOR_ELT (exp, 0)- > >value)) > > @@ -7976,22 +7976,30 @@ store_constructor (tree exp, rtx target, int cleared, > poly_int64 size, > > gcc_assert (known_eq (CONSTRUCTOR_NELTS (exp) > > * TYPE_VECTOR_SUBPARTS (etype), > > n_elts)); > > + > > emode = TYPE_MODE (etype); > > vector_typed_elts_p = true; > > + nunits = TYPE_VECTOR_SUBPARTS (etype); > > } > > - icode = convert_optab_handler (vec_init_optab, mode, emode); > > - if (icode != CODE_FOR_nothing) > > - { > > - unsigned int n = const_n_elts; > > > > - if (vector_typed_elts_p) > > + /* For a non-const type vector, we check it is made up of similarly > > + non-const type vectors. */ > > + if (exact_div (n_elts, nunits).is_constant (&const_n_elts)) > > I think this is guaranteed by tree-cfg.cc:4767? > > So I think we can simply set const_n_elts to CONSTRUCTOR_NELTS > for vector_typed_elts_p? > I thought so too.. and then two days ago Ricard S committed this ACLE testcase: ./gcc/testsuite/gcc.target/aarch64/sve/acle/general/cops.c That ICEd here because n_elts is a poly [16, 16] and nunits was 1 I think.. Tamar > That said - by refactoring to separate the vector elt from scalar > elt case this might look more obvious (also no need to clear > RTVEC_ELT in that case)? > > > + { > > + icode = convert_optab_handler (vec_init_optab, mode, emode); > > + if (icode != CODE_FOR_nothing) > > { > > - n = CONSTRUCTOR_NELTS (exp); > > - vec_vec_init_p = true; > > + unsigned int n = const_n_elts; > > + > > + if (vector_typed_elts_p) > > + { > > + n = CONSTRUCTOR_NELTS (exp); > > + vec_vec_init_p = true; > > + } > > + vector = rtvec_alloc (n); > > + for (unsigned int k = 0; k < n; k++) > > + RTVEC_ELT (vector, k) = CONST0_RTX (emode); > > } > > - vector = rtvec_alloc (n); > > - for (unsigned int k = 0; k < n; k++) > > - RTVEC_ELT (vector, k) = CONST0_RTX (emode); > > } > > } > > > > > > > > > > > > > > -- > Richard Biener <rguenther@suse.de> > SUSE Software Solutions Germany GmbH, > Frankenstrasse 146, 90461 Nuernberg, Germany; > GF: Ivo Totev, Andrew McDonald, Werner Knoblich; (HRB 36809, AG Nuernberg)
-----Original Message----- > From: Tamar Christina <Tamar.Christina@arm.com> > Sent: Wednesday, December 4, 2024 3:02 PM > To: Richard Biener <rguenther@suse.de> > Cc: gcc-patches@gcc.gnu.org; nd <nd@arm.com>; Richard Sandiford > <Richard.Sandiford@arm.com> > Subject: RE: [PATCH 6/7]middle-end: add vec_init support for variable length > subvector concatenation. > > > -----Original Message----- > > From: Richard Biener <rguenther@suse.de> > > Sent: Wednesday, December 4, 2024 2:53 PM > > To: Tamar Christina <Tamar.Christina@arm.com> > > Cc: gcc-patches@gcc.gnu.org; nd <nd@arm.com>; Richard Sandiford > > <Richard.Sandiford@arm.com> > > Subject: Re: [PATCH 6/7]middle-end: add vec_init support for variable length > > subvector concatenation. > > > > On Wed, 4 Dec 2024, Tamar Christina wrote: > > > > > Hi All, > > > > > > For architectures where the vector-length is a compile-time variable, > > > rather representing a runtime constant, as is the case with SVE it is > > > perfectly reasonable that such vector be made up of two (or more) subvector > > > components of a compatible sub-length variable. > > > > > > One example of this would be the concatenation of two VNx4QI vectors > > > into a single VNx8QI vector. > > > > > > This patch adds initial support for the enablement of this feature in > > > the middle-end, removing the `.is_constant()' constraint on the vector's > > > number of elements, instead making the constant no. of elements the > > > multiple of the number of subvectors (which must then also be of > > > variable length, such that their polynomial ratio then results in a > > > compile-time constant) required to fill the vector. > > > > > > gcc/ChangeLog: > > > > > > PR target/96342 > > > * expr.cc (store_constructor): add support for variable-length > > > vectors. > > > > > > Co-authored-by: Tamar Christina <tamar.christina@arm.com> > > > > > > Bootstrapped Regtested on aarch64-none-linux-gnu, > > > arm-none-linux-gnueabihf, x86_64-pc-linux-gnu > > > -m32, -m64 and no issues. > > > > > > Ok for master? > > > > > > Thanks, > > > Tamar > > > > > > --- > > > diff --git a/gcc/expr.cc b/gcc/expr.cc > > > index > > > 2d90d7aac296077cc0bda8a1b4732b1cd44a610d..8bdec1cbf78ce338c135a666 > > 0bcb3abc75884c0c 100644 > > > --- a/gcc/expr.cc > > > +++ b/gcc/expr.cc > > > @@ -7962,11 +7962,11 @@ store_constructor (tree exp, rtx target, int > cleared, > > poly_int64 size, > > > > > > n_elts = TYPE_VECTOR_SUBPARTS (type); > > > if (REG_P (target) > > > - && VECTOR_MODE_P (mode) > > > - && n_elts.is_constant (&const_n_elts)) > > > + && VECTOR_MODE_P (mode)) > > > { > > > machine_mode emode = eltmode; > > > bool vector_typed_elts_p = false; > > > + auto nunits = GET_MODE_NUNITS (emode); > > > > > > if (CONSTRUCTOR_NELTS (exp) > > > && (TREE_CODE (TREE_TYPE (CONSTRUCTOR_ELT (exp, 0)- > > >value)) > > > @@ -7976,22 +7976,30 @@ store_constructor (tree exp, rtx target, int > cleared, > > poly_int64 size, > > > gcc_assert (known_eq (CONSTRUCTOR_NELTS (exp) > > > * TYPE_VECTOR_SUBPARTS (etype), > > > n_elts)); > > > + > > > emode = TYPE_MODE (etype); > > > vector_typed_elts_p = true; > > > + nunits = TYPE_VECTOR_SUBPARTS (etype); > > > } > > > - icode = convert_optab_handler (vec_init_optab, mode, emode); > > > - if (icode != CODE_FOR_nothing) > > > - { > > > - unsigned int n = const_n_elts; > > > > > > - if (vector_typed_elts_p) > > > + /* For a non-const type vector, we check it is made up of similarly > > > + non-const type vectors. */ > > > + if (exact_div (n_elts, nunits).is_constant (&const_n_elts)) > > > > I think this is guaranteed by tree-cfg.cc:4767? > > > > So I think we can simply set const_n_elts to CONSTRUCTOR_NELTS > > for vector_typed_elts_p? > > > > I thought so too.. and then two days ago Ricard S committed this ACLE testcase: > ./gcc/testsuite/gcc.target/aarch64/sve/acle/general/cops.c > > That ICEd here because n_elts is a poly [16, 16] and nunits was 1 I think.. > Err nunit=8. But the result of the division between the poly and nunits was another poly. normally we would skip the entire block for this so I did the same. Thanks, Tamar > Tamar > > > That said - by refactoring to separate the vector elt from scalar > > elt case this might look more obvious (also no need to clear > > RTVEC_ELT in that case)? > > > > > + { > > > + icode = convert_optab_handler (vec_init_optab, mode, emode); > > > + if (icode != CODE_FOR_nothing) > > > { > > > - n = CONSTRUCTOR_NELTS (exp); > > > - vec_vec_init_p = true; > > > + unsigned int n = const_n_elts; > > > + > > > + if (vector_typed_elts_p) > > > + { > > > + n = CONSTRUCTOR_NELTS (exp); > > > + vec_vec_init_p = true; > > > + } > > > + vector = rtvec_alloc (n); > > > + for (unsigned int k = 0; k < n; k++) > > > + RTVEC_ELT (vector, k) = CONST0_RTX (emode); > > > } > > > - vector = rtvec_alloc (n); > > > - for (unsigned int k = 0; k < n; k++) > > > - RTVEC_ELT (vector, k) = CONST0_RTX (emode); > > > } > > > } > > > > > > > > > > > > > > > > > > > > > > -- > > Richard Biener <rguenther@suse.de> > > SUSE Software Solutions Germany GmbH, > > Frankenstrasse 146, 90461 Nuernberg, Germany; > > GF: Ivo Totev, Andrew McDonald, Werner Knoblich; (HRB 36809, AG Nuernberg)
On Wed, 4 Dec 2024, Tamar Christina wrote: > > -----Original Message----- > > From: Richard Biener <rguenther@suse.de> > > Sent: Wednesday, December 4, 2024 2:53 PM > > To: Tamar Christina <Tamar.Christina@arm.com> > > Cc: gcc-patches@gcc.gnu.org; nd <nd@arm.com>; Richard Sandiford > > <Richard.Sandiford@arm.com> > > Subject: Re: [PATCH 6/7]middle-end: add vec_init support for variable length > > subvector concatenation. > > > > On Wed, 4 Dec 2024, Tamar Christina wrote: > > > > > Hi All, > > > > > > For architectures where the vector-length is a compile-time variable, > > > rather representing a runtime constant, as is the case with SVE it is > > > perfectly reasonable that such vector be made up of two (or more) subvector > > > components of a compatible sub-length variable. > > > > > > One example of this would be the concatenation of two VNx4QI vectors > > > into a single VNx8QI vector. > > > > > > This patch adds initial support for the enablement of this feature in > > > the middle-end, removing the `.is_constant()' constraint on the vector's > > > number of elements, instead making the constant no. of elements the > > > multiple of the number of subvectors (which must then also be of > > > variable length, such that their polynomial ratio then results in a > > > compile-time constant) required to fill the vector. > > > > > > gcc/ChangeLog: > > > > > > PR target/96342 > > > * expr.cc (store_constructor): add support for variable-length > > > vectors. > > > > > > Co-authored-by: Tamar Christina <tamar.christina@arm.com> > > > > > > Bootstrapped Regtested on aarch64-none-linux-gnu, > > > arm-none-linux-gnueabihf, x86_64-pc-linux-gnu > > > -m32, -m64 and no issues. > > > > > > Ok for master? > > > > > > Thanks, > > > Tamar > > > > > > --- > > > diff --git a/gcc/expr.cc b/gcc/expr.cc > > > index > > 2d90d7aac296077cc0bda8a1b4732b1cd44a610d..8bdec1cbf78ce338c135a666 > > 0bcb3abc75884c0c 100644 > > > --- a/gcc/expr.cc > > > +++ b/gcc/expr.cc > > > @@ -7962,11 +7962,11 @@ store_constructor (tree exp, rtx target, int cleared, > > poly_int64 size, > > > > > > n_elts = TYPE_VECTOR_SUBPARTS (type); > > > if (REG_P (target) > > > - && VECTOR_MODE_P (mode) > > > - && n_elts.is_constant (&const_n_elts)) > > > + && VECTOR_MODE_P (mode)) > > > { > > > machine_mode emode = eltmode; > > > bool vector_typed_elts_p = false; > > > + auto nunits = GET_MODE_NUNITS (emode); > > > > > > if (CONSTRUCTOR_NELTS (exp) > > > && (TREE_CODE (TREE_TYPE (CONSTRUCTOR_ELT (exp, 0)- > > >value)) > > > @@ -7976,22 +7976,30 @@ store_constructor (tree exp, rtx target, int cleared, > > poly_int64 size, > > > gcc_assert (known_eq (CONSTRUCTOR_NELTS (exp) > > > * TYPE_VECTOR_SUBPARTS (etype), > > > n_elts)); > > > + > > > emode = TYPE_MODE (etype); > > > vector_typed_elts_p = true; > > > + nunits = TYPE_VECTOR_SUBPARTS (etype); > > > } > > > - icode = convert_optab_handler (vec_init_optab, mode, emode); > > > - if (icode != CODE_FOR_nothing) > > > - { > > > - unsigned int n = const_n_elts; > > > > > > - if (vector_typed_elts_p) > > > + /* For a non-const type vector, we check it is made up of similarly > > > + non-const type vectors. */ > > > + if (exact_div (n_elts, nunits).is_constant (&const_n_elts)) > > > > I think this is guaranteed by tree-cfg.cc:4767? > > > > So I think we can simply set const_n_elts to CONSTRUCTOR_NELTS > > for vector_typed_elts_p? > > > > I thought so too.. and then two days ago Ricard S committed this ACLE testcase: > ./gcc/testsuite/gcc.target/aarch64/sve/acle/general/cops.c > > That ICEd here because n_elts is a poly [16, 16] and nunits was 1 I think.. In any case the GIMPLE constraints were (supposed to be) set up in a way that testing the vec_init_optab is always applicable. Richard. > Tamar > > > That said - by refactoring to separate the vector elt from scalar > > elt case this might look more obvious (also no need to clear > > RTVEC_ELT in that case)? > > > > > + { > > > + icode = convert_optab_handler (vec_init_optab, mode, emode); > > > + if (icode != CODE_FOR_nothing) > > > { > > > - n = CONSTRUCTOR_NELTS (exp); > > > - vec_vec_init_p = true; > > > + unsigned int n = const_n_elts; > > > + > > > + if (vector_typed_elts_p) > > > + { > > > + n = CONSTRUCTOR_NELTS (exp); > > > + vec_vec_init_p = true; > > > + } > > > + vector = rtvec_alloc (n); > > > + for (unsigned int k = 0; k < n; k++) > > > + RTVEC_ELT (vector, k) = CONST0_RTX (emode); > > > } > > > - vector = rtvec_alloc (n); > > > - for (unsigned int k = 0; k < n; k++) > > > - RTVEC_ELT (vector, k) = CONST0_RTX (emode); > > > } > > > } > > > > > > > > > > > > > > > > > > > > > > -- > > Richard Biener <rguenther@suse.de> > > SUSE Software Solutions Germany GmbH, > > Frankenstrasse 146, 90461 Nuernberg, Germany; > > GF: Ivo Totev, Andrew McDonald, Werner Knoblich; (HRB 36809, AG Nuernberg) >
Tamar Christina <Tamar.Christina@arm.com> writes: >> > @@ -7976,22 +7976,30 @@ store_constructor (tree exp, rtx target, int cleared, >> poly_int64 size, >> > gcc_assert (known_eq (CONSTRUCTOR_NELTS (exp) >> > * TYPE_VECTOR_SUBPARTS (etype), >> > n_elts)); >> > + >> > emode = TYPE_MODE (etype); >> > vector_typed_elts_p = true; >> > + nunits = TYPE_VECTOR_SUBPARTS (etype); >> > } >> > - icode = convert_optab_handler (vec_init_optab, mode, emode); >> > - if (icode != CODE_FOR_nothing) >> > - { >> > - unsigned int n = const_n_elts; >> > >> > - if (vector_typed_elts_p) >> > + /* For a non-const type vector, we check it is made up of similarly >> > + non-const type vectors. */ >> > + if (exact_div (n_elts, nunits).is_constant (&const_n_elts)) >> >> I think this is guaranteed by tree-cfg.cc:4767? >> >> So I think we can simply set const_n_elts to CONSTRUCTOR_NELTS >> for vector_typed_elts_p? >> > > I thought so too.. and then two days ago Ricard S committed this ACLE testcase: > ./gcc/testsuite/gcc.target/aarch64/sve/acle/general/cops.c JFTR, it was Tejas, not me :) Richard > > That ICEd here because n_elts is a poly [16, 16] and nunits was 1 I think.. > > Tamar
> >> So I think we can simply set const_n_elts to CONSTRUCTOR_NELTS > >> for vector_typed_elts_p? > >> > > Done, gcc/ChangeLog: PR target/96342 * expr.cc (store_constructor): add support for variable-length vectors. Co-authored-by: Tamar Christina <tamar.christina@arm.com> Bootstrapped Regtested on aarch64-none-linux-gnu, arm-none-linux-gnueabihf, x86_64-pc-linux-gnu -m32, -m64 and no issues. Ok for master? Thanks, Tamar -- inline copy of patch -- diff --git a/gcc/expr.cc b/gcc/expr.cc index 4c6039c6608c0d9db3d1796eeab2129cb844433f..babf00f34dcf1ac81a9d2d9947350fb1c0455811 100644 --- a/gcc/expr.cc +++ b/gcc/expr.cc @@ -7965,12 +7965,9 @@ store_constructor (tree exp, rtx target, int cleared, poly_int64 size, n_elts = TYPE_VECTOR_SUBPARTS (type); if (REG_P (target) - && VECTOR_MODE_P (mode) - && n_elts.is_constant (&const_n_elts)) + && VECTOR_MODE_P (mode)) { - machine_mode emode = eltmode; - bool vector_typed_elts_p = false; - + const_n_elts = 0; if (CONSTRUCTOR_NELTS (exp) && (TREE_CODE (TREE_TYPE (CONSTRUCTOR_ELT (exp, 0)->value)) == VECTOR_TYPE)) @@ -7979,23 +7976,26 @@ store_constructor (tree exp, rtx target, int cleared, poly_int64 size, gcc_assert (known_eq (CONSTRUCTOR_NELTS (exp) * TYPE_VECTOR_SUBPARTS (etype), n_elts)); - emode = TYPE_MODE (etype); - vector_typed_elts_p = true; + + icode = convert_optab_handler (vec_init_optab, mode, + TYPE_MODE (etype)); + const_n_elts = CONSTRUCTOR_NELTS (exp); + vec_vec_init_p = icode != CODE_FOR_nothing; } - icode = convert_optab_handler (vec_init_optab, mode, emode); - if (icode != CODE_FOR_nothing) + else if (exact_div (n_elts, GET_MODE_NUNITS (eltmode)) + .is_constant (&const_n_elts)) { - unsigned int n = const_n_elts; - - if (vector_typed_elts_p) - { - n = CONSTRUCTOR_NELTS (exp); - vec_vec_init_p = true; - } - vector = rtvec_alloc (n); - for (unsigned int k = 0; k < n; k++) - RTVEC_ELT (vector, k) = CONST0_RTX (emode); + /* For a non-const type vector, we check it is made up of + similarly non-const type vectors. */ + icode = convert_optab_handler (vec_init_optab, mode, eltmode); } + + if (const_n_elts && icode != CODE_FOR_nothing) + { + vector = rtvec_alloc (const_n_elts); + for (unsigned int k = 0; k < const_n_elts; k++) + RTVEC_ELT (vector, k) = CONST0_RTX (eltmode); + } } /* Compute the size of the elements in the CTOR. It differs
On Mon, 9 Dec 2024, Tamar Christina wrote: > > >> So I think we can simply set const_n_elts to CONSTRUCTOR_NELTS > > >> for vector_typed_elts_p? > > >> > > > > > Done, > > gcc/ChangeLog: > > PR target/96342 > * expr.cc (store_constructor): add support for variable-length > vectors. > > Co-authored-by: Tamar Christina <tamar.christina@arm.com> > > Bootstrapped Regtested on aarch64-none-linux-gnu, > arm-none-linux-gnueabihf, x86_64-pc-linux-gnu > -m32, -m64 and no issues. > > Ok for master? OK unless Richard S. has any comments. Thanks, Richard. > Thanks, > Tamar > > -- inline copy of patch -- > > diff --git a/gcc/expr.cc b/gcc/expr.cc > index 4c6039c6608c0d9db3d1796eeab2129cb844433f..babf00f34dcf1ac81a9d2d9947350fb1c0455811 100644 > --- a/gcc/expr.cc > +++ b/gcc/expr.cc > @@ -7965,12 +7965,9 @@ store_constructor (tree exp, rtx target, int cleared, poly_int64 size, > > n_elts = TYPE_VECTOR_SUBPARTS (type); > if (REG_P (target) > - && VECTOR_MODE_P (mode) > - && n_elts.is_constant (&const_n_elts)) > + && VECTOR_MODE_P (mode)) > { > - machine_mode emode = eltmode; > - bool vector_typed_elts_p = false; > - > + const_n_elts = 0; > if (CONSTRUCTOR_NELTS (exp) > && (TREE_CODE (TREE_TYPE (CONSTRUCTOR_ELT (exp, 0)->value)) > == VECTOR_TYPE)) > @@ -7979,23 +7976,26 @@ store_constructor (tree exp, rtx target, int cleared, poly_int64 size, > gcc_assert (known_eq (CONSTRUCTOR_NELTS (exp) > * TYPE_VECTOR_SUBPARTS (etype), > n_elts)); > - emode = TYPE_MODE (etype); > - vector_typed_elts_p = true; > + > + icode = convert_optab_handler (vec_init_optab, mode, > + TYPE_MODE (etype)); > + const_n_elts = CONSTRUCTOR_NELTS (exp); > + vec_vec_init_p = icode != CODE_FOR_nothing; > } > - icode = convert_optab_handler (vec_init_optab, mode, emode); > - if (icode != CODE_FOR_nothing) > + else if (exact_div (n_elts, GET_MODE_NUNITS (eltmode)) > + .is_constant (&const_n_elts)) > { > - unsigned int n = const_n_elts; > - > - if (vector_typed_elts_p) > - { > - n = CONSTRUCTOR_NELTS (exp); > - vec_vec_init_p = true; > - } > - vector = rtvec_alloc (n); > - for (unsigned int k = 0; k < n; k++) > - RTVEC_ELT (vector, k) = CONST0_RTX (emode); > + /* For a non-const type vector, we check it is made up of > + similarly non-const type vectors. */ > + icode = convert_optab_handler (vec_init_optab, mode, eltmode); > } > + > + if (const_n_elts && icode != CODE_FOR_nothing) > + { > + vector = rtvec_alloc (const_n_elts); > + for (unsigned int k = 0; k < const_n_elts; k++) > + RTVEC_ELT (vector, k) = CONST0_RTX (eltmode); > + } > } > > /* Compute the size of the elements in the CTOR. It differs >
diff --git a/gcc/expr.cc b/gcc/expr.cc index 2d90d7aac296077cc0bda8a1b4732b1cd44a610d..8bdec1cbf78ce338c135a6660bcb3abc75884c0c 100644 --- a/gcc/expr.cc +++ b/gcc/expr.cc @@ -7962,11 +7962,11 @@ store_constructor (tree exp, rtx target, int cleared, poly_int64 size, n_elts = TYPE_VECTOR_SUBPARTS (type); if (REG_P (target) - && VECTOR_MODE_P (mode) - && n_elts.is_constant (&const_n_elts)) + && VECTOR_MODE_P (mode)) { machine_mode emode = eltmode; bool vector_typed_elts_p = false; + auto nunits = GET_MODE_NUNITS (emode); if (CONSTRUCTOR_NELTS (exp) && (TREE_CODE (TREE_TYPE (CONSTRUCTOR_ELT (exp, 0)->value)) @@ -7976,22 +7976,30 @@ store_constructor (tree exp, rtx target, int cleared, poly_int64 size, gcc_assert (known_eq (CONSTRUCTOR_NELTS (exp) * TYPE_VECTOR_SUBPARTS (etype), n_elts)); + emode = TYPE_MODE (etype); vector_typed_elts_p = true; + nunits = TYPE_VECTOR_SUBPARTS (etype); } - icode = convert_optab_handler (vec_init_optab, mode, emode); - if (icode != CODE_FOR_nothing) - { - unsigned int n = const_n_elts; - if (vector_typed_elts_p) + /* For a non-const type vector, we check it is made up of similarly + non-const type vectors. */ + if (exact_div (n_elts, nunits).is_constant (&const_n_elts)) + { + icode = convert_optab_handler (vec_init_optab, mode, emode); + if (icode != CODE_FOR_nothing) { - n = CONSTRUCTOR_NELTS (exp); - vec_vec_init_p = true; + unsigned int n = const_n_elts; + + if (vector_typed_elts_p) + { + n = CONSTRUCTOR_NELTS (exp); + vec_vec_init_p = true; + } + vector = rtvec_alloc (n); + for (unsigned int k = 0; k < n; k++) + RTVEC_ELT (vector, k) = CONST0_RTX (emode); } - vector = rtvec_alloc (n); - for (unsigned int k = 0; k < n; k++) - RTVEC_ELT (vector, k) = CONST0_RTX (emode); } }