Message ID | Z3u/rCEwydQh47qO@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 583EE3858C32 for <patchwork@sourceware.org>; Mon, 6 Jan 2025 11:34:45 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from EUR05-DB8-obe.outbound.protection.outlook.com (mail-db8eur05on20625.outbound.protection.outlook.com [IPv6:2a01:111:f403:2614::625]) by sourceware.org (Postfix) with ESMTPS id 8B3AA3858402 for <gcc-patches@gcc.gnu.org>; Mon, 6 Jan 2025 11:34:14 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 8B3AA3858402 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 8B3AA3858402 Authentication-Results: server2.sourceware.org; arc=pass smtp.remote-ip=2a01:111:f403:2614::625 ARC-Seal: i=2; a=rsa-sha256; d=sourceware.org; s=key; t=1736163254; cv=pass; b=rPoaHCRVkRgkXMXUwn7/cfmFY/W3gxiDjz3Iw2bkiLuSsEI7URqBuwt+29w0gyJrglAb5KzN2eKeBmNuaIPrsvU8zqgbE+dwTtAolL8WdN543F6p4KUDfuZl/VE4OzBiLu4bIQYtrxo7TkkmrCUvo9AbfvQyOWygDTPO/jXL/zY= ARC-Message-Signature: i=2; a=rsa-sha256; d=sourceware.org; s=key; t=1736163254; c=relaxed/simple; bh=BN9W7m4+2xMJ5qwazUjCOzqBtaTXqJIdlDSaG24Fstg=; h=DKIM-Signature:Date:From:To:Subject:Message-ID:MIME-Version; b=GPRLnXGflZBx6XT6CAarZW/MATrcqDZ6qgB/v7ybypSYfqM/VR9/p0Ayu3gcHLLkdV6XF6GTemdmkx51ESQd0gRCLS5INgE1lNcWRI94SQ0yKaRL3WYPk8AoYVEwRm0q+onpXh9gKMu7dlbCcD+fqob2FK6/hq6tdERyEueFJB0= ARC-Authentication-Results: i=2; server2.sourceware.org ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=KfXCTW9ijVgcm1xW0wg+vn7nxgAjh5+WZKXpAh3DGSEsc/zHGxBCJ24wzPOoX+YCr86WWqIxhxcI9LmYOeIqk+y+WL4i6cWCdlUdjhMxg3tzpc3nSxDyFkjrAK3cy1JUtYOjq1wKaogZH/+L1vnK+zbe4G/Nmv3ho21yfjPnBjXdhVsgaYJCNsa99iW1ARoqvNchMrLAtI2jhnq/tWMFM18k3vXZvNRaHA7IH8yHMKIZWBQeESiLyTxSiIpp2d6mKNRhxchUoVYq4IfcuJ0vU40CyGwUijJ4ZmllY6t8RUnvS+jeDOldmmAeOCGaSzzRlvtsB8KoYtLwL/0FLVYU2A== 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=B96m15/1m/OmIT6w5kmZmu5Z0erC1FUp8on0UTCuIRA=; b=ZkMU/yhXth4VJ8Ya1yvNlggV14QK8lFSy17/nbMlF/XULmiTB/S5rHCD+HNeXIYpGgy+D8fPTkb3VUfPAa3A++M1oGtBRNXheH8/MBtqcqhuk9rTHUJgBu4XAgH7zr6Wa+RhhxCjnh2vv8XmE0LLq58fWBSK8l8vz0+D2tZq8Goe2uDhrCT/1gf2RKihDZGyvD/OvRIu+xe64Jg0R51ah1oQcFW52h0oYEXrGbqoS2B29vKt38kUAjFAfDNLN1UQgRLo3wTRmqVtxmux9w+CdskHkJ/lRoQjVMNc8WnXGxBNk1GW0wF94H+9CqtzTOz+l5XifWH7jLZggvvvrudToQ== 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=B96m15/1m/OmIT6w5kmZmu5Z0erC1FUp8on0UTCuIRA=; b=Ibn3zbLgYKc8Itxdf2u8y+0LZOQf56SChceThBNVZxjRL+NS7lUb5TA+O/rxdkU/UAM7YAVNKsdAImizfIiB4XfUSDGY5uitqcfc03Jc2tyMEQ1K6FRtTAvan5DNhSeTJrlCoDeiO05Gk5H93zu58VQAxbQsI5Bd4PpMr3KvXTo= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com; Received: from PAWPR08MB8958.eurprd08.prod.outlook.com (2603:10a6:102:33e::15) by AS2PR08MB10082.eurprd08.prod.outlook.com (2603:10a6:20b:62f::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8314.16; Mon, 6 Jan 2025 11:34:06 +0000 Received: from PAWPR08MB8958.eurprd08.prod.outlook.com ([fe80::9f32:dc2a:5bec:aeac]) by PAWPR08MB8958.eurprd08.prod.outlook.com ([fe80::9f32:dc2a:5bec:aeac%5]) with mapi id 15.20.8314.015; Mon, 6 Jan 2025 11:34:06 +0000 Date: Mon, 6 Jan 2025 11:34:04 +0000 From: Alex Coplan <alex.coplan@arm.com> To: gcc-patches@gcc.gnu.org Cc: Richard Biener <rguenther@suse.de>, Jan Hubicka <hubicka@ucw.cz>, Tamar Christina <tamar.christina@arm.com> Subject: [PATCH 1/4] vect: Set counts of early break exit blocks correctly [PR117790] Message-ID: <Z3u/rCEwydQh47qO@arm.com> Content-Type: multipart/mixed; boundary="Lh8V9n793iHi0DAA" Content-Disposition: inline Content-Transfer-Encoding: 8bit X-ClientProxiedBy: LO2P123CA0058.GBRP123.PROD.OUTLOOK.COM (2603:10a6:600:1::22) To PAWPR08MB8958.eurprd08.prod.outlook.com (2603:10a6:102:33e::15) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PAWPR08MB8958:EE_|AS2PR08MB10082:EE_ X-MS-Office365-Filtering-Correlation-Id: b2b46679-d9ac-4c54-df45-08dd2e460763 x-checkrecipientrouted: true NoDisclaimer: true X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|366016|376014|1800799024; X-Microsoft-Antispam-Message-Info: =?utf-8?q?XlMHV5K0tlKr0Kl7BYbh1dd/faES7qC?= =?utf-8?q?R9YD9+ywWgh0P8yub6T0dAQB4KyCGY+DE9wljLMJmKTs+h1PsqldRwhDCZkLB8XX+?= =?utf-8?q?dtKUhmOIG47gbQIw1J0Y42vOdoQxe6tLOrwW1T4JfZtDqEdJhsvruUMmWTv4khJSF?= =?utf-8?q?u1tCoeoRj9ux+S7uHSlRrHKzptMvS56gtEpZTgEWkiRZJbjNkFqPR9bFe+DNuEK1j?= =?utf-8?q?9spfaHZXoWxx+p3Sk1s3bcyltVH2vdXlQSnNoviYknzVXPBJdQTLOj9R17yPwdbes?= =?utf-8?q?jJRc5nZ/1ayO3VsWTVMyKIM/U2B1b3xzvDiKBmiH+oRsP1lUgtP/5fYmXX2P8m6Bu?= =?utf-8?q?+z27YIbzZ/NvA76RO7gD/utE28cEWvju7f8hMfCkk7vy8bDZtuFl1EpOSPshK8ySb?= =?utf-8?q?/B7jUBgiJ/lHsjv/N3miLyopSgfJKK25UYPBkjwSPQEzrnYjr8oK7qYyuzJE4oNPF?= =?utf-8?q?fQqv7FMvfAQEukkPvJknr6CE7yYeLpSYjV5rpy5YaaTEPvtMOiKnH20iBusELLkF2?= =?utf-8?q?j6QeGS5f8y5boXyjqif/ktWNKSBslkXH1Z8JUW4vj07fpGe0cz9anRNgxIuUDoQmS?= =?utf-8?q?o0tKANdG561kpQ/xxbv9+rkAxh3DT0Swa/DAJN9KU66OV1xXmUCCqyYoQLk1jg/su?= =?utf-8?q?amMoocrZpwc8q3FakpQue2AWXvubOMne3GauTizkmOQzTaxprH+d/1UYP/wl7PhNM?= =?utf-8?q?2JXo95LlikX+x3pgErzXv46TMMMwpD32IkMhQAhYs2klwi3xtQTBr+26pz+40sXqv?= =?utf-8?q?JHeA7KANmoGdto0ixSb0+x+htnPXSbs24muqrVRkqZ694n0JtyZ5ZKxHEdf7oBTPD?= =?utf-8?q?aHDHpSCT9jBdSrwnjybch9iNBZhzUXExrhv29ApoBd9KW9DE4EU/SgUgyAYbJzZPN?= =?utf-8?q?ZicunjNvtRRhBCxqVXzObeX5HFNJwj/uYHOt0k89w1MbFeS09a8Lb5N4YWuS+B+iW?= =?utf-8?q?rylYCGdYX2TDhwBCWgSQU1iqPo9UR5N1zEGkcuhGj/WgzD25y9MKLpiXBsAwFOqNg?= =?utf-8?q?vZg5EgkzDwP495fpJDLj8Q8rf4kGonnK/ifun43rGPgGUp2K8kCdgfYJgY2uB0sSG?= =?utf-8?q?LDEZU1mdu2Q14yJ063cRnyyV+ld+WPZfxG9GnqrKVKguZ7WXDdFQlQUSov1ra23q/?= =?utf-8?q?GWjyF2clflShbmKeozpep38vVIe8RLoA/aYNL6w8UM+4rBBHvcPTD3tybguEIirgg?= =?utf-8?q?ku49rHBVHfMxqXjvkF/HShOtc+LjBBROlzF/i5BoXLkiC7Fsxp9z4DuwIdefGXTjx?= =?utf-8?q?XqBunTBl5UqrKagt/ln0hRuJ793EhFP87p1HJmWtlC+EOevgyvCPNefLdW1ZCaZCF?= =?utf-8?q?yC7TaCFtjaOp?= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:PAWPR08MB8958.eurprd08.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230040)(366016)(376014)(1800799024); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?wnzl01Lzm4fdzDH5dLPs9Tu2lZ3i?= =?utf-8?q?CoeyMl0gNuMCJ+h17X4NoqyOZPLTq2Riz8PMA8n6sDBnBmVZAyhWLECBC9tWlrYJo?= =?utf-8?q?+AfpO2mPkf+CwoZDPPN3CmhfabYS9/rESzqQUve2nlF8Py5zUcGos6FLCJurmibV2?= =?utf-8?q?yBxwDAHmlToJzOrh5C7ccy360tkW7K4qeYCBMLTkwboBLjDY4omo5rcLulRR0o99O?= =?utf-8?q?Q8NRYAU42xZPt0M/B9wVxwILXtl+tP+Wafa1SfYXlj8+fkBh5YH7qbo5MiZ0YMnIC?= =?utf-8?q?P7qM6MnchgEx9nODaU8AeGCe9BM+AJEw0/pkLtSb2Ez0WMQ1trtsZzFpdv0/ZoezU?= =?utf-8?q?xYR06X1kAhTBZNA+YgDW/jyto/rAMJHnfYiLq2nlLqxdfguh40EJAcXpQwfCaNV8y?= =?utf-8?q?9Mdv++cyHbJR8EdsqfOewMIkHie+HLqJ5kXl7GxxxebauK6C6+QgFNqCPiBKdhqHd?= =?utf-8?q?LBQWsrzlMAQbPeHChQgmKltGYsxaHcbQZrtSqcVIzLsiOV3KGoXtmbHeyiK6+urex?= =?utf-8?q?xClaPYKp4ZMDn7dZgj8cjswH0q8YyBu278zZwJB9HoIE0wt+eNzDjqS7Xmxa4XT0+?= =?utf-8?q?uatnRFJBDBwjO4tZD4jjSolsy6DiXiZj54Gv17arDG57jbjZ6/CbozQYen2pV96KX?= =?utf-8?q?CtAt+UFt2xQDvmO+94riKKKZtzqxKoBgO6l8JHUcCRuMmh69lKo5ZTFgUmNPDg38j?= =?utf-8?q?rG5M07j+yyt5ykHObVVyZhnxgRGjAqeLUoF/XEzBqpe6i3eOl53zhtm/0XL1RsAa7?= =?utf-8?q?dmivoVcc7WZh+qmXNthVndnjDRU6kJRJyZ1NQPRNZX8hRyDTrMfsb8AEukQrPmZQA?= =?utf-8?q?CVqhggccACq97nd70gnZOmuAVXto0PvhpjIp81W02SOM6aAEP6IeOs4vxTTMVPNSx?= =?utf-8?q?BjazjgC3mI3nRpM9MxHuSfPcaEetPbAOKMMZHQepjQIgD7j4pBurJNeLOGsoQitTs?= =?utf-8?q?CInY/7ayK0adQ7P3a7WobP56ZtTncMbWLpXp3ilcHtX1+xQe+Hzm7wUPC3PoSaSTL?= =?utf-8?q?HwEEyOLjR+WAmFKy9wq2U6wyGLytdlQzuVB2HjIRsGnyjlCiCWV49JNMPE8WkcMgv?= =?utf-8?q?wh3egUAQyxH6hiTBxe3Irq1HNPnjoXJoGU9le+vSAHud6gYVS+Z6SFv+JrMuFNBI/?= =?utf-8?q?LtNjrWrK+sFLkZT1pU6f9HEaD7erT7Wf4PjrRL0/7edZQkQsjBM1SzdmNZXeTHU+E?= =?utf-8?q?KxqT+NSkBur+Bk339FYna1RvVKMcuQNDVj5iE5GCeq9pCaalv9Vd21gqxKKwFTJCh?= =?utf-8?q?A57z1Npu9RBxA+yGsWXeOv0wVRuZJoqH67kjCXb7wvEmwrHF31Ics9skchNPRLAyh?= =?utf-8?q?eR1kuAWMPgUmk4JP5DZgzq+isWSnPQ/G9kSKxggCKqcCo+dyb1uz7onR9RjONYmg7?= =?utf-8?q?1h809BOPX0QvzMTn1ZaWCvTWwfwNquc7Uj5ryiAPArWYNoUmpmwb+9P/LxpxCfwQ8?= =?utf-8?q?26KKzbcbF0jNcS6vC/9vmTrrhfQ6FdLgq4CWBAU5/499CHDm0QUhqqRavGhDQTi34?= =?utf-8?q?4xz/fiUWGRwI?= X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-Network-Message-Id: b2b46679-d9ac-4c54-df45-08dd2e460763 X-MS-Exchange-CrossTenant-AuthSource: PAWPR08MB8958.eurprd08.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Jan 2025 11:34:06.4048 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: capGAc5rmfEplGwlLUADYM+18zn5NQRnqpgTsAbTXzA2Hk833qxpWnfONy7Ipe5HJrtPbhNot0g9gzijgXcJTw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS2PR08MB10082 X-Spam-Status: No, score=-10.9 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FORGED_SPF_HELO, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_PASS, SPF_NONE, 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 <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, cfgloopmanip: Fix profile consistency of early break loops [PR117790]
|
|
Commit Message
Alex Coplan
Jan. 6, 2025, 11:34 a.m. UTC
This adds missing code to correctly set the counts of the exit blocks we create when building the CFG for a vectorized early break loop. Tested as a series on aarch64-linux-gnu, arm-linux-gnueabihf, and x86_64-linux-gnu. OK for trunk? Thanks, Alex gcc/ChangeLog: PR tree-optimization/117790 * tree-vect-loop-manip.cc (slpeel_tree_duplicate_loop_to_edge_cfg): Set profile counts for {main,alt}_loop_exit_block. --- gcc/tree-vect-loop-manip.cc | 10 ++++++++++ 1 file changed, 10 insertions(+)
Comments
Ping > -----Original Message----- > From: Alex Coplan <Alex.Coplan@arm.com> > Sent: Monday, January 6, 2025 11:34 AM > To: gcc-patches@gcc.gnu.org > Cc: Richard Biener <rguenther@suse.de>; Jan Hubicka <hubicka@ucw.cz>; Tamar > Christina <Tamar.Christina@arm.com> > Subject: [PATCH 1/4] vect: Set counts of early break exit blocks correctly > [PR117790] > > This adds missing code to correctly set the counts of the exit blocks we > create when building the CFG for a vectorized early break loop. > > Tested as a series on aarch64-linux-gnu, arm-linux-gnueabihf, and > x86_64-linux-gnu. OK for trunk? > > Thanks, > Alex > > gcc/ChangeLog: > > PR tree-optimization/117790 > * tree-vect-loop-manip.cc (slpeel_tree_duplicate_loop_to_edge_cfg): > Set profile counts for {main,alt}_loop_exit_block. > --- > gcc/tree-vect-loop-manip.cc | 10 ++++++++++ > 1 file changed, 10 insertions(+)
ping > -----Original Message----- > From: Tamar Christina > Sent: Wednesday, January 15, 2025 2:07 PM > To: Alex Coplan <Alex.Coplan@arm.com>; gcc-patches@gcc.gnu.org > Cc: Richard Biener <rguenther@suse.de>; Jan Hubicka <hubicka@ucw.cz> > Subject: RE: [PATCH 1/4] vect: Set counts of early break exit blocks correctly > [PR117790] > > Ping > > > -----Original Message----- > > From: Alex Coplan <Alex.Coplan@arm.com> > > Sent: Monday, January 6, 2025 11:34 AM > > To: gcc-patches@gcc.gnu.org > > Cc: Richard Biener <rguenther@suse.de>; Jan Hubicka <hubicka@ucw.cz>; Tamar > > Christina <Tamar.Christina@arm.com> > > Subject: [PATCH 1/4] vect: Set counts of early break exit blocks correctly > > [PR117790] > > > > This adds missing code to correctly set the counts of the exit blocks we > > create when building the CFG for a vectorized early break loop. > > > > Tested as a series on aarch64-linux-gnu, arm-linux-gnueabihf, and > > x86_64-linux-gnu. OK for trunk? > > > > Thanks, > > Alex > > > > gcc/ChangeLog: > > > > PR tree-optimization/117790 > > * tree-vect-loop-manip.cc (slpeel_tree_duplicate_loop_to_edge_cfg): > > Set profile counts for {main,alt}_loop_exit_block. > > --- > > gcc/tree-vect-loop-manip.cc | 10 ++++++++++ > > 1 file changed, 10 insertions(+)
Ping > -----Original Message----- > From: Tamar Christina > Sent: Friday, January 24, 2025 9:17 AM > To: Alex Coplan <Alex.Coplan@arm.com>; 'gcc-patches@gcc.gnu.org' <gcc- > patches@gcc.gnu.org> > Cc: 'Richard Biener' <rguenther@suse.de>; 'Jan Hubicka' <hubicka@ucw.cz> > Subject: RE: [PATCH 1/4] vect: Set counts of early break exit blocks correctly > [PR117790] > > ping > > > -----Original Message----- > > From: Tamar Christina > > Sent: Wednesday, January 15, 2025 2:07 PM > > To: Alex Coplan <Alex.Coplan@arm.com>; gcc-patches@gcc.gnu.org > > Cc: Richard Biener <rguenther@suse.de>; Jan Hubicka <hubicka@ucw.cz> > > Subject: RE: [PATCH 1/4] vect: Set counts of early break exit blocks correctly > > [PR117790] > > > > Ping > > > > > -----Original Message----- > > > From: Alex Coplan <Alex.Coplan@arm.com> > > > Sent: Monday, January 6, 2025 11:34 AM > > > To: gcc-patches@gcc.gnu.org > > > Cc: Richard Biener <rguenther@suse.de>; Jan Hubicka <hubicka@ucw.cz>; > Tamar > > > Christina <Tamar.Christina@arm.com> > > > Subject: [PATCH 1/4] vect: Set counts of early break exit blocks correctly > > > [PR117790] > > > > > > This adds missing code to correctly set the counts of the exit blocks we > > > create when building the CFG for a vectorized early break loop. > > > > > > Tested as a series on aarch64-linux-gnu, arm-linux-gnueabihf, and > > > x86_64-linux-gnu. OK for trunk? > > > > > > Thanks, > > > Alex > > > > > > gcc/ChangeLog: > > > > > > PR tree-optimization/117790 > > > * tree-vect-loop-manip.cc (slpeel_tree_duplicate_loop_to_edge_cfg): > > > Set profile counts for {main,alt}_loop_exit_block. > > > --- > > > gcc/tree-vect-loop-manip.cc | 10 ++++++++++ > > > 1 file changed, 10 insertions(+)
> This adds missing code to correctly set the counts of the exit blocks we > create when building the CFG for a vectorized early break loop. > > Tested as a series on aarch64-linux-gnu, arm-linux-gnueabihf, and > x86_64-linux-gnu. OK for trunk? > > Thanks, > Alex > > gcc/ChangeLog: > > PR tree-optimization/117790 > * tree-vect-loop-manip.cc (slpeel_tree_duplicate_loop_to_edge_cfg): > Set profile counts for {main,alt}_loop_exit_block. > --- > gcc/tree-vect-loop-manip.cc | 10 ++++++++++ > 1 file changed, 10 insertions(+) > > diff --git a/gcc/tree-vect-loop-manip.cc b/gcc/tree-vect-loop-manip.cc > index 5d1b70aea43..53d36eaa25f 100644 > --- a/gcc/tree-vect-loop-manip.cc > +++ b/gcc/tree-vect-loop-manip.cc > @@ -1686,6 +1686,16 @@ slpeel_tree_duplicate_loop_to_edge_cfg (class loop *loop, edge loop_exit, > > set_immediate_dominator (CDI_DOMINATORS, new_preheader, > loop->header); > + > + /* Fix up the profile counts of the new exit blocks. > + main_loop_exit_block was created by duplicating the > + preheader, so needs its count scaling according to the main > + exit edge's probability. The remaining count from the > + preheader goes to the alt_loop_exit_block, since all > + alternative exits have been redirected there. */ > + main_loop_exit_block->count = loop_exit->count (); > + alt_loop_exit_block->count > + = preheader->count - main_loop_exit_block->count; Reading the code, we orignaly have new_preheader that is split into several pieces and loop exits are redirected to them and exit edges of pieces are redirected to the last part? In that case patch is OK. Honza
> -----Original Message----- > From: Jan Hubicka <hubicka@ucw.cz> > Sent: Tuesday, February 4, 2025 4:25 PM > To: Alex Coplan <Alex.Coplan@arm.com> > Cc: gcc-patches@gcc.gnu.org; Richard Biener <rguenther@suse.de>; Tamar > Christina <Tamar.Christina@arm.com> > Subject: Re: [PATCH 1/4] vect: Set counts of early break exit blocks correctly > [PR117790] > > > This adds missing code to correctly set the counts of the exit blocks we > > create when building the CFG for a vectorized early break loop. > > > > Tested as a series on aarch64-linux-gnu, arm-linux-gnueabihf, and > > x86_64-linux-gnu. OK for trunk? > > > > Thanks, > > Alex > > > > gcc/ChangeLog: > > > > PR tree-optimization/117790 > > * tree-vect-loop-manip.cc (slpeel_tree_duplicate_loop_to_edge_cfg): > > Set profile counts for {main,alt}_loop_exit_block. > > --- > > gcc/tree-vect-loop-manip.cc | 10 ++++++++++ > > 1 file changed, 10 insertions(+) > > > > > diff --git a/gcc/tree-vect-loop-manip.cc b/gcc/tree-vect-loop-manip.cc > > index 5d1b70aea43..53d36eaa25f 100644 > > --- a/gcc/tree-vect-loop-manip.cc > > +++ b/gcc/tree-vect-loop-manip.cc > > @@ -1686,6 +1686,16 @@ slpeel_tree_duplicate_loop_to_edge_cfg (class loop > *loop, edge loop_exit, > > > > set_immediate_dominator (CDI_DOMINATORS, new_preheader, > > loop->header); > > + > > + /* Fix up the profile counts of the new exit blocks. > > + main_loop_exit_block was created by duplicating the > > + preheader, so needs its count scaling according to the main > > + exit edge's probability. The remaining count from the > > + preheader goes to the alt_loop_exit_block, since all > > + alternative exits have been redirected there. */ > > + main_loop_exit_block->count = loop_exit->count (); > > + alt_loop_exit_block->count > > + = preheader->count - main_loop_exit_block->count; > > Reading the code, we orignaly have new_preheader that is split into > several pieces and loop exits are redirected to them and exit edges of > pieces are redirected to the last part? > Indeed, All alternate exits are redirected to the same block, as they share the same induction values, that block and the main exit are then directed to a join block which is created just above the guard block for the epilogue. > In that case patch is OK. Thanks! Tamar > Honza
diff --git a/gcc/tree-vect-loop-manip.cc b/gcc/tree-vect-loop-manip.cc index 5d1b70aea43..53d36eaa25f 100644 --- a/gcc/tree-vect-loop-manip.cc +++ b/gcc/tree-vect-loop-manip.cc @@ -1686,6 +1686,16 @@ slpeel_tree_duplicate_loop_to_edge_cfg (class loop *loop, edge loop_exit, set_immediate_dominator (CDI_DOMINATORS, new_preheader, loop->header); + + /* Fix up the profile counts of the new exit blocks. + main_loop_exit_block was created by duplicating the + preheader, so needs its count scaling according to the main + exit edge's probability. The remaining count from the + preheader goes to the alt_loop_exit_block, since all + alternative exits have been redirected there. */ + main_loop_exit_block->count = loop_exit->count (); + alt_loop_exit_block->count + = preheader->count - main_loop_exit_block->count; } /* Adjust the epilog loop PHI entry values to continue iteration.