From patchwork Mon Nov 6 07:38:48 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tamar Christina X-Patchwork-Id: 161850 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:8f47:0:b0:403:3b70:6f57 with SMTP id j7csp2495885vqu; Sun, 5 Nov 2023 23:39:42 -0800 (PST) X-Google-Smtp-Source: AGHT+IHRI4R+H7lTHt5IRJodqhRjctQGp+AzlRvy6mrGh5+mNfQPeRwTOgiBsmKLWIsNq/Y2qY0E X-Received: by 2002:a05:6102:10cf:b0:44e:9614:39bf with SMTP id t15-20020a05610210cf00b0044e961439bfmr25035307vsr.6.1699256382221; Sun, 05 Nov 2023 23:39:42 -0800 (PST) ARC-Seal: i=4; a=rsa-sha256; t=1699256382; cv=pass; d=google.com; s=arc-20160816; b=E5rIp7C62s5TGBeJalK+3tXGbs+nmlUK9PTW1x9jxIh98tcvvqv5kmluJh8W7lwIiH 4DYhvKMDjaQidzHne26JHHg7/HQilvFJwQvjm3YCVsDN71e6M4d0YiJ0bG/JtBYTgenX PBrZq3bIfbNQhYLeNz+B+Yzl8QCA41JIWJ+zsAjXZrwUC+c5B3+xmQ8CWmvAF1tNnnRs pstIo0D8xn5Vos7BFYAnDzpQPa7OW1H4Afq82rREuXtnD3jOlZaezrHBv/jrf1jBDWUa C32F0+V/MfgnUKPzmNy+Ze0q8n0mB0lkznfUqf3V8EcnKxo1p7npMuMESQwE/kUn9ZtK 0Tww== ARC-Message-Signature: i=4; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:original-authentication-results :nodisclaimer:mime-version:in-reply-to:content-disposition :message-id:subject:cc:to:from:date:authentication-results-original :dkim-signature:dkim-signature:arc-filter:dmarc-filter:delivered-to; bh=7ziY4TUX1FW4iVDfNiuziXdNTM3bAc76uhENxcJHngE=; fh=6lLuKcPp5JwcfhLsQ40FQN1vJS1KxlKbf2GiViQwbCM=; b=f4T5NlUY7pSH2xmfgsl+NYsx0heL13sN5uYkjYmPd8xtkjkvSZa8/K7byFQRJ3Rv6Y TLQ2XeedxD2abqbOInsYbt8mGVb6pmBRgcKU+MRdRiabyAWYE3UF34mOiGc9HnFsNfRt YQhTMVzh5hjz9N0ZVdJ6M96tUF1kF1oRW5y6YYA6w/eTjdu5AZULnxcLK2oCuocvp8Zn RKUbjmtVUFUzu3BRlK4/iagPhM+/QCtsoUYEEmZwZsRrQqdzG4OrnJmMgpMh++DLkgju 0FYyuCYxQ6BOxVv5qPk5B9gG4T+dxhTBpds4liTB60vju6ibvyYJ80Hcj7aB4MpqNb6t FCLQ== ARC-Authentication-Results: i=4; mx.google.com; dkim=pass header.i=@armh.onmicrosoft.com header.s=selector2-armh-onmicrosoft-com header.b=wWP4Jx+p; dkim=pass header.i=@armh.onmicrosoft.com header.s=selector2-armh-onmicrosoft-com header.b=wWP4Jx+p; arc=pass (i=3); spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: from server2.sourceware.org (server2.sourceware.org. [2620:52:3:1:0:246e:9693:128c]) by mx.google.com with ESMTPS id h5-20020a05622a170500b00418114c96e8si4990078qtk.390.2023.11.05.23.39.42 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 05 Nov 2023 23:39:42 -0800 (PST) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) client-ip=2620:52:3:1:0:246e:9693:128c; Authentication-Results: mx.google.com; dkim=pass header.i=@armh.onmicrosoft.com header.s=selector2-armh-onmicrosoft-com header.b=wWP4Jx+p; dkim=pass header.i=@armh.onmicrosoft.com header.s=selector2-armh-onmicrosoft-com header.b=wWP4Jx+p; arc=pass (i=3); spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 374623861805 for ; Mon, 6 Nov 2023 07:39:32 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from EUR05-VI1-obe.outbound.protection.outlook.com (mail-vi1eur05on2073.outbound.protection.outlook.com [40.107.21.73]) by sourceware.org (Postfix) with ESMTPS id 329F6385B527 for ; Mon, 6 Nov 2023 07:39:04 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 329F6385B527 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 329F6385B527 Authentication-Results: server2.sourceware.org; arc=pass smtp.remote-ip=40.107.21.73 ARC-Seal: i=3; a=rsa-sha256; d=sourceware.org; s=key; t=1699256345; cv=pass; b=NMLPY+iIFcotwM/sHYIiRWnbodOnL75M6Z3eYR4aNUUJQWeRWZdVxScwxBLEnT1rVJDSiJGu+vBji4U+wR4rPSx9okeclXPRhNWCROMySYCNoUBMD11H/RO27yugQhGVy96J4ZGsgye4yMgXQz3dcwnwxA3+Vbe8A1Q7VzcFMCQ= ARC-Message-Signature: i=3; a=rsa-sha256; d=sourceware.org; s=key; t=1699256345; c=relaxed/simple; bh=phcHmyZJ4atexRXf24huGLZ3RpTV/b14yLLpZ+g/lFs=; h=DKIM-Signature:DKIM-Signature:Date:From:To:Subject:Message-ID: MIME-Version; b=mpkzjsoM8iLsWYtt8D6u8H21bPfMZ33YDI+mo5KuLOeQGZftg8L20XZHLMBE+6BQ/YfW5yeXdO09+z3bxu+BMM/h8f2uAHvJHFp+K+/jNauNFDh4WawdHoDTMypS/ZG8i+0+Sn/Oze3ZdMSlYUpY2k83TDhOV/ntMffH/W4TCPs= ARC-Authentication-Results: i=3; server2.sourceware.org ARC-Seal: i=2; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=pass; b=Jfa6bN2eXZ4NYlpsWwgFN2QTCJCT80cPExJFz3eZBf1mtSCGHepsd/u0ZiEyvZu1jId//RfVtA2VVfI+6CjRrlptrfNq2Rqz6GyGxNiELzhfvO3rkIv3HN2NEP2AGNjNZ5Ce1c5n/S7WqxcjGM+eRF+qP/cflc0A8aidfgPD6UANjUA1atYJA/sn9k5o9PBEeBMYe0rFezmipAjDVyUTlrxMLaxuikT3qEV+wRamnu4CZMHmhFaocTy/LLJmsf/W/Ee3wCLRmN6UTSI/xaNjQLBYaeLT1vs2h2TSfzzmYz9eS9HNg7sRNbr3zghDkb3OlHi7uxT3hNM6y99kN2uMYA== 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=7ziY4TUX1FW4iVDfNiuziXdNTM3bAc76uhENxcJHngE=; b=SvP5zHZHMoGTDFY2Rz3lHiv52tUVBOhG6MTK1FDrDQRNF8Ml/w2sQzz8R3+xfbJBY2ZSyBTUzgCTw725SyY5mBraaS8vwfcX4qCs6ecxP177pB+E3w//19BK7ArJVx8z0rOiixuxQ0f79KzXIcSOkQvIif10ZEn0Ign2QQZAT1MIXMxGBg4GvegWMD0KojDofFo2jHOvekuBePCDVkt+xW9Ad+xdIcASZLn5QZJWfKP09v50wvjQP10lw2vz91hsnyKW9POtLFGT0ZWEv6V4YyFAz+aSnD7ku+ZrW8nXmPrX7f936m7L2UEWXUVR54r9PKiUtOPTdVKijncCcxM08A== 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=7ziY4TUX1FW4iVDfNiuziXdNTM3bAc76uhENxcJHngE=; b=wWP4Jx+pWTgtWeqIqsJ9AnY4EiitK8eDEk7W0pcS0iWOU2Ga4JzkmTDswf7uI7zKSilriOVS2zJMl737gWrHuKdYdp4YAEyL0v+PRKPgwLErOEqFdNPPWt21W52GyPlkBGa0HDcQJs70Tbwi7DIE/SSQtkR4j53m9AGnu689Imo= Received: from AS9PR0301CA0027.eurprd03.prod.outlook.com (2603:10a6:20b:468::14) by DU0PR08MB8277.eurprd08.prod.outlook.com (2603:10a6:10:40f::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6954.27; Mon, 6 Nov 2023 07:39:00 +0000 Received: from AMS0EPF0000019B.eurprd05.prod.outlook.com (2603:10a6:20b:468:cafe::62) by AS9PR0301CA0027.outlook.office365.com (2603:10a6:20b:468::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6954.28 via Frontend Transport; Mon, 6 Nov 2023 07:39:00 +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 AMS0EPF0000019B.mail.protection.outlook.com (10.167.16.247) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6977.16 via Frontend Transport; Mon, 6 Nov 2023 07:38:59 +0000 Received: ("Tessian outbound 7c4ecdadb9e7:v228"); Mon, 06 Nov 2023 07:38:59 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: ecd80d22cb35bdfa X-CR-MTA-TID: 64aa7808 Received: from aed9e43d25dd.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id AE4B95F3-81D9-4F1A-BF72-27888E7E1F89.1; Mon, 06 Nov 2023 07:38:53 +0000 Received: from EUR04-VI1-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id aed9e43d25dd.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Mon, 06 Nov 2023 07:38:53 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=bJpli5MhdnSd8sjg1Eaeygcq7NEuSj4+MLxo4qneYqxsfevoYygEiF7ZmKETB3t8MZIK3THZt5GkFiuza+v9ijnxdyr93h/KmTMd/U0BGMaasRZCn62KSlTOLmkFLx08uavyAayICd6AM57zZM9bNH38V83074vIUyFBuQfYfl42MfhM4Dz6uf6DLRBYO3VaYY7/YUiUG0Y5404v/te424h3r8igC5r2dISSW5hJLnetDE7eLfgesJV6gpEIRYYisnP414EOpR98lgCBfoSy/dbsKi8uq4ewygHoZDIVLsP9lXx6Y2/Fk3PXtlumkskJaTS5mT6I4PIG0i/l2Lpabw== 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=7ziY4TUX1FW4iVDfNiuziXdNTM3bAc76uhENxcJHngE=; b=IeBaoy39Pqtf/MW8BUFOfnsgBatIsd7eXMdY/0YO+A5SB7SPxiT6LC2n8qvP4ysJLYd6oLUdve2qsOhe7vXQxclVgtCRusJOC7TgCkaW+H4fxAsOmCtLZ5fWBGULDYFUI7f1UlB99lp2JIc8PJmaEHm2Z/1cmqriynlWbuZJi1oBPi6qRh6vBYdGwn7ikGv3azubRI2KYtcOdk5xbwB1iWx4nE66HxpfLKMSWUQ2VLYYu6MnatbHQIkXJUkU64dteCQlq82SH8g8iPpz4blRxQIgxuCBxlz10Pop2i/DEzeuiyYsrU6PEb1X7pSB8EdUVE6YPny8zPD4Tuh1GwISuQ== 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=7ziY4TUX1FW4iVDfNiuziXdNTM3bAc76uhENxcJHngE=; b=wWP4Jx+pWTgtWeqIqsJ9AnY4EiitK8eDEk7W0pcS0iWOU2Ga4JzkmTDswf7uI7zKSilriOVS2zJMl737gWrHuKdYdp4YAEyL0v+PRKPgwLErOEqFdNPPWt21W52GyPlkBGa0HDcQJs70Tbwi7DIE/SSQtkR4j53m9AGnu689Imo= 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 DBBPR08MB10676.eurprd08.prod.outlook.com (2603:10a6:10:530::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6954.28; Mon, 6 Nov 2023 07:38:50 +0000 Received: from VI1PR08MB5325.eurprd08.prod.outlook.com ([fe80::26aa:efdd:a74a:27d0]) by VI1PR08MB5325.eurprd08.prod.outlook.com ([fe80::26aa:efdd:a74a:27d0%5]) with mapi id 15.20.6954.028; Mon, 6 Nov 2023 07:38:50 +0000 Date: Mon, 6 Nov 2023 07:38:48 +0000 From: Tamar Christina To: gcc-patches@gcc.gnu.org Cc: nd@arm.com, rguenther@suse.de, jlaw@ventanamicro.com Subject: [PATCH 6/21]middle-end: support multiple exits in loop versioning Message-ID: Content-Disposition: inline In-Reply-To: X-ClientProxiedBy: LO4P265CA0197.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:318::13) To VI1PR08MB5325.eurprd08.prod.outlook.com (2603:10a6:803:13e::17) MIME-Version: 1.0 X-MS-TrafficTypeDiagnostic: VI1PR08MB5325:EE_|DBBPR08MB10676:EE_|AMS0EPF0000019B:EE_|DU0PR08MB8277:EE_ X-MS-Office365-Filtering-Correlation-Id: 29722a9b-1bce-4aef-c421-08dbde9b70a6 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: ddsChMg6vcKx+mMXitjL+MHAZvCfDikWHLZEUZhZyLeKp6j6ouicBwVU9QuTfZmtEzcr1o6G/c+TaKqjuXef3XF23zNzBI1f/aAFP6i50CsPCjZdAD+bKD58ohm7A8Dax4kyFz3oqzf7pZu7TFtY/n4XBILcmRJlHrczUXxtGMUjv2xfvNi2VPHPAmdD/SkZrAb5BVuymRMewngAtXwoEa+Sf3Owf2s/jnAKEXQziRN81ps0Kxyfy+YGPHyp6+9kWeApwxHygTCo9gMgjeqbHk0WmKdp7dVY3Kpr6t5jUO1s0XdltlrWVrnA1yPbn6/YgopELLfOv/7JhZ3zD1Gi4UZPOCznLFE+qmjdElhKW4/pXdFvLSpg1+Xk4Xf02g9YfU5kgT+iLwXXVmFfXcfh9OEMsXG31yNef5ZO9Xuq169yut896JKXf0HfhdqN7k7MXOAFnV7WfiQtcl3YmN2SXeB3NlSMZpH1a8+srgKzc+Q3kPh05dmDeJWr2qpAbeoPc79IkNcwbOj/0yZBxt+m5eHwNiF6VIrdr3Na5uYLRbEeE7GnGlr+TrSCMg2vAranlsgJJgjkXiHvtxDhL7I2LbCRO45Ctu7d/9jFsyjUj0Xd7OLqEdINI8/JF95X/aDS 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)(136003)(396003)(376002)(366004)(346002)(39860400002)(230922051799003)(186009)(64100799003)(1800799009)(451199024)(6916009)(4326008)(8676002)(8936002)(41300700001)(36756003)(2906002)(235185007)(38100700002)(5660300002)(6486002)(66556008)(6512007)(316002)(66476007)(86362001)(44832011)(4743002)(66946007)(83380400001)(26005)(2616005)(6506007)(478600001)(33964004)(44144004)(2700100001); DIR:OUT; SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: DBBPR08MB10676 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: AMS0EPF0000019B.eurprd05.prod.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: 95f36836-03d8-4a50-0def-08dbde9b6b65 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: UXIVmf6b3linUc7nR/FvpmwTjKmeAYFvLQN4ImJMQp8dHH7FV1M1+tt4R/O4NCcM2U6j5VGGqQp7sARKFdGo1jblB/OYAVecOdbbwfnFdRCV1b0zSC5DRUjKkeewfHUMEmZunlh4i/D85E5w3RsqODxA8DR0eLfgHcsDbhojSu1c9xJncQWRnDYJwL8WTz54XMxzkjRUU5vcL3UtnM9TIyOIRIu6t5E8jSP3q3rBEtaP+fDeDCUqCMrxdquHxS0x3PkRS8IBtnnFsZdUN+WqS7di4ZMjaNKBhn8h2kWK41BTPzxtgnGHo7ZzEnzVKLL5Sy+0ZSrq/gGI0ZW6AFKSvHyligWVl6CrjWxCqORxZg2j3nuvy0ScaUgdozHJOZBxJdt1SXILV2l7wXyjbDqQG05wSpvemWRVBianZEZh7V5Xllz3CErw4mC6zfy7sh1RRoxWGIjckMQjcRUyhd6c2DOLYGCpojG/WY5ucPAcOSyW3dayIau7ZJH5xlrucZJNepm+/i7jBKKxrcld1yNkl33jj3IkWr/kij997sWLJcON8k3pDTuySKcSFg4Ys7+wFqNdVus2K1wUoc+KT0lyeVW0HFfjIRmLj506sdGo5ip3ZZgaTPnxqziwW78oPFu0FiC+WIOlV20RTYQIng6uzDM6XvXWIoPutJrY63l3okWnV2EPjK1SSI0qOHK9LRMxqsycv2tyWCJKtMY+DT4GyPin1JS5NKrjsq+S2leO/vNdxgJ3X/OnNXiHZxJa8fOXfLQkqQP1PccuE1BXGY5l9A== 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)(346002)(396003)(39860400002)(376002)(136003)(230922051799003)(451199024)(64100799003)(1800799009)(186009)(82310400011)(46966006)(36840700001)(40470700004)(40460700003)(40480700001)(6512007)(33964004)(6486002)(478600001)(2616005)(44144004)(6506007)(2906002)(36860700001)(36756003)(81166007)(86362001)(356005)(82740400003)(235185007)(5660300002)(41300700001)(47076005)(83380400001)(26005)(336012)(107886003)(4743002)(44832011)(316002)(6916009)(70206006)(8936002)(4326008)(8676002)(70586007)(2700100001); DIR:OUT; SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Nov 2023 07:38:59.3706 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 29722a9b-1bce-4aef-c421-08dbde9b70a6 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: AMS0EPF0000019B.eurprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU0PR08MB8277 X-Spam-Status: No, score=-12.1 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, FORGED_SPF_HELO, GIT_PATCH_0, KAM_DMARC_NONE, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_HELO_PASS, 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+ouuuleilei=gmail.com@gcc.gnu.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1781799460414209942 X-GMAIL-MSGID: 1781799460414209942 Hi All, This has loop versioning use the vectorizer's IV exit edge when it's available since single_exit (..) fails with multiple exits. Bootstrapped Regtested on aarch64-none-linux-gnu and no issues. Ok for master? Thanks, Tamar gcc/ChangeLog: * tree-vect-loop-manip.cc (vect_loop_versioning): Support multiple exits. --- inline copy of patch -- diff --git a/gcc/tree-vect-loop-manip.cc b/gcc/tree-vect-loop-manip.cc index 3d59119787d6afdc5a6465a547d1ea2d3d940373..58b4b9c11d8b844ee86156cdfcba7f838030a7c2 100644 --- diff --git a/gcc/tree-vect-loop-manip.cc b/gcc/tree-vect-loop-manip.cc index 3d59119787d6afdc5a6465a547d1ea2d3d940373..58b4b9c11d8b844ee86156cdfcba7f838030a7c2 100644 --- a/gcc/tree-vect-loop-manip.cc +++ b/gcc/tree-vect-loop-manip.cc @@ -4180,12 +4180,24 @@ vect_loop_versioning (loop_vec_info loop_vinfo, If loop versioning wasn't done from loop, but scalar_loop instead, merge_bb will have already just a single successor. */ - merge_bb = single_exit (loop_to_version)->dest; + /* Due to the single_exit check above we should only get here when + loop == loop_to_version, that means we can use loop_vinfo to get the + exits. */ + edge exit_edge = single_exit (loop_to_version); + if (LOOP_VINFO_EARLY_BREAKS (loop_vinfo)) + { + /* In early exits the main exit will fail into the merge block of the + alternative exits. So we need the single successor of the main + exit here to find the merge block. */ + exit_edge = LOOP_VINFO_IV_EXIT (loop_vinfo); + } + gcc_assert (exit_edge); + merge_bb = exit_edge->dest; if (EDGE_COUNT (merge_bb->preds) >= 2) { gcc_assert (EDGE_COUNT (merge_bb->preds) >= 2); - new_exit_bb = split_edge (single_exit (loop_to_version)); - new_exit_e = single_exit (loop_to_version); + new_exit_bb = split_edge (exit_edge); + new_exit_e = exit_edge; e = EDGE_SUCC (new_exit_bb, 0); for (gsi = gsi_start_phis (merge_bb); !gsi_end_p (gsi); --- a/gcc/tree-vect-loop-manip.cc +++ b/gcc/tree-vect-loop-manip.cc @@ -4180,12 +4180,24 @@ vect_loop_versioning (loop_vec_info loop_vinfo, If loop versioning wasn't done from loop, but scalar_loop instead, merge_bb will have already just a single successor. */ - merge_bb = single_exit (loop_to_version)->dest; + /* Due to the single_exit check above we should only get here when + loop == loop_to_version, that means we can use loop_vinfo to get the + exits. */ + edge exit_edge = single_exit (loop_to_version); + if (LOOP_VINFO_EARLY_BREAKS (loop_vinfo)) + { + /* In early exits the main exit will fail into the merge block of the + alternative exits. So we need the single successor of the main + exit here to find the merge block. */ + exit_edge = LOOP_VINFO_IV_EXIT (loop_vinfo); + } + gcc_assert (exit_edge); + merge_bb = exit_edge->dest; if (EDGE_COUNT (merge_bb->preds) >= 2) { gcc_assert (EDGE_COUNT (merge_bb->preds) >= 2); - new_exit_bb = split_edge (single_exit (loop_to_version)); - new_exit_e = single_exit (loop_to_version); + new_exit_bb = split_edge (exit_edge); + new_exit_e = exit_edge; e = EDGE_SUCC (new_exit_bb, 0); for (gsi = gsi_start_phis (merge_bb); !gsi_end_p (gsi);