[14/21] middle-end: Change loop analysis from looking at at number of BB to actual cfg
Message ID | ZUiYlM8SDtLV3SaA@arm.com |
---|---|
State | Unresolved |
Headers |
Return-Path: <gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:8f47:0:b0:403:3b70:6f57 with SMTP id j7csp2520807vqu; Mon, 6 Nov 2023 00:49:11 -0800 (PST) X-Google-Smtp-Source: AGHT+IGgAK9Vp73MBttsHMgcUmQEHjyymndx24Xecjy5ESmQMQE5kiXommONF/AQJ+RHpAjglsd2 X-Received: by 2002:a05:622a:3d0:b0:418:110e:6179 with SMTP id k16-20020a05622a03d000b00418110e6179mr34084826qtx.1.1699260551396; Mon, 06 Nov 2023 00:49:11 -0800 (PST) ARC-Seal: i=4; a=rsa-sha256; t=1699260551; cv=pass; d=google.com; s=arc-20160816; b=0FRU2WgUarO/LIGC/N/NjqWeWYeFHP+BQR/8ClzZHMtELe9MjNjRIdX9snEJZX70tU LFOfvLu0iA5j8paKI4pzRccsKsg5bd5PGn7dsBWOeTjRetVqrosJr+Xw6o8uhnRmlwxd M0MklHNqv54kLU7TfsqnddnMiZ5GcS9HUi1EuMDok4PqCJALu1PrZgO3ow0KluK9sNWI ApFoYMW6b9gRYjJDdH0J+6oomuGVwo6CFPYYl5UKfYeLec+gtDzG9DyJaX8ZD3D6k2VX 1HDDU3NJ6u9GcfOj8DPgHJjtd19ejv+iNOnyjBup7ueHDYGN5YgV0fyZvVecTvsp+J1b WFMA== 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=1leiMgASWj+v7V8z34pYwWAztO7wBZHCS4Hl8l+hQiM=; fh=6lLuKcPp5JwcfhLsQ40FQN1vJS1KxlKbf2GiViQwbCM=; b=u95dNdJFF6bkf7s+X+fctei5efNU9qO5ZP3oacWcYwSUD+h/qZv2PHLjz3Z4P4G+AX ba58quOX+HhquaqXeZv7ZUSZebJ3N35QpsuJyE61ymC83zfw6BpwWl9pjdm2Rcw/pJat AoypUcLo3I5ZfJCdCkqDPDhLLHJ+xCoTExjxPIbZpfXJDfa4FZ1BfCreEpExOuyQHRru ZVrbV1uub/2FR9+00zifux8cJI8xbfHpSV+UKsGGLeWU11yyqbnujFJshdhQn8e1IQkA Btm5RdZFiOxGqq+Es3AEvQ72U1Wn+7dzrLECp6EggZdGFcCTWWf6rjNbTVov1TqpIwU/ Yqhg== ARC-Authentication-Results: i=4; mx.google.com; dkim=pass header.i=@armh.onmicrosoft.com header.s=selector2-armh-onmicrosoft-com header.b=dwaT7Dx4; dkim=pass header.i=@armh.onmicrosoft.com header.s=selector2-armh-onmicrosoft-com header.b=dwaT7Dx4; arc=pass (i=3); spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 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. [8.43.85.97]) by mx.google.com with ESMTPS id s6-20020ac85cc6000000b00417fa6502a2si5579754qta.387.2023.11.06.00.49.11 for <ouuuleilei@gmail.com> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 Nov 2023 00:49:11 -0800 (PST) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) client-ip=8.43.85.97; Authentication-Results: mx.google.com; dkim=pass header.i=@armh.onmicrosoft.com header.s=selector2-armh-onmicrosoft-com header.b=dwaT7Dx4; dkim=pass header.i=@armh.onmicrosoft.com header.s=selector2-armh-onmicrosoft-com header.b=dwaT7Dx4; arc=pass (i=3); spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 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 EF4AC38323D2 for <ouuuleilei@gmail.com>; Mon, 6 Nov 2023 07:42:04 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from EUR04-HE1-obe.outbound.protection.outlook.com (mail-he1eur04on2050.outbound.protection.outlook.com [40.107.7.50]) by sourceware.org (Postfix) with ESMTPS id 88B94385DC04 for <gcc-patches@gcc.gnu.org>; Mon, 6 Nov 2023 07:41:25 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 88B94385DC04 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 88B94385DC04 Authentication-Results: server2.sourceware.org; arc=pass smtp.remote-ip=40.107.7.50 ARC-Seal: i=3; a=rsa-sha256; d=sourceware.org; s=key; t=1699256487; cv=pass; b=BiPhDvHT/OQxe1iGY8SfwFh5XJJvXSF5V1/6gDAh9n6dugmDAXcTQXGktlj1d+wcjHkXpiCPw03/U6xiZM2U3dLnwjcCN+tz4I3OzEowhgsmlhxYDzYhDjgQuKvrNzT974ZPzz3cUk9rx74CPqgwpWb6MW//F2n9OBQrncm9miA= ARC-Message-Signature: i=3; a=rsa-sha256; d=sourceware.org; s=key; t=1699256487; c=relaxed/simple; bh=JePf+j4HQRRGbW6nPOShbyNWzjULqsGRJoa+/yz/g1o=; h=DKIM-Signature:DKIM-Signature:Date:From:To:Subject:Message-ID: MIME-Version; b=HS2xAd+41oPinEOfs6JM2YOKEqygYbzcdGArBCJmMnxQjGV4/HxJUvorP4zmRVf75OObObXJoMcToG3R2WIHKiRKZK+Rukk+14gLDEWi5tnM6bPnYvdTq8i4ItHqhWjSCG9IBRf/ohY9i8Yfpi6X3q5Dc7pO97AyFGa+vA5mAao= ARC-Authentication-Results: i=3; server2.sourceware.org ARC-Seal: i=2; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=pass; b=NmxqLkA57MH5Laf9ojgwOJz9VZQWa7N5XolZsYMZQ9XzfqJgrxc+00u7BpqBT8t0pfCPYozcUfkPC7SM7p++eLC5FzrFWuiG49ptzhPvQM2OxuOW4pFssgfxQ4OY3TANqjboDOUapn6MqKkvon/itwWOl6MKkTxdtQRwHeeM8haqMeKpdbTMSnL67dL3PDHoX4h0JqLDzJU3Ad+U82kPxi9AjvV1NW4mj2897sBVwiFiSUjj8gHIlFcdZbg+W9sDAi/HSbRgQlxbD4rlorgD7d3gYkTOGNc4UHf5A1k+dz42oTM/AyVVTOH99ArXnKStyd3PV/T+jI0soNgOBoqG0w== 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=1leiMgASWj+v7V8z34pYwWAztO7wBZHCS4Hl8l+hQiM=; b=PT79K6pG/zcAyyrnzxxSTosE+IwH7RD1RLwSA50mvEu5vFD2KJtafeiBoc7SV3tDMuvFJZmm8HGWh7yPNRgl0AotU7+pY0LcTm3NjQyo6Qxu6Ir5piwfSibTDKHsX4HfMWhUowTyewyFFx9HkeO83YRFVIfcFSo5AW73ugP4MQ9BlJmZZjlBuXEMJt9EF3ZsMC9tRqtzAaKnKvu8wsJFcig7LE1sRnd13DTFbivptW6R8448WK51aFCdjaQU/pWbcwn3cagiR5VsXm0AcaBfc0AB3sw0HpurtasEa0jtHVpwXiBlg16EhZdr+bH8FjR6Kk7nsrJnFb8ML25+dZ8iZg== 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=1leiMgASWj+v7V8z34pYwWAztO7wBZHCS4Hl8l+hQiM=; b=dwaT7Dx4xCSgPk4+Ztju3k3X7SoEX+F3fgQ8WN4bm4R8Cw0sFPuoz7wFlP6pG8sJ4mtr+7BSlpeerXt+OX6hcGjxwsrIGjeyyQ1DfQFDZIFEqM8Gqer6dpidv2ovmHBRgBN2/cue49X9TqoIAEHXkoPbgc0fUZmS+TeJo+BRv14= Received: from AM6PR0502CA0066.eurprd05.prod.outlook.com (2603:10a6:20b:56::43) by DU0PR08MB8066.eurprd08.prod.outlook.com (2603:10a6:10:3e9::9) 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:41:21 +0000 Received: from AMS0EPF000001B4.eurprd05.prod.outlook.com (2603:10a6:20b:56:cafe::e2) by AM6PR0502CA0066.outlook.office365.com (2603:10a6:20b:56::43) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6954.26 via Frontend Transport; Mon, 6 Nov 2023 07:41:21 +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 AMS0EPF000001B4.mail.protection.outlook.com (10.167.16.168) 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:41:21 +0000 Received: ("Tessian outbound 26ee1d40577c:v228"); Mon, 06 Nov 2023 07:41:20 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: a519f5adac8a9406 X-CR-MTA-TID: 64aa7808 Received: from 5bafbacdfb0b.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id D675501F-69C7-4371-B0C5-EC6732BA2CD7.1; Mon, 06 Nov 2023 07:41:14 +0000 Received: from EUR05-AM6-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 5bafbacdfb0b.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Mon, 06 Nov 2023 07:41:14 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=OplqmuMcVDxIlP2sBGcKgdZEUokwqT9pm+zT956EtY8f1w4HZHw36kmjvlP7R7eiRu3EulyTqptXKWKaWRFLyrvo2iRrlb3We0a6kiCUrEViLKzebSPH1SSbRbE92MqwwLrGRzSaDqsCZK3srhp0XqaKKAQi7H4pX8EJ1g8oXD9SZHTuZHvyfm7vpnX1o+79mpbPYiOlNcopS1WQ2Zh6Nfudd6PsBzKBj2rVyVH+uT4/d3X9WToZGZVJER5oXN+ZN5wfTEwWev9ZaHPHMnnRykfL1bnLZwkrTGbWkCbEi2vZL4F6cTr7YuAku6WBZ9pivcgZe5TdsQPBhH2c9R/IRg== 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=1leiMgASWj+v7V8z34pYwWAztO7wBZHCS4Hl8l+hQiM=; b=U5oR7Fs2CaHRp6HlHcjZlq6XyG7VX8EhCWFbScRLC2uTZKnSsQ8sZhpGwQYFBJ4GrJHIPhqJ/FcvdCQ70gfY7dEgaNpZokONvQH38G2MCfSSA1E8RtXNIqDtc8sBY+52K/BDFh/zQ5k9YJ9nrPH2AmlTnNIl05zSYTxN+G998HL9na3o903TzXljxGoQZTeoN0U6ER/xUbLsf0dDE3eyJ1M4d/OzDRs/WQCKnNTq9FZjTrCp9H+shNO8P/SPiopWuR81tp8g9n6geZSms5kJJza7g3+PiGISbkA9YzZ2kTNFu53WedRjsf+7WfV+P2XLjyM6ThyjQK+nx3KPzc4Qlw== 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=1leiMgASWj+v7V8z34pYwWAztO7wBZHCS4Hl8l+hQiM=; b=dwaT7Dx4xCSgPk4+Ztju3k3X7SoEX+F3fgQ8WN4bm4R8Cw0sFPuoz7wFlP6pG8sJ4mtr+7BSlpeerXt+OX6hcGjxwsrIGjeyyQ1DfQFDZIFEqM8Gqer6dpidv2ovmHBRgBN2/cue49X9TqoIAEHXkoPbgc0fUZmS+TeJo+BRv14= 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 DU0PR08MB9581.eurprd08.prod.outlook.com (2603:10a6:10:44b::18) 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:41:12 +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:41:12 +0000 Date: Mon, 6 Nov 2023 07:41:08 +0000 From: Tamar Christina <tamar.christina@arm.com> To: gcc-patches@gcc.gnu.org Cc: nd@arm.com, rguenther@suse.de, jlaw@ventanamicro.com Subject: [PATCH 14/21]middle-end: Change loop analysis from looking at at number of BB to actual cfg Message-ID: <ZUiYlM8SDtLV3SaA@arm.com> Content-Type: multipart/mixed; boundary="5l3RuqywHfFyjfz1" Content-Disposition: inline In-Reply-To: <patch-17494-tamar@arm.com> X-ClientProxiedBy: LO2P265CA0120.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:c::36) To VI1PR08MB5325.eurprd08.prod.outlook.com (2603:10a6:803:13e::17) MIME-Version: 1.0 X-MS-TrafficTypeDiagnostic: VI1PR08MB5325:EE_|DU0PR08MB9581:EE_|AMS0EPF000001B4:EE_|DU0PR08MB8066:EE_ X-MS-Office365-Filtering-Correlation-Id: b431eff9-70ce-4ddc-2b46-08dbde9bc525 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: d8oGHbcZO/PycNXhUcT6v0k9ZGbqGQ8/ao3oMj3lUqkg0JsA40ORx8+WPW8KlInX9++emvObBC8iI5uO0HjLvQPcaYDl/MEGY2wEeRkLP3mt39fWy5rQSyvmUdGlLQ+NQeTyYDwH7SMKVnpekXKmxktB9FRJx2mMRHee08iTljaAcGAqz2Bn5plZsXWyyKLjVifD79aetSjAUyjMQ6bhZC8BcYPIpiMz/nkJtxKxU1568/nb1tqjlALh3JbwYzddQhoa0keIKa03J7hjXgWU52Ou4+wKm8HtNBiyrLnE5woyz8xLeyJfLubOmj23A2cZ8cIOOPaUWipKQfN0/YpNbtrx4YGu5EVwIp2mh16cJZT3q7+DCmKNxHgV34KZ08jiZWsTso6aovYn4BZty4gupdHy9qQ37/mdupCRIs8yXQ4Rf9OeMeobKreGvPBNSH4Dh6jPWCF29OXXE7QaAYx+SgNH8T1AJwZ4HOg8yb/n0uwhzh+Kl0We+QoZbJyGULLnL8X/oaYlTmwl1H5SkvopSlxGXBh+qIBA/HNbULBGw2cVFdW/UpW/HdiSNSxlH8O2pTO1XqP7Ip6ENkuPV3fRUKaO88qwtf84DWALVVzDHvbudArqSYnYOZ/a83B6xX7C 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)(396003)(376002)(136003)(346002)(39860400002)(366004)(230922051799003)(64100799003)(451199024)(186009)(1800799009)(6506007)(478600001)(2616005)(44144004)(6512007)(6666004)(6486002)(33964004)(36756003)(38100700002)(86362001)(66946007)(5660300002)(235185007)(44832011)(316002)(66476007)(66556008)(41300700001)(4743002)(83380400001)(2906002)(26005)(8676002)(4326008)(6916009)(8936002)(2700100001); DIR:OUT; SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU0PR08MB9581 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: AMS0EPF000001B4.eurprd05.prod.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: 923150b4-01b2-4376-9155-08dbde9bbfb6 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: AnCrnWu++/iXXxosw9RKVmX2qzGzw+ccmPkdOO0azLVfn4m1xkKF0tfDW3Qy5uxl7xbyADld88mjU3/vuIcXfXq3XHuXfUukS6UJjWRsI0i7cSfFyZ9cbF1mfwashpLT6ShEj9zmtgU00RaScb1bi24TyXv4BN69HQcvnHFFXgAq9xnJSNH60/pU7BDUCrz8+Su/8IQaCg+tu5E70uePr0hdXCSzFNnQILVVEo5Jf29FuXxV/3Cdzq/Xpy9DxGP7M9plAVTBcPGYBnkn5tC6ZM72xr58md4ofcdVcLxtRiX3f/+6k2Y7aTiMV2YlF6rR19E/tm/+hvJI4Py5BWGoMvKCOrFv0OILQyH1N6F5Ronfr/s8Jj9+qGH8A4yNGp66g+jq5zqGrfu6yF5tBEZ8QxYfioCH2ikTalPWukZA5T03WfbGJ9+XdWDPp7Ozrn/sE7OQr+6qgmNnFCDtWwIRkKASTjqm5TqNPipQCGYlRZ3L6Z+KordcEZZvpW8y0nBFKs3Ft05UThyssZVTxSIqv9zhvyqWwQYIpjoYC/lcdrI+K+V45HbWT36oH2xeO9LUpzjwWVYp2GaGq7FPwFTVDkiZvi1BG1FQGXCKWDKreR/snIo0EYeMHu5vr2K88v7vcpAQk4cwBsMq8+3raj8lUjFAPt1Ogh/BdgayfhwNILvV6oHsYEWoA9w1ko9888RMb1skC6BMd3b154zRXD4OsTZWAlNmGoeV2qliLL95dwUBG9PbCyPuvxsxWOwigpnTxhqlCAJXDDH4USIwCeQrpA== 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)(39860400002)(396003)(136003)(376002)(230922051799003)(1800799009)(186009)(82310400011)(451199024)(64100799003)(36840700001)(40470700004)(46966006)(40460700003)(40480700001)(4743002)(41300700001)(33964004)(44144004)(336012)(6666004)(26005)(6512007)(2616005)(47076005)(6506007)(107886003)(81166007)(356005)(36756003)(82740400003)(86362001)(2906002)(235185007)(5660300002)(6486002)(44832011)(36860700001)(8936002)(83380400001)(4326008)(8676002)(316002)(70586007)(6916009)(70206006)(478600001)(2700100001); DIR:OUT; SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Nov 2023 07:41:21.1277 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: b431eff9-70ce-4ddc-2b46-08dbde9bc525 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: AMS0EPF000001B4.eurprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU0PR08MB8066 X-Spam-Status: No, score=-12.0 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, FORGED_SPF_HELO, GIT_PATCH_0, KAM_DMARC_NONE, KAM_LOTSOFHASH, 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 <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+ouuuleilei=gmail.com@gcc.gnu.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1781803832232843028 X-GMAIL-MSGID: 1781803832232843028 |
Series |
None
|
|
Checks
Context | Check | Description |
---|---|---|
snail/gcc-patch-check | warning | Git am fail log |
Commit Message
Tamar Christina
Nov. 6, 2023, 7:41 a.m. UTC
Hi All, The vectorizer at the moment uses a num_bb check to check for control flow. This rejects a number of loops with no reason. Instead this patch changes it to check the destination of the exits instead. This also allows early break to work by also dropping the single_exit check. Bootstrapped Regtested on aarch64-none-linux-gnu and no issues. Ok for master? Thanks, Tamar gcc/ChangeLog: * tree-vect-loop-manip.cc (slpeel_can_duplicate_loop_p): * tree-vect-loop.cc (vect_analyze_loop_form): --- inline copy of patch -- diff --git a/gcc/tree-vect-loop-manip.cc b/gcc/tree-vect-loop-manip.cc index 9c1405d79fd8fe8689007df3b7605b7a3d3ecdd7..466cf4c47154099a33dc63e22d74eef42d282444 100644 -- diff --git a/gcc/tree-vect-loop-manip.cc b/gcc/tree-vect-loop-manip.cc index 9c1405d79fd8fe8689007df3b7605b7a3d3ecdd7..466cf4c47154099a33dc63e22d74eef42d282444 100644 --- a/gcc/tree-vect-loop-manip.cc +++ b/gcc/tree-vect-loop-manip.cc @@ -1937,12 +1937,10 @@ slpeel_can_duplicate_loop_p (const class loop *loop, const_edge exit_e, edge entry_e = loop_preheader_edge (loop); gcond *orig_cond = get_loop_exit_condition (exit_e); gimple_stmt_iterator loop_exit_gsi = gsi_last_bb (exit_e->src); - unsigned int num_bb = loop->inner? 5 : 2; /* All loops have an outer scope; the only case loop->outer is NULL is for the function itself. */ if (!loop_outer (loop) - || loop->num_nodes != num_bb || !empty_block_p (loop->latch) || !exit_e /* Verify that new loop exit condition can be trivially modified. */ diff --git a/gcc/tree-vect-loop.cc b/gcc/tree-vect-loop.cc index ddb6cad60f2f2cfdc96732f3f256d86e315d7357..27ab6abfa854f14f8a4cf3d9fcb1ac1c203a4198 100644 --- a/gcc/tree-vect-loop.cc +++ b/gcc/tree-vect-loop.cc @@ -1727,6 +1727,17 @@ vect_analyze_loop_form (class loop *loop, vect_loop_form_info *info) "using as main loop exit: %d -> %d [AUX: %p]\n", exit_e->src->index, exit_e->dest->index, exit_e->aux); + /* Check if we have any control flow that doesn't leave the loop. */ + class loop *v_loop = loop->inner ? loop->inner : loop; + basic_block *bbs= get_loop_body (v_loop); + for (unsigned i = 0; i < v_loop->num_nodes; i++) + if (!empty_block_p (bbs[i]) + && !loop_exits_from_bb_p (v_loop, bbs[i]) + && bbs[i]->loop_father == v_loop) + return opt_result::failure_at (vect_location, + "not vectorized:" + " unsupported control flow in loop.\n"); + /* Different restrictions apply when we are considering an inner-most loop, vs. an outer (nested) loop. (FORNOW. May want to relax some of these restrictions in the future). */ @@ -1746,11 +1757,6 @@ vect_analyze_loop_form (class loop *loop, vect_loop_form_info *info) | (exit-bb) */ - if (loop->num_nodes != 2) - return opt_result::failure_at (vect_location, - "not vectorized:" - " control flow in loop.\n"); - if (empty_block_p (loop->header)) return opt_result::failure_at (vect_location, "not vectorized: empty loop.\n"); @@ -1782,11 +1788,6 @@ vect_analyze_loop_form (class loop *loop, vect_loop_form_info *info) "not vectorized:" " multiple nested loops.\n"); - if (loop->num_nodes != 5) - return opt_result::failure_at (vect_location, - "not vectorized:" - " control flow in loop.\n"); - entryedge = loop_preheader_edge (innerloop); if (entryedge->src != loop->header || !single_exit (innerloop) @@ -1823,9 +1824,6 @@ vect_analyze_loop_form (class loop *loop, vect_loop_form_info *info) info->inner_loop_cond = inner.conds[0]; } - if (!single_exit (loop)) - return opt_result::failure_at (vect_location, - "not vectorized: multiple exits.\n"); if (EDGE_COUNT (loop->header->preds) != 2) return opt_result::failure_at (vect_location, "not vectorized:"
Comments
On Mon, 6 Nov 2023, Tamar Christina wrote: > Hi All, > > The vectorizer at the moment uses a num_bb check to check for control flow. > This rejects a number of loops with no reason. Instead this patch changes it > to check the destination of the exits instead. > > This also allows early break to work by also dropping the single_exit check. > > Bootstrapped Regtested on aarch64-none-linux-gnu and no issues. > > Ok for master? I think this can go in independently, one comment below ... > Thanks, > Tamar > > gcc/ChangeLog: > > * tree-vect-loop-manip.cc (slpeel_can_duplicate_loop_p): > * tree-vect-loop.cc (vect_analyze_loop_form): > > --- inline copy of patch -- > diff --git a/gcc/tree-vect-loop-manip.cc b/gcc/tree-vect-loop-manip.cc > index 9c1405d79fd8fe8689007df3b7605b7a3d3ecdd7..466cf4c47154099a33dc63e22d74eef42d282444 100644 > --- a/gcc/tree-vect-loop-manip.cc > +++ b/gcc/tree-vect-loop-manip.cc > @@ -1937,12 +1937,10 @@ slpeel_can_duplicate_loop_p (const class loop *loop, const_edge exit_e, > edge entry_e = loop_preheader_edge (loop); > gcond *orig_cond = get_loop_exit_condition (exit_e); > gimple_stmt_iterator loop_exit_gsi = gsi_last_bb (exit_e->src); > - unsigned int num_bb = loop->inner? 5 : 2; > > /* All loops have an outer scope; the only case loop->outer is NULL is for > the function itself. */ > if (!loop_outer (loop) > - || loop->num_nodes != num_bb > || !empty_block_p (loop->latch) > || !exit_e > /* Verify that new loop exit condition can be trivially modified. */ > diff --git a/gcc/tree-vect-loop.cc b/gcc/tree-vect-loop.cc > index ddb6cad60f2f2cfdc96732f3f256d86e315d7357..27ab6abfa854f14f8a4cf3d9fcb1ac1c203a4198 100644 > --- a/gcc/tree-vect-loop.cc > +++ b/gcc/tree-vect-loop.cc > @@ -1727,6 +1727,17 @@ vect_analyze_loop_form (class loop *loop, vect_loop_form_info *info) > "using as main loop exit: %d -> %d [AUX: %p]\n", > exit_e->src->index, exit_e->dest->index, exit_e->aux); > > + /* Check if we have any control flow that doesn't leave the loop. */ > + class loop *v_loop = loop->inner ? loop->inner : loop; > + basic_block *bbs= get_loop_body (v_loop); > + for (unsigned i = 0; i < v_loop->num_nodes; i++) > + if (!empty_block_p (bbs[i]) > + && !loop_exits_from_bb_p (v_loop, bbs[i]) > + && bbs[i]->loop_father == v_loop) That looks a bit complicated. Better matching the comment would be if (EDGE_COUNT (bbs[i]->succs) != 1 && (EDGE_COUNT (bbs[i]->succs) != 2 || !loop_exits_from_bb_p (bb[i]->loop_father, bb[i]))) I'd say OK with that change, and independently if the removed single_exit test below isn't harmful (I suppose it is). Btw, for the outer loop case we still have the single_exit tests but you already said you're not supporting multi-exits there yet. Thanks, Richard. > + return opt_result::failure_at (vect_location, > + "not vectorized:" > + " unsupported control flow in loop.\n"); > + > /* Different restrictions apply when we are considering an inner-most loop, > vs. an outer (nested) loop. > (FORNOW. May want to relax some of these restrictions in the future). */ > @@ -1746,11 +1757,6 @@ vect_analyze_loop_form (class loop *loop, vect_loop_form_info *info) > | > (exit-bb) */ > > - if (loop->num_nodes != 2) > - return opt_result::failure_at (vect_location, > - "not vectorized:" > - " control flow in loop.\n"); > - > if (empty_block_p (loop->header)) > return opt_result::failure_at (vect_location, > "not vectorized: empty loop.\n"); > @@ -1782,11 +1788,6 @@ vect_analyze_loop_form (class loop *loop, vect_loop_form_info *info) > "not vectorized:" > " multiple nested loops.\n"); > > - if (loop->num_nodes != 5) > - return opt_result::failure_at (vect_location, > - "not vectorized:" > - " control flow in loop.\n"); > - > entryedge = loop_preheader_edge (innerloop); > if (entryedge->src != loop->header > || !single_exit (innerloop) > @@ -1823,9 +1824,6 @@ vect_analyze_loop_form (class loop *loop, vect_loop_form_info *info) > info->inner_loop_cond = inner.conds[0]; > } > > - if (!single_exit (loop)) > - return opt_result::failure_at (vect_location, > - "not vectorized: multiple exits.\n"); > if (EDGE_COUNT (loop->header->preds) != 2) > return opt_result::failure_at (vect_location, > "not vectorized:"
--- a/gcc/tree-vect-loop-manip.cc +++ b/gcc/tree-vect-loop-manip.cc @@ -1937,12 +1937,10 @@ slpeel_can_duplicate_loop_p (const class loop *loop, const_edge exit_e, edge entry_e = loop_preheader_edge (loop); gcond *orig_cond = get_loop_exit_condition (exit_e); gimple_stmt_iterator loop_exit_gsi = gsi_last_bb (exit_e->src); - unsigned int num_bb = loop->inner? 5 : 2; /* All loops have an outer scope; the only case loop->outer is NULL is for the function itself. */ if (!loop_outer (loop) - || loop->num_nodes != num_bb || !empty_block_p (loop->latch) || !exit_e /* Verify that new loop exit condition can be trivially modified. */ diff --git a/gcc/tree-vect-loop.cc b/gcc/tree-vect-loop.cc index ddb6cad60f2f2cfdc96732f3f256d86e315d7357..27ab6abfa854f14f8a4cf3d9fcb1ac1c203a4198 100644 --- a/gcc/tree-vect-loop.cc +++ b/gcc/tree-vect-loop.cc @@ -1727,6 +1727,17 @@ vect_analyze_loop_form (class loop *loop, vect_loop_form_info *info) "using as main loop exit: %d -> %d [AUX: %p]\n", exit_e->src->index, exit_e->dest->index, exit_e->aux); + /* Check if we have any control flow that doesn't leave the loop. */ + class loop *v_loop = loop->inner ? loop->inner : loop; + basic_block *bbs= get_loop_body (v_loop); + for (unsigned i = 0; i < v_loop->num_nodes; i++) + if (!empty_block_p (bbs[i]) + && !loop_exits_from_bb_p (v_loop, bbs[i]) + && bbs[i]->loop_father == v_loop) + return opt_result::failure_at (vect_location, + "not vectorized:" + " unsupported control flow in loop.\n"); + /* Different restrictions apply when we are considering an inner-most loop, vs. an outer (nested) loop. (FORNOW. May want to relax some of these restrictions in the future). */ @@ -1746,11 +1757,6 @@ vect_analyze_loop_form (class loop *loop, vect_loop_form_info *info) | (exit-bb) */ - if (loop->num_nodes != 2) - return opt_result::failure_at (vect_location, - "not vectorized:" - " control flow in loop.\n"); - if (empty_block_p (loop->header)) return opt_result::failure_at (vect_location, "not vectorized: empty loop.\n"); @@ -1782,11 +1788,6 @@ vect_analyze_loop_form (class loop *loop, vect_loop_form_info *info) "not vectorized:" " multiple nested loops.\n"); - if (loop->num_nodes != 5) - return opt_result::failure_at (vect_location, - "not vectorized:" - " control flow in loop.\n"); - entryedge = loop_preheader_edge (innerloop); if (entryedge->src != loop->header || !single_exit (innerloop) @@ -1823,9 +1824,6 @@ vect_analyze_loop_form (class loop *loop, vect_loop_form_info *info) info->inner_loop_cond = inner.conds[0]; } - if (!single_exit (loop)) - return opt_result::failure_at (vect_location, - "not vectorized: multiple exits.\n"); if (EDGE_COUNT (loop->header->preds) != 2) return opt_result::failure_at (vect_location, "not vectorized:"