From patchwork Fri Jan 12 08:28:34 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tamar Christina X-Patchwork-Id: 1885903 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=armh.onmicrosoft.com header.i=@armh.onmicrosoft.com header.a=rsa-sha256 header.s=selector2-armh-onmicrosoft-com header.b=1Jznw/tP; dkim=pass (1024-bit key) header.d=armh.onmicrosoft.com header.i=@armh.onmicrosoft.com header.a=rsa-sha256 header.s=selector2-armh-onmicrosoft-com header.b=1Jznw/tP; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=2620:52:3:1:0:246e:9693:128c; helo=server2.sourceware.org; envelope-from=gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=patchwork.ozlabs.org) Received: from server2.sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4TBF8q4Qyvz1yPm for ; Fri, 12 Jan 2024 19:30:19 +1100 (AEDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id DC4C83858C53 for ; Fri, 12 Jan 2024 08:30:14 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from EUR03-DBA-obe.outbound.protection.outlook.com (mail-dbaeur03on2062.outbound.protection.outlook.com [40.107.104.62]) by sourceware.org (Postfix) with ESMTPS id 571773858D32 for ; Fri, 12 Jan 2024 08:28:58 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 571773858D32 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 571773858D32 Authentication-Results: server2.sourceware.org; arc=pass smtp.remote-ip=40.107.104.62 ARC-Seal: i=3; a=rsa-sha256; d=sourceware.org; s=key; t=1705048144; cv=pass; b=iHyz/QAa1BuzKat4BdveB0vb5cWLgSZb4iOSv1uik2cX3LE7Fbnf47q49CR2dNpsLQoA26JmrGtZdhm1LSC6Q3S2XAC9Tf81E66UUvh+j3FjRQwKgq4uSl0qYe30vaD1pdaf0WsHkvNCxAcvEWZ77w1JyiyXwaY6tBpb5WLqIII= ARC-Message-Signature: i=3; a=rsa-sha256; d=sourceware.org; s=key; t=1705048144; c=relaxed/simple; bh=yWl2pIDcNLtMwSWX4s1erMnRjjkoeEX/mKr6GLh/iGY=; h=DKIM-Signature:DKIM-Signature:Date:From:To:Subject:Message-ID: MIME-Version; b=Hbk4bl+XGSRe0x6uWa3id7GUUM6wNfiictHGFWsFghTq8Zyf+euE56I4J4dcYREDVbbqej26YTic2EDOKXxbONRXtFNhXQkzLjJjeERUPsDcp1s7Oo7juXXUMGLvyI8nnUXbD4aQ/QX1truOmmplSQ5bJTlBxHuz23Zbtd/y6WQ= ARC-Authentication-Results: i=3; server2.sourceware.org ARC-Seal: i=2; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=pass; b=UnP1tr3/8I3j9v6+kR1r3DRvf52QsG9D/zqoJgAzB1ycuJEqzmzHXLlOOAitQCKdFvEmEAFNd/zWkuI0IkPiFdcyeAW41AVUCApNzFx/DkFzHAkIJgzF9ZmRleypkOu4TCpiLrbfsPq558hvqXVZuWzHyRwKVKuuqgokFmBqsEPbiZDikrW3t4iPREiMZUGn2nQPmA11XCEcPVqQeiKZ9YPyjsp0ULcP8qt7v0TBpgKi1TUfh3amzeVMSzLBmMeDwE/wQiSEt+5TuWM7dquzNyvsuzWtdLU+aDnMkWlEb3bIS8BH32LG9QVVE2d/eaGLC++4fNRkBcXyS/hOh3vsyQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; 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=EtZa6rEQXa/pP4RJYVgrCtEMVg4V7E+jRZs3XeE8xZc=; b=RGm7v4Hg+N798ilbyHlXZwYbXPqu5jsxZXn+EuSATIev9D1xxTf/6nk1DsKMBXG1G4gGUgIs7eNu6um433c6nr5vPglr53mpdqfzsCcNRr9Keg+KFyIyjvc310nPbLnlx9h6Jph6vYw1ASvsIkiDB3lClpszrTOALDIjG3sMBllBHEpba61L3+ehmvd8Jm1u/vcJS7O6dxbnX7rnq81byrm9Buo9/sfrX0dl/CZqbIL8M+sx9Y5g/zZ/gv9xSs3S3nTS1lUVD3DEBMaYk5/qRNi8+q9lzPD12Pxc5ceg1cWR4IHsyQN+M7k7u0/R5p6K83D/Pa4Qa+RIxEkZ5aNajg== 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=armh.onmicrosoft.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=armh.onmicrosoft.com; s=selector2-armh-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=EtZa6rEQXa/pP4RJYVgrCtEMVg4V7E+jRZs3XeE8xZc=; b=1Jznw/tPTsvzG2nSyPjU8IcP1FXuAJ6oBHxmlC+8ye8naOPweFSDUjN8BWnXMNn1qiU+08JQG0sORV3aaDud3KHzpLwzzMWLccq3mEnUsIzzb2CAs1OdHMuiSMVfhsW7kjL5xsMd3+MG1zba/0R+UNpDd7QFDK2rw/2/rRih28s= Received: from AS4PR10CA0014.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:20b:5dc::18) by PAVPR08MB8967.eurprd08.prod.outlook.com (2603:10a6:102:326::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7181.17; Fri, 12 Jan 2024 08:28:48 +0000 Received: from AMS0EPF000001A1.eurprd05.prod.outlook.com (2603:10a6:20b:5dc:cafe::49) by AS4PR10CA0014.outlook.office365.com (2603:10a6:20b:5dc::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7159.21 via Frontend Transport; Fri, 12 Jan 2024 08:28:48 +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=armh.onmicrosoft.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 AMS0EPF000001A1.mail.protection.outlook.com (10.167.16.231) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7181.14 via Frontend Transport; Fri, 12 Jan 2024 08:28:48 +0000 Received: ("Tessian outbound a064b9944658:v228"); Fri, 12 Jan 2024 08:28:48 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: 3e8ac40d6b47eb4c X-CR-MTA-TID: 64aa7808 Received: from d1732e57c928.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id EADBEE1C-7945-4346-AC7E-56CD6CD1D335.1; Fri, 12 Jan 2024 08:28:40 +0000 Received: from EUR03-AM7-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id d1732e57c928.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Fri, 12 Jan 2024 08:28:40 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=HkXqNuCwFCScpoamJNg2o5FxHERxZdvHgb2gStewXNh/f2jlZYmknEgtAVZlUTcfBNbXkF596ESxJcHqosq8TCYxZotReVinKKSLIufWNOYrhILdUEN7oi/GtQpGaHY5xjV4WsOcTSnZNqOcn/nY6FVZmRRrD9cyEpd0qmqmG1k9Ci3M/f3qZRmTRLdMekmcptctYboTzg7e/XPtoVlJsesyQlA9SBC5PYuxRdTPGP5sM2diX5Gd+ld3PJsEhJVIJQ0CfyE1vpKYe+0Obxuvmnw6eD0lK7RRFgO+i//RsM15TCz9FxScWVB0myi+irhAgFBdiQguLeqxcLtvaHZIQg== 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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=EtZa6rEQXa/pP4RJYVgrCtEMVg4V7E+jRZs3XeE8xZc=; b=agJ0zO9hbt98UGm2fcSh0sPHTDOazNdlTWUVVz8I19OjFggkXsD5bOhrcqlxec6bMaH7rWMlzqiblyriy0mFKEqeyVEo5SbhA1dZC6Pev4GtBHF8jw28aAC7l6AzksMRaQTrKji+YWj+XUSiFpm2ZHRpvBizc1vAcYgjV8DdsMq6bo9tIpn4g5PlVdqD5pEqL/vLQcI1EYlhteiywnyQRGed4eA2Ij2y5pwLLmEFz49XnXV38ucwdFqH6C3+MJW/+5F8mnJFIM5n3D7LH3T/0GPiBFBfS+owOdwCFDdVRGXcr5oifVPTLK4IX+GVhvhXx6HHWC1EOQOrMdLD/2ZigA== 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=armh.onmicrosoft.com; s=selector2-armh-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=EtZa6rEQXa/pP4RJYVgrCtEMVg4V7E+jRZs3XeE8xZc=; b=1Jznw/tPTsvzG2nSyPjU8IcP1FXuAJ6oBHxmlC+8ye8naOPweFSDUjN8BWnXMNn1qiU+08JQG0sORV3aaDud3KHzpLwzzMWLccq3mEnUsIzzb2CAs1OdHMuiSMVfhsW7kjL5xsMd3+MG1zba/0R+UNpDd7QFDK2rw/2/rRih28s= 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 AM8PR08MB5827.eurprd08.prod.outlook.com (2603:10a6:20b:1da::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7181.21; Fri, 12 Jan 2024 08:28:38 +0000 Received: from VI1PR08MB5325.eurprd08.prod.outlook.com ([fe80::810c:8495:3f0a:ef8]) by VI1PR08MB5325.eurprd08.prod.outlook.com ([fe80::810c:8495:3f0a:ef8%6]) with mapi id 15.20.7181.020; Fri, 12 Jan 2024 08:28:38 +0000 Date: Fri, 12 Jan 2024 08:28:34 +0000 From: Tamar Christina To: gcc-patches@gcc.gnu.org Cc: nd@arm.com, rguenther@suse.de, jlaw@ventanamicro.com Subject: [PATCH]middle-end: remove more usages of single_exit Message-ID: Content-Disposition: inline X-ClientProxiedBy: LO2P123CA0073.GBRP123.PROD.OUTLOOK.COM (2603:10a6:600:138::6) To VI1PR08MB5325.eurprd08.prod.outlook.com (2603:10a6:803:13e::17) MIME-Version: 1.0 X-MS-TrafficTypeDiagnostic: VI1PR08MB5325:EE_|AM8PR08MB5827:EE_|AMS0EPF000001A1:EE_|PAVPR08MB8967:EE_ X-MS-Office365-Filtering-Correlation-Id: 09951070-1e08-4c55-5d9e-08dc13487fe6 x-checkrecipientrouted: true NoDisclaimer: true X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: tXD4qGh6+RYbMtyiXfMCuSZ02D2gwQvxzQUiVFh4NL1YJdXJWlEKha5AvxBku+UlCjGDAiT7K4/LNPmyBD1tmvfKHSDnZiOp/ljewAFUD1F3zer/ZayLeAkfLJoXV8g9fDQ7NNdERIUR9dE5geNlbt8Ik2I4UHykmISAuUWRBGgOmrgvXKg3TvadvB3Ko8XZOi63vejaG9QoMpsfkMAUxUsJeT/QzUWaGr9gMay3yO6/PkHH3W3OYF8PO+YHYjLJ+dUeFsixd3aks+ZrnIYeQPdg+udL+v/U14VV4WBX/AUTY6sL6zIofOxudyqPnRF48Pf7/13auu9RVn41yZjYg0w9iVp3WWlWEcKFUsKorw5VVUC0G9qfBGMhkQWLysnsLsE9TKygmi6trh/9l/es6q8w2SHFBaMyX+YNemIrjlFCJ+gwABejXjs/sLcMwJ3jIc5F63oVHETTSeLjz8U2WrwyYPOn06MWG68/+78/yJsiV9FFp2rXFMvfCnOO1sr7WmeW1N7OWlnUVGUO7iAAByoHmSq3g6mMCcW4+3zC3+BFUZckzETC3u0rx4iFD0eSmw3gog1YWZqK5cSeafhHmwpwPkMHjhYuE53vpgkTQJQhHjlWsnFamutHxxGau9KNAF+UD5dCpTL8ctvue59l+w== 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:(13230031)(366004)(39860400002)(136003)(376002)(346002)(396003)(230922051799003)(451199024)(64100799003)(1800799012)(186009)(86362001)(66946007)(66556008)(66476007)(478600001)(6666004)(6486002)(6506007)(38100700002)(2616005)(4743002)(26005)(6512007)(4326008)(33964004)(8676002)(44832011)(6916009)(316002)(8936002)(44144004)(83380400001)(36756003)(235185007)(5660300002)(41300700001)(2906002)(4216001)(2700100001); DIR:OUT; SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM8PR08MB5827 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-Transport-CrossTenantHeadersStripped: AMS0EPF000001A1.eurprd05.prod.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: 4359fb09-4b09-4faa-678b-08dc134879e4 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: y9FQ+NtN5juOX5uyvBUyrvlI0VeM21YWOwOowzJlCMIUm3BUif5Mm0rX1PJ4hzMBqSDNETCASVkeQ2czpIKRh6ga9cWa2P6EfbEG+FarWUJCR+pVPA6hWdY3rutsybywo1IllJ+RrkcdKebDjc/9BBMaaDrwiDUruSli67FChjA7ymY996d2Ytnx0bnEYa15O2ykJhL1lWROo/tYoBpfzCV/E7ShkefAF+vRcmuBjiVVg2WL54rMv4eXgg685Dw+XtZSKE533dHbB8153fJjmGtJBnCjtJCxmhfMjD7GPRfLAQvKeGpMLUNz70n+kiqt8XuB/R9uXx/OdoIg7716XMla67Gc95ebHEgNbKN5a3l+JrQ6MfE3hh4ZX2XEoHEmtzNIEFDzfZAUYCOqlD9xufskLDBFb2CABRhy3IyaKzV0IdpKgyu1MkyL5XkNuAYVrxBeKW29orMs6boEbQ35FCKbVqhhGOJJpPSuYmlg/vRlFkW1IcnFUgG8BNWo8mVsdhS0//Vqw8WepGEEmBQE/OhC74f2hyP8Sq7UcU6T+NM3WPNWsXJfWgtKykaa9RbO1hKOyhvTdrg70d8N8lMP70rMvKlbOmrtORozkRlVK11N3c9lwGN2kTr7uXERfcPtPOX64ZheyU7HUPpt5RHzYE7n/zLpQJRmpRy6gaqdnoLI0/SloQQumricS0CYH56pD0SZrkHg2goiACBKtATjkX1C2c2hTvhgJ98ENSrBXXEjmaXShEwMjhfalz+uvTjKt2AS3s8fuBOI43xoAt90P4m4jarISCBflVYC1dmPAHQ= 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:(13230031)(4636009)(396003)(346002)(39860400002)(376002)(136003)(230922051799003)(82310400011)(186009)(451199024)(64100799003)(1800799012)(36840700001)(40470700004)(46966006)(8936002)(36860700001)(478600001)(33964004)(6666004)(316002)(44144004)(8676002)(6916009)(70206006)(6486002)(336012)(4743002)(47076005)(70586007)(26005)(6512007)(107886003)(6506007)(83380400001)(41300700001)(4326008)(235185007)(44832011)(5660300002)(2906002)(2616005)(36756003)(82740400003)(356005)(81166007)(40480700001)(86362001)(40460700003)(4216001)(2700100001); DIR:OUT; SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Jan 2024 08:28:48.3519 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 09951070-1e08-4c55-5d9e-08dc13487fe6 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: AMS0EPF000001A1.eurprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAVPR08MB8967 X-Spam-Status: No, score=-12.4 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, GIT_PATCH_0, KAM_DMARC_NONE, KAM_LOTSOFHASH, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_NONE, TXREP, T_SCC_BODY_TEXT_LINE, UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org Hi All, This replaces two more usages of single_exit that I had missed before. They both seem to happen when we re-use the ifcvt scalar loop for versioning. The condition in versioning is the same as the one for when we don't re-use the scalar loop. I hit these during an LTO enabled bootstrap now. Bootstrapped Regtested on aarch64-none-linux-gnu with lto enabled and no issues. Ok for master? Thanks, Tamar gcc/ChangeLog: * tree-vect-loop-manip.cc (vect_loop_versioning): Replace single_exit. * tree-vect-loop.cc (vect_transform_loop): Likewise. --- inline copy of patch -- diff --git a/gcc/tree-vect-loop-manip.cc b/gcc/tree-vect-loop-manip.cc index 0931b18404856f6c33dcae1ffa8d5a350dbd0f8f..0d8c90f69e9693d5d25095e799fbc17a9910779b 100644 --- diff --git a/gcc/tree-vect-loop-manip.cc b/gcc/tree-vect-loop-manip.cc index 0931b18404856f6c33dcae1ffa8d5a350dbd0f8f..0d8c90f69e9693d5d25095e799fbc17a9910779b 100644 --- a/gcc/tree-vect-loop-manip.cc +++ b/gcc/tree-vect-loop-manip.cc @@ -4051,7 +4051,16 @@ vect_loop_versioning (loop_vec_info loop_vinfo, basic_block preheader = loop_preheader_edge (loop_to_version)->src; preheader->count = preheader->count.apply_probability (prob * prob2); scale_loop_frequencies (loop_to_version, prob * prob2); - single_exit (loop_to_version)->dest->count = preheader->count; + /* When the loop has multiple exits then we can only version itself. + This is denoted by loop_to_version == loop. In this case we can + do the versioning by selecting the exit edge the vectorizer is + currently using. */ + edge exit_edge; + if (loop_to_version == loop) + exit_edge = LOOP_VINFO_IV_EXIT (loop_vinfo); + else + exit_edge = single_exit (loop_to_version); + exit_edge->dest->count = preheader->count; LOOP_VINFO_SCALAR_LOOP_SCALING (loop_vinfo) = (prob * prob2).invert (); nloop = scalar_loop; diff --git a/gcc/tree-vect-loop.cc b/gcc/tree-vect-loop.cc index da2dfa176ecd457ebc11d1131302ca15d77d779d..eccf0953bbae2a0e95efba0966c85492e5057b14 100644 --- a/gcc/tree-vect-loop.cc +++ b/gcc/tree-vect-loop.cc @@ -11910,8 +11910,7 @@ vect_transform_loop (loop_vec_info loop_vinfo, gimple *loop_vectorized_call) (LOOP_VINFO_SCALAR_LOOP_SCALING (loop_vinfo)); scale_loop_frequencies (LOOP_VINFO_SCALAR_LOOP (loop_vinfo), LOOP_VINFO_SCALAR_LOOP_SCALING (loop_vinfo)); - single_exit (LOOP_VINFO_SCALAR_LOOP (loop_vinfo))->dest->count - = preheader->count; + LOOP_VINFO_SCALAR_IV_EXIT (loop_vinfo)->dest->count = preheader->count; } if (niters_vector == NULL_TREE) --- a/gcc/tree-vect-loop-manip.cc +++ b/gcc/tree-vect-loop-manip.cc @@ -4051,7 +4051,16 @@ vect_loop_versioning (loop_vec_info loop_vinfo, basic_block preheader = loop_preheader_edge (loop_to_version)->src; preheader->count = preheader->count.apply_probability (prob * prob2); scale_loop_frequencies (loop_to_version, prob * prob2); - single_exit (loop_to_version)->dest->count = preheader->count; + /* When the loop has multiple exits then we can only version itself. + This is denoted by loop_to_version == loop. In this case we can + do the versioning by selecting the exit edge the vectorizer is + currently using. */ + edge exit_edge; + if (loop_to_version == loop) + exit_edge = LOOP_VINFO_IV_EXIT (loop_vinfo); + else + exit_edge = single_exit (loop_to_version); + exit_edge->dest->count = preheader->count; LOOP_VINFO_SCALAR_LOOP_SCALING (loop_vinfo) = (prob * prob2).invert (); nloop = scalar_loop; diff --git a/gcc/tree-vect-loop.cc b/gcc/tree-vect-loop.cc index da2dfa176ecd457ebc11d1131302ca15d77d779d..eccf0953bbae2a0e95efba0966c85492e5057b14 100644 --- a/gcc/tree-vect-loop.cc +++ b/gcc/tree-vect-loop.cc @@ -11910,8 +11910,7 @@ vect_transform_loop (loop_vec_info loop_vinfo, gimple *loop_vectorized_call) (LOOP_VINFO_SCALAR_LOOP_SCALING (loop_vinfo)); scale_loop_frequencies (LOOP_VINFO_SCALAR_LOOP (loop_vinfo), LOOP_VINFO_SCALAR_LOOP_SCALING (loop_vinfo)); - single_exit (LOOP_VINFO_SCALAR_LOOP (loop_vinfo))->dest->count - = preheader->count; + LOOP_VINFO_SCALAR_IV_EXIT (loop_vinfo)->dest->count = preheader->count; } if (niters_vector == NULL_TREE)