From patchwork Thu Feb 8 13:47:36 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tamar Christina X-Patchwork-Id: 1896625 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=J6nYMkrk; 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=J6nYMkrk; 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 4TVyxJ4rpqz23hn for ; Fri, 9 Feb 2024 00:48:19 +1100 (AEDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 4A531385828F for ; Thu, 8 Feb 2024 13:48:17 +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-db8eur05on2080.outbound.protection.outlook.com [40.107.20.80]) by sourceware.org (Postfix) with ESMTPS id 705993858C53 for ; Thu, 8 Feb 2024 13:47:54 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 705993858C53 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 705993858C53 Authentication-Results: server2.sourceware.org; arc=pass smtp.remote-ip=40.107.20.80 ARC-Seal: i=3; a=rsa-sha256; d=sourceware.org; s=key; t=1707400076; cv=pass; b=ItBiPdmvQF0PMuE/Rh2CirtL9rGrZeI1yioMptKXpVplmN5rRXEZytJsIeQaSj1J8cgTSbj8l0uRrra35/+d2tmcEHUtP7XWbrsjm0yhXKvlQbiQDSY2x1xKI6UNay20uveWW8zNtj69RJ5vr/vSohMNLcU3jsGs3GkAfE9RhDc= ARC-Message-Signature: i=3; a=rsa-sha256; d=sourceware.org; s=key; t=1707400076; c=relaxed/simple; bh=lwZcg07TeFlrFSlXNZEWlo73rtt0kyiF2PlUssq8jv8=; h=DKIM-Signature:DKIM-Signature:Date:From:To:Subject:Message-ID: MIME-Version; b=eDshCFObbGCAufdHUIed+vV3q5EZBnNtQNhF+rBheZ5b1zsUv2gAM1OJ3kSy+pnJM/a4CjgLFdHB4QTAzO0OAQ5PYtc4GiBCYVBPl/wwmYTE3ZO33Zar4rntu/DSE11GeWDvN+rKnl7qi29fgqA1xzH7AiFe5NKm12OtYQ5PCzQ= ARC-Authentication-Results: i=3; server2.sourceware.org ARC-Seal: i=2; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=pass; b=g57TNp4IEJulQFvFTiR5/8OStnVC6hx4aU64ecLmV8TESob/sVJk46tWCRop4iyf2aanlemFdkWGWNSg9ccZNYfUjCbkrDfoiYMW+Ti6M8aZkCMBD0TaZ9104o5VZ0/FFOihi+m5HT6Eji1djGomgTMTgo92GAZbSsaSr0S/g0dmUvsXoVwLeWnvVMBbjIG9X6O3Gcc/dDjGY6kjS/vCjU8trSxN2ND1hxLaJJp2Y99PPfLG5L0ZK8HnCGcOFFS3UUKjGsZdCKA6SGmniX5Q1YqQgFUIxievHljQerHpVuDoueKkMVigHLwCIOeMj08ypl0Nv/VfQabWVp5rwDnwXw== 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=ek2WS7C+SUd/v/qW9O5lrvQXxvqO1JyPYhbNCTu9Azw=; b=Bvs43p32hvN4nQKnbQUEqJdVe0UpKtOl82DKWmXtnxlPrsmp9/6oqLz3PrAd5959djKcrPtdqGEFQppwcpHrxMAUzr8l6L2VfjawU1DDDk/44kLbE51RfN8kjzbw7WOi9PXo7d2LcKUEBoIANkJyogTw+tNS5vXPf4GVPOgc9KYI2imBwazDDeOL/pJKPgLp97Gl/1x0o+ZXcQK7fuauCQgbP9hWSvjhJXf+HLK7oQJbZmD6ahgAvW4NJbaY/WgAmXrLDBGydVnSh0+mXeOfsW76HDOcwpxKvoSiKau7jjW3KvczCkAQBLZY8HwWMY++UWzQGpFNzaNDXcayl9ChVA== 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=ek2WS7C+SUd/v/qW9O5lrvQXxvqO1JyPYhbNCTu9Azw=; b=J6nYMkrkXrWPkderWoJxCjKUH7xy9AP/Y2ELP1Caew51tkrR9jONkf+22UlTrSvRZ1RziZB1FDPeVWpSrnLLkHEWfJ/OmQVAIT5UvNMUUg+xsj9HvttSYeGa1M4vDXvUZAGBudokSAidZw1+F7PYGnN+PHkwaEJ+dTLhpLEk3Xk= Received: from DB3PR08CA0027.eurprd08.prod.outlook.com (2603:10a6:8::40) by PAWPR08MB10090.eurprd08.prod.outlook.com (2603:10a6:102:367::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7270.24; Thu, 8 Feb 2024 13:47:49 +0000 Received: from DB1PEPF000509E8.eurprd03.prod.outlook.com (2603:10a6:8:0:cafe::40) by DB3PR08CA0027.outlook.office365.com (2603:10a6:8::40) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7249.36 via Frontend Transport; Thu, 8 Feb 2024 13:47:49 +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 DB1PEPF000509E8.mail.protection.outlook.com (10.167.242.58) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7249.19 via Frontend Transport; Thu, 8 Feb 2024 13:47:49 +0000 Received: ("Tessian outbound 31df1b57f90c:v228"); Thu, 08 Feb 2024 13:47:49 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: 377060669870bfa0 X-CR-MTA-TID: 64aa7808 Received: from 34cb63f60796.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 1B7C199D-9F85-4C2E-88EE-DB7B910457CE.1; Thu, 08 Feb 2024 13:47:43 +0000 Received: from EUR04-HE1-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 34cb63f60796.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Thu, 08 Feb 2024 13:47:42 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=W5W2OMvTPtTGVW7O+GogasESpsR1qnoxhkM2nzvsMVyqUQ16QkXc88UlCgIpGdQPoI+o1uDlvZp0Rvo0XsbYsVDDx/Yv0NHc7efupZjCBED7JpvxDePGe9qUEiDTTEM20bhT0beCrwgtnLJ3lkX6DsryfmTJdKYtRnhDREwmjegl/ENY1jqftT6kAiHGQG6y1UCBhplTHHiskxyKXukltbQhi1Qf0p7fmlVpPG6lDrquBCqz+++lAUD07BFRA2uuv8JXCMxgwegQkpnNFT20Os0uKHI8D7yMOgZWBi7wucDTXBdlqV7+OJVwxXMxU71lz9Ijg/IfdiSrCxCKflLSYw== 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=ek2WS7C+SUd/v/qW9O5lrvQXxvqO1JyPYhbNCTu9Azw=; b=lkhc2h3TbCBAFpHNVXln6xf1LROGaQVip/pCDKFKLALZCa10XMcBfq4vhegeASmcYDK5oTuFyneRGlP2Nzp+0AK4Z9phHAv6XJraLF3mTLl9SvtKh35W3hUblHEe+cXgDU1QlxvZ2RfLIGDVu6jxYEisaQVOfp4WL1dLPqKmkp74LPOyS0TFdfeiA1CNiK0vVjGmTlP3uiSB7jxu/DaR9izgOwClt6gINV4ghglfx1XwAhDCX5TCNMwqJPiGK0F7UUfPsfi9D6WEAkBnZO2It5TBO7eClQq7dVNrnlSYnR2ujiCH1lcYRZWoENgrU4Fglns/1a50INTUfLl4TCwcIg== 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=ek2WS7C+SUd/v/qW9O5lrvQXxvqO1JyPYhbNCTu9Azw=; b=J6nYMkrkXrWPkderWoJxCjKUH7xy9AP/Y2ELP1Caew51tkrR9jONkf+22UlTrSvRZ1RziZB1FDPeVWpSrnLLkHEWfJ/OmQVAIT5UvNMUUg+xsj9HvttSYeGa1M4vDXvUZAGBudokSAidZw1+F7PYGnN+PHkwaEJ+dTLhpLEk3Xk= 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 AS8PR08MB9268.eurprd08.prod.outlook.com (2603:10a6:20b:5a4::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7249.39; Thu, 8 Feb 2024 13:47:40 +0000 Received: from VI1PR08MB5325.eurprd08.prod.outlook.com ([fe80::810c:8495:3f0a:ef8]) by VI1PR08MB5325.eurprd08.prod.outlook.com ([fe80::810c:8495:3f0a:ef8%7]) with mapi id 15.20.7249.039; Thu, 8 Feb 2024 13:47:40 +0000 Date: Thu, 8 Feb 2024 13:47:36 +0000 From: Tamar Christina To: gcc-patches@gcc.gnu.org Cc: nd@arm.com, rguenther@suse.de, jlaw@ventanamicro.com Subject: [PATCH]middle-end: add two debug counters for early-break vectorization debugging Message-ID: Content-Disposition: inline X-ClientProxiedBy: LO4P123CA0356.GBRP123.PROD.OUTLOOK.COM (2603:10a6:600:18d::19) To VI1PR08MB5325.eurprd08.prod.outlook.com (2603:10a6:803:13e::17) MIME-Version: 1.0 X-MS-TrafficTypeDiagnostic: VI1PR08MB5325:EE_|AS8PR08MB9268:EE_|DB1PEPF000509E8:EE_|PAWPR08MB10090:EE_ X-MS-Office365-Filtering-Correlation-Id: fe53ae78-1818-4e72-1217-08dc28ac8a39 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: 02aGnh+Q6JDud0Kz341GUnOtnztvhTjs+6UGEoGoM6zotoVqWt+r+B6lSXOvPY5X/MdOM4gb3JZbZkMt+c/bra3r/reQxjzdNJLxgKkIK7weosu6bcLD5L7D5J/ysNd5FN/lO2H9MzFZc/x5zk+P2Z6VDJUZTQLQqXrygiZ8FhxwBw2NYLCl8MMAaf4uROTWFyKbbK/wuN2ktcvWKgzD9EoUl4zTAl8xcVxasw0Xm6ndb1zgP9YadtxJYjKXRRYJpgVhTyq820YohT4qtsWqz/JgR8Yj+3XdJS10YL3WqPl5VlEaAnUeeBpy56IcPLw4pByWw1/pYsQuUBoeBjTYWgUsOzO4CZCa5+3ZqKc0HoGJRfEbu1+K/82tojAqmBvd+hnRmXo45Hl7aLpVFQijw+PPKe5U1hMR0eb5URtBissijhQuwivVyqUsag9bNd7CrT38WZ6YJGW+sYgUjXtgL/d0KL6CtS5OQpPSYCa8jdA2vQS3mzd58gIVt9ULytNttEOFX52v6UjHq9UXNlsYQr1Y+0BJaUpr56wifar3kVNHPokn9Sy6iDz7YaksgJq6 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)(346002)(136003)(366004)(376002)(396003)(39860400002)(230922051799003)(451199024)(1800799012)(64100799003)(186009)(2906002)(38100700002)(66476007)(66946007)(66556008)(316002)(6916009)(6512007)(6666004)(2616005)(6506007)(33964004)(4743002)(44144004)(26005)(83380400001)(41300700001)(86362001)(478600001)(8676002)(36756003)(6486002)(44832011)(8936002)(4326008)(235185007)(5660300002); DIR:OUT; SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR08MB9268 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: DB1PEPF000509E8.eurprd03.prod.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: 8e732c89-ca15-4f56-68b2-08dc28ac8446 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: fh4lvJ9ngqSspwGSjjzpuZCaa/S+3oFL6F9B8xEDpMhESRH2mhU+nwvqroe0ilHCmGBeGG6hKHbhES2c0Z72oWcq0+orRUAvQwnGx5wNNHtt+hwEE5rLPf44l51hBg6k/0eE+/A60kQ/dBwYfrZfAHtbCLdCY5Y24W4lo/vYfZd624s9f6XUgFq8eGRIZXlfxGYUJ5NpXnYtcquSp+3YhO7T9qBAwy726Kd7rhpSlwIS1SHE7VSBy+yn8szL/d6F+58ibIfmw6oneBJZKJ3eH9VAypCtOAytq9Pj4v8YNdWuZy8d1mbR030B2Yuulu04zPdgFWlUKkUnecrK4aVlsB1yX664810oHqkYFXqiNTVHCXMBQOVUl6BuuZPnEz574f32A3dCQF+bCtwqcb2fot4eQRkUJWtbuIY49imYB6iDrOu3UAasc+WzK2FjeyRaAtslDDhRc8Nw/Fp+YV6vmyUZOLnVvks9VWviB6YSArrclYQLSIce9D5p5V9ITkgqgUCaKZhqIJC4wzsBrGhHN2wQ8U2m9B90NcN7un+OwzRJ01ybVKb4UXMykBhZBptMWvLEd6fnqj2yEB08TOzmJy85MpdhKrP8BflcXruWk2w= 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)(376002)(136003)(396003)(39860400002)(346002)(230922051799003)(186009)(82310400011)(451199024)(1800799012)(64100799003)(36840700001)(40470700004)(46966006)(2906002)(8936002)(4326008)(8676002)(5660300002)(235185007)(41300700001)(44832011)(83380400001)(356005)(86362001)(81166007)(36756003)(44144004)(2616005)(26005)(70586007)(33964004)(6506007)(336012)(4743002)(70206006)(6486002)(82740400003)(478600001)(6666004)(107886003)(316002)(6916009)(6512007); DIR:OUT; SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Feb 2024 13:47:49.8249 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: fe53ae78-1818-4e72-1217-08dc28ac8a39 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: DB1PEPF000509E8.eurprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAWPR08MB10090 X-Spam-Status: No, score=-11.9 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 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 adds two new debug counter to aid in debugging early break code. - vect_force_last_exit: when reached will always force the final loop exit. - vect_skip_exit: when reached will skip selecting the current candidate exit as the loop exit. The first counter essentially allows you to turn off the PEELED case and the second counter to pick a different exit, which may mean you pick no exit at all. Bootstrapped Regtested on aarch64-none-linux-gnu and no issues. Ok for master? Thanks, Tamar gcc/ChangeLog: * dbgcnt.def (vect_force_last_exit, vect_skip_exit): New. * tree-vect-loop.cc (vec_init_loop_exit_info): Use them. --- inline copy of patch -- diff --git a/gcc/dbgcnt.def b/gcc/dbgcnt.def index ed9f062eac2c28c52df76b39d4312dd9fde1c800..8f7bebf93fceabdf6ae86c2df591eae4848b8a5c 100644 --- diff --git a/gcc/dbgcnt.def b/gcc/dbgcnt.def index ed9f062eac2c28c52df76b39d4312dd9fde1c800..8f7bebf93fceabdf6ae86c2df591eae4848b8a5c 100644 --- a/gcc/dbgcnt.def +++ b/gcc/dbgcnt.def @@ -213,5 +213,7 @@ DEBUG_COUNTER (stv_conversion) DEBUG_COUNTER (tail_call) DEBUG_COUNTER (tree_sra) DEBUG_COUNTER (treepre_insert) +DEBUG_COUNTER (vect_force_last_exit) DEBUG_COUNTER (vect_loop) +DEBUG_COUNTER (vect_skip_exit) DEBUG_COUNTER (vect_slp) diff --git a/gcc/tree-vect-loop.cc b/gcc/tree-vect-loop.cc index eed2268e9bae7e7ad36d13da03e0b54eab26ef6f..854e9d78bc71721e6559a6bc5dff78c813603a78 100644 --- a/gcc/tree-vect-loop.cc +++ b/gcc/tree-vect-loop.cc @@ -58,6 +58,7 @@ along with GCC; see the file COPYING3. If not see #include "tree-eh.h" #include "case-cfn-macros.h" #include "langhooks.h" +#include "dbgcnt.h" /* Loop Vectorization Pass. @@ -977,6 +978,20 @@ vec_init_loop_exit_info (class loop *loop) if (exits.length () == 1) return exits[0]; + /* Check to see if we've been asked to force the last exit. */ + if (!dbg_cnt (vect_force_last_exit)) + { + basic_block bb = ip_normal_pos (loop); + if (!bb) + return NULL; + + edge exit = EDGE_SUCC (bb, 0); + if (exit->dest == loop->latch) + return EDGE_SUCC (bb, 1); + + return exit; + } + /* If we have multiple exits we only support counting IV at the moment. Analyze all exits and return the last one we can analyze. */ class tree_niter_desc niter_desc; @@ -998,6 +1013,7 @@ vec_init_loop_exit_info (class loop *loop) && exit->src == single_pred (loop->latch) && (integer_nonzerop (may_be_zero) || COMPARISON_CLASS_P (may_be_zero)))) + && dbg_cnt (vect_skip_exit) && (!candidate || dominated_by_p (CDI_DOMINATORS, exit->src, candidate->src))) --- a/gcc/dbgcnt.def +++ b/gcc/dbgcnt.def @@ -213,5 +213,7 @@ DEBUG_COUNTER (stv_conversion) DEBUG_COUNTER (tail_call) DEBUG_COUNTER (tree_sra) DEBUG_COUNTER (treepre_insert) +DEBUG_COUNTER (vect_force_last_exit) DEBUG_COUNTER (vect_loop) +DEBUG_COUNTER (vect_skip_exit) DEBUG_COUNTER (vect_slp) diff --git a/gcc/tree-vect-loop.cc b/gcc/tree-vect-loop.cc index eed2268e9bae7e7ad36d13da03e0b54eab26ef6f..854e9d78bc71721e6559a6bc5dff78c813603a78 100644 --- a/gcc/tree-vect-loop.cc +++ b/gcc/tree-vect-loop.cc @@ -58,6 +58,7 @@ along with GCC; see the file COPYING3. If not see #include "tree-eh.h" #include "case-cfn-macros.h" #include "langhooks.h" +#include "dbgcnt.h" /* Loop Vectorization Pass. @@ -977,6 +978,20 @@ vec_init_loop_exit_info (class loop *loop) if (exits.length () == 1) return exits[0]; + /* Check to see if we've been asked to force the last exit. */ + if (!dbg_cnt (vect_force_last_exit)) + { + basic_block bb = ip_normal_pos (loop); + if (!bb) + return NULL; + + edge exit = EDGE_SUCC (bb, 0); + if (exit->dest == loop->latch) + return EDGE_SUCC (bb, 1); + + return exit; + } + /* If we have multiple exits we only support counting IV at the moment. Analyze all exits and return the last one we can analyze. */ class tree_niter_desc niter_desc; @@ -998,6 +1013,7 @@ vec_init_loop_exit_info (class loop *loop) && exit->src == single_pred (loop->latch) && (integer_nonzerop (may_be_zero) || COMPARISON_CLASS_P (may_be_zero)))) + && dbg_cnt (vect_skip_exit) && (!candidate || dominated_by_p (CDI_DOMINATORS, exit->src, candidate->src)))