From patchwork Thu Jan 14 10:20:56 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tamar Christina X-Patchwork-Id: 1426261 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=8.43.85.97; helo=sourceware.org; envelope-from=gcc-patches-bounces@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=gcc.gnu.org Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.a=rsa-sha256 header.s=default header.b=eukWg4N0; dkim-atps=neutral Received: from sourceware.org (server2.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4DGgMJ07ypz9sWP for ; Thu, 14 Jan 2021 21:21:15 +1100 (AEDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id EE87B393D023; Thu, 14 Jan 2021 10:21:12 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org EE87B393D023 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1610619673; bh=WP+n8+05Of06FjRucawAIQGp+Q0FZyNGg3TT5aVZWtY=; h=Date:To:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:Cc:From; b=eukWg4N0eW63caVdx+zNPEb+U+sD+bcGNCKBqv+Aou/sHToUcMKt/92M/G9OVdjt2 8vQxNm/4MwJWJ7gif922MR0litM0kMOfOClYVKjwjlaLWNdxfoeyPPgVGvP9UCEsQP 87I1DvR3S4xjq+J1dAHX0sWHRt58Owf6y60972no= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from EUR03-DB5-obe.outbound.protection.outlook.com (mail-eopbgr40043.outbound.protection.outlook.com [40.107.4.43]) by sourceware.org (Postfix) with ESMTPS id 7EF323857C50 for ; Thu, 14 Jan 2021 10:21:10 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 7EF323857C50 Received: from AM6PR08CA0008.eurprd08.prod.outlook.com (2603:10a6:20b:b2::20) by HE1PR08MB2666.eurprd08.prod.outlook.com (2603:10a6:7:2f::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3763.9; Thu, 14 Jan 2021 10:21:07 +0000 Received: from VE1EUR03FT024.eop-EUR03.prod.protection.outlook.com (2603:10a6:20b:b2:cafe::5) by AM6PR08CA0008.outlook.office365.com (2603:10a6:20b:b2::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3763.9 via Frontend Transport; Thu, 14 Jan 2021 10:21:07 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123) smtp.mailfrom=arm.com; gcc.gnu.org; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com;gcc.gnu.org; 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; Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by VE1EUR03FT024.mail.protection.outlook.com (10.152.18.87) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3742.6 via Frontend Transport; Thu, 14 Jan 2021 10:21:06 +0000 Received: ("Tessian outbound 28c96a6c9d2e:v71"); Thu, 14 Jan 2021 10:21:06 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: 90949f8085991110 X-CR-MTA-TID: 64aa7808 Received: from 12c54217f135.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id D90F2928-C3D0-4952-8AE9-CB68B4B47F14.1; Thu, 14 Jan 2021 10:21:00 +0000 Received: from EUR02-VE1-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 12c54217f135.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Thu, 14 Jan 2021 10:21:00 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=RwpNFax0sgoSJSIDOB7XuuaU297bIjTRQibqNbSAbmkNUmoEeEo5oxADvzvfcu2+GYrJQd22YxDB0BzYYn1zHoOEc0vXj9a+eYSUJns7N91UA/d4xClqJ+ivOc/44DpVp2PWQIubtUZhvGd8oxjp5WLJKR4W0f0Iy5R4cSVlf6hSwZJzL5noeFd3F/URRnPt3pa8ASAve+vvpNEq6Qa9f7M7pL9EsCZY4lOn1SUUkMmhFiAczmjluWLDho0leUPD5QmzmbcJCJItnmy/RBmLTQAz3zOP03F5TWXMxP1KiM80Ny0+sKcjKHl/8ljqZx6/VNyNk7DoW1yYOdBx27mJ4A== 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-SenderADCheck; bh=WP+n8+05Of06FjRucawAIQGp+Q0FZyNGg3TT5aVZWtY=; b=jap5wsEVSiZFLsU1GndAibzxT7+XYRfegXgyZPwUrTxFdzzR03+T5mXAyZj3lqVDZacCX7AGiStdl4CfF0+4v+G529hwPn2MH94CIqM98ZNHY/YY+Bc5G5c4DqKqrFc+wCulRsjNqC72whDaY9Ry3A0z40Rl9d/boiifk5eHcDhRdGehCkIACOY0ABni7lWjw5JeKTwmNhhXkoQblOj6SKJqMeeFFrdORk/ROzCPb90JLdK099ZvjHtwOLdXcvs18LBiNkVcx8u73FIQV9Xkxe4pU9uCBsggKKLyCV3ud/dOMPvU00E9rBkIcdsTtwre7f5MIqHIhLqcrvvN3rbodQ== 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 Authentication-Results-Original: gcc.gnu.org; dkim=none (message not signed) header.d=none;gcc.gnu.org; dmarc=none action=none header.from=arm.com; Received: from AM0PR08MB5316.eurprd08.prod.outlook.com (2603:10a6:208:185::14) by AM8PR08MB5618.eurprd08.prod.outlook.com (2603:10a6:20b:1d7::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3763.11; Thu, 14 Jan 2021 10:20:58 +0000 Received: from AM0PR08MB5316.eurprd08.prod.outlook.com ([fe80::6093:2c97:a05b:377d]) by AM0PR08MB5316.eurprd08.prod.outlook.com ([fe80::6093:2c97:a05b:377d%6]) with mapi id 15.20.3763.010; Thu, 14 Jan 2021 10:20:58 +0000 Date: Thu, 14 Jan 2021 10:20:56 +0000 To: gcc-patches@gcc.gnu.org Subject: [PATCH]middle-end slp: elide intermediate nodes for complex add and avoid truncate Message-ID: Content-Disposition: inline User-Agent: Mutt/1.9.4 (2018-02-28) X-Originating-IP: [217.140.106.53] X-ClientProxiedBy: LO4P123CA0127.GBRP123.PROD.OUTLOOK.COM (2603:10a6:600:193::6) To AM0PR08MB5316.eurprd08.prod.outlook.com (2603:10a6:208:185::14) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from arm.com (217.140.106.53) by LO4P123CA0127.GBRP123.PROD.OUTLOOK.COM (2603:10a6:600:193::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3763.10 via Frontend Transport; Thu, 14 Jan 2021 10:20:58 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: a6825bd6-6f87-48f1-9208-08d8b8761af8 X-MS-TrafficTypeDiagnostic: AM8PR08MB5618:|HE1PR08MB2666: X-Microsoft-Antispam-PRVS: x-checkrecipientrouted: true NoDisclaimer: true X-MS-Oob-TLC-OOBClassifiers: OLM:4714;OLM:4714; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: kF4swQ4+C+y9t4dVroeZJimmYEzojWncoGcaas0lKVrmkELs5zfjcgLMGOW8kZ+/+FytvW3NsIdxSpKXKreC8+W//94RLwWS/d5iZTS0ls0VtK542lBTCyUgM6btcjpZsM6542vyPfrIgIjFiSlsUzjp9MOWmQWPkB0I47rCp54olG9J+YobtLjAp0s+4xyjTi4e8h2LdyRHToNSl7dRkwYMsesGz75O2IE3DK+fq8mzfuQJwveGLrBtdEhWcfJ3HjqheBKAJqvlin+aaCo2In5GjksUVaBzgLW7IyQ7vUbODjCR5ptnSACZ50WUqbRHvsckV4xzj/MbRnDunvyyZlVGotI+n9qOKzuhIxRfcmQpkdENtL+BE6DRvbniBUBU/3Fjb5I5yGC0gxQdUIEXdoxjIiapFQhqUpuSGz89T6HwQhW2q4BPNrVSNdEKfFLJ3RVKjQRCdRX0plwNZAvtdw== X-Forefront-Antispam-Report-Untrusted: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:AM0PR08MB5316.eurprd08.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(136003)(376002)(366004)(39860400002)(346002)(396003)(8886007)(316002)(4743002)(86362001)(26005)(44832011)(2906002)(8936002)(4326008)(16526019)(66476007)(2616005)(956004)(8676002)(36756003)(66556008)(55016002)(66946007)(66616009)(6916009)(7696005)(235185007)(5660300002)(52116002)(33964004)(478600001)(44144004)(186003)(4216001)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Pv?= =?utf-8?q?otsZjnAJ6i8n/hnqRvrDprlzRbDrhV8qDF9Eo056Mt/n8A/aAsaV5xn8YotHR7A3m?= =?utf-8?q?A+OR03dobol+XaOTEY+N+HweV4eFvMrshvmklQWYjyYHa12qDZIU6fUK7ljam+ViZ?= =?utf-8?q?aDo93CbqsM1dN9MjTVI?= X-MS-Exchange-Transport-Forked: True X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM8PR08MB5618 Original-Authentication-Results: gcc.gnu.org; dkim=none (message not signed) header.d=none;gcc.gnu.org; dmarc=none action=none header.from=arm.com; X-EOPAttributedMessage: 0 X-MS-Exchange-Transport-CrossTenantHeadersStripped: VE1EUR03FT024.eop-EUR03.prod.protection.outlook.com X-MS-Office365-Filtering-Correlation-Id-Prvs: 3070e65a-f849-49ac-38f2-08d8b8761608 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: e+aiMpmyuZmZRdJD5E/Km8FXcC2M3vzRn/YSGScr38AYm+F5nyjhJ3WVT0WMJBvTo6zaY3xp4DeN7ABoTrg04bwL3kSKmhcKDuEGBok8oZBDKEONoyS2F6LL2tAfZ6YwVFK13XQNxa/STWq5zZFhVvC0yDkTnNkTXywxKSJdJHbrOucX4JXH0XtmXc2RzQmEsjjxiDZmdyE7vXizW2bTCuy5u1+47gF65axzSHfswDnwGavwAL/DxrwNkYu4UkHJ+5rfDwMFYEx0/YDR/WlRuLmqxPAPYACvh8xekADh5IM62uGTQw4D39pM3aM/1/sCz4nO0DHNTgSz+8eAr4CV1OfhXBsWjBVrkmjK34fVitn4ShhAPP3R5OyUZx0ajzq/KX0PNq3WBJmSbi725qdsxNn/H3oTjxRAon5/tf/l5VeuscbnwPFURmCcprtChBGWBgEnmun4m3rq/zPJeBzWws6yG8LRrux24PEMPLIDqt+IReIATIKahVJ2RoKMMMErwshnUbL4dGQOszcJn+LnUEnG+T/J9INLxLZK+dtDLjk= 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:(4636009)(346002)(396003)(376002)(136003)(39860400002)(46966006)(356005)(336012)(81166007)(36756003)(70206006)(66616009)(235185007)(47076005)(44832011)(8676002)(107886003)(2616005)(70586007)(186003)(86362001)(55016002)(26005)(956004)(5660300002)(34020700004)(6916009)(7696005)(478600001)(2906002)(82740400003)(82310400003)(4326008)(16526019)(44144004)(8936002)(33964004)(8886007)(316002)(4743002)(4216001)(2700100001); DIR:OUT; SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Jan 2021 10:21:06.9815 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: a6825bd6-6f87-48f1-9208-08d8b8761af8 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: VE1EUR03FT024.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: HE1PR08MB2666 X-Spam-Status: No, score=-14.3 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, GIT_PATCH_0, MSGID_FROM_MTA_HEADER, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_HELO_PASS, SPF_PASS, TXREP, UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Tamar Christina via Gcc-patches From: Tamar Christina Reply-To: Tamar Christina Cc: nd@arm.com, rguenther@suse.de Errors-To: gcc-patches-bounces@gcc.gnu.org Sender: "Gcc-patches" Hi All, This applies the same feedback received for MUL and the rest to ADD which was already committed. In short it elides the intermediate nodes vec and avoids the use of truncate on the SLP child. Bootstrapped Regtested on aarch64-none-linux-gnu and no issues. Ok for master? Thanks, Tamar gcc/ChangeLog: * tree-vect-slp-patterns.c (complex_add_pattern::build): --- inline copy of patch -- diff --git a/gcc/tree-vect-slp-patterns.c b/gcc/tree-vect-slp-patterns.c index be066b08310b72320fdbeb88a6b2969151f73cdc..e9f70958fdc32427ab0e1cceadfed41dfa091b47 100644 diff --git a/gcc/tree-vect-slp-patterns.c b/gcc/tree-vect-slp-patterns.c index be066b08310b72320fdbeb88a6b2969151f73cdc..e9f70958fdc32427ab0e1cceadfed41dfa091b47 100644 --- a/gcc/tree-vect-slp-patterns.c +++ b/gcc/tree-vect-slp-patterns.c @@ -645,23 +645,21 @@ class complex_add_pattern : public complex_pattern void complex_add_pattern::build (vec_info *vinfo) { - auto_vec nodes; + SLP_TREE_CHILDREN (*this->m_node).reserve_exact (2); + slp_tree node = this->m_ops[0]; vec children = SLP_TREE_CHILDREN (node); /* First re-arrange the children. */ - nodes.create (children.length ()); - nodes.quick_push (children[0]); - nodes.quick_push (vect_build_swap_evenodd_node (children[1])); + SLP_TREE_CHILDREN (*this->m_node)[0] = children[0]; + SLP_TREE_CHILDREN (*this->m_node)[1] = + vect_build_swap_evenodd_node (children[1]); - SLP_TREE_REF_COUNT (nodes[0])++; - SLP_TREE_REF_COUNT (nodes[1])++; + SLP_TREE_REF_COUNT (SLP_TREE_CHILDREN (*this->m_node)[0])++; + SLP_TREE_REF_COUNT (SLP_TREE_CHILDREN (*this->m_node)[1])++; vect_free_slp_tree (this->m_ops[0]); vect_free_slp_tree (this->m_ops[1]); - SLP_TREE_CHILDREN (*this->m_node).truncate (0); - SLP_TREE_CHILDREN (*this->m_node).safe_splice (nodes); - complex_pattern::build (vinfo); }