From patchwork Fri Nov 8 16:54:57 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sudakshina Das X-Patchwork-Id: 1192055 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=gcc-patches-return-512844-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=arm.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="y1Xl5QWZ"; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=armh.onmicrosoft.com header.i=@armh.onmicrosoft.com header.b="juiRipvH"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=armh.onmicrosoft.com header.i=@armh.onmicrosoft.com header.b="juiRipvH"; dkim-atps=neutral Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 478mbr0TQrz9s4Y for ; Sat, 9 Nov 2019 03:55:19 +1100 (AEDT) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:cc:subject:date:message-id:content-type:mime-version; q=dns; s=default; b=jw7YfP5d+PYNIyxfVD52+rrGZIcmsZUxSQzKL8tdcKFkkSxv6o NDr99op4/uiFn2T7VjXePPWchIZr0WE8RSYeSE/8Dv+Hl30bltJt8sl0wUSS5tET RwXRmPe9hqTYYgDmG7Z5AWFLu9q0l+tKofvr4UOqqlsA0k2Rz/uKTSwyI= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:cc:subject:date:message-id:content-type:mime-version; s= default; bh=y64KuuhZFdOAgdfEdla2503gBjE=; b=y1Xl5QWZIVV03AwPeaAh giJBpLJ9bfLo659dVsKvUQjb6vppEbmIY4RA+br/oiMBNLwogUePbKvQBIEZ3wYk x/rBy/HwcvLglzDVqvbAqhppK12nbVuKimu27QVNRpmBsHZDDegUHxNoHs/cYJf1 yJXZgkzUd/F+BtM4yUCX1yk= Received: (qmail 54371 invoked by alias); 8 Nov 2019 16:55:12 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 54361 invoked by uid 89); 8 Nov 2019 16:55:11 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-20.5 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_HELO_PASS, SPF_PASS autolearn=ham version=3.3.1 spammy= X-HELO: EUR02-AM5-obe.outbound.protection.outlook.com Received: from mail-eopbgr00047.outbound.protection.outlook.com (HELO EUR02-AM5-obe.outbound.protection.outlook.com) (40.107.0.47) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 08 Nov 2019 16:55:09 +0000 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=iI0ItWVV4yaKO03fZs5imTfHDbx5A0nOslxrbKzjJ7c=; b=juiRipvHtdvQqydghn0GtVOp30Z4nKzVnO7b3jeGFHBwKF7cpDS9UVS53rtrQjKpk8ta9ixljsp81pyfVIxuLHg8ziLwwRz5rPVXnqlExGVH6QsxJlVqvBUFA+OrDl6J9oxwEy0M2zgxESRmFLjBmlixFARevoYR7lnoQyggFvA= Received: from VI1PR08CA0185.eurprd08.prod.outlook.com (2603:10a6:800:d2::15) by VI1PR08MB3662.eurprd08.prod.outlook.com (2603:10a6:803:89::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2430.24; Fri, 8 Nov 2019 16:55:06 +0000 Received: from DB5EUR03FT015.eop-EUR03.prod.protection.outlook.com (2a01:111:f400:7e0a::208) by VI1PR08CA0185.outlook.office365.com (2603:10a6:800:d2::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.2430.20 via Frontend Transport; Fri, 8 Nov 2019 16:55:06 +0000 Authentication-Results: spf=fail (sender IP is 63.35.35.123) smtp.mailfrom=arm.com; gcc.gnu.org; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com; gcc.gnu.org; dmarc=none action=none header.from=arm.com; Received-SPF: Fail (protection.outlook.com: domain of arm.com does not designate 63.35.35.123 as permitted sender) receiver=protection.outlook.com; client-ip=63.35.35.123; helo=64aa7808-outbound-1.mta.getcheckrecipient.com; Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by DB5EUR03FT015.mail.protection.outlook.com (10.152.20.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.2430.21 via Frontend Transport; Fri, 8 Nov 2019 16:55:06 +0000 Received: ("Tessian outbound 6481c7fa5a3c:v33"); Fri, 08 Nov 2019 16:55:05 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: 7497121aa646f352 X-CR-MTA-TID: 64aa7808 Received: from 65058499440b.1 (cr-mta-lb-1.cr-mta-net [104.47.13.59]) by 64aa7808-outbound-1.mta.getcheckrecipient.com id 32F17ECB-4225-4BDF-89F0-A00FA6F8B415.1; Fri, 08 Nov 2019 16:54:59 +0000 Received: from EUR04-HE1-obe.outbound.protection.outlook.com (mail-he1eur04lp2059.outbound.protection.outlook.com [104.47.13.59]) by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 65058499440b.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Fri, 08 Nov 2019 16:54:59 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=YXVGquO9ZoGg4IHr6n7WfJOlbn/hdZO+zueTz4EfoyPnJZunIENzE0paTVk17KeW6l0yRSIn7vSVY2QFpJsbihXdujUtSsw2uUYw8oGkzXI5fkhXwJO7uPYqUZKqUJ73HphyzRP9NVXeiUIa16XNJqwA2wd+h1rfqFKPh/j7HEEj4uiNY9IUD5JngjijaGYWBuPzzr2tM+BqZGYTU9NImw27ZMDYWH62d4C0Tq0+z4Cl3R7icUuwvmY1C8fROw6kQ/7/b5SJ4lwKX/rfzBHMmCbPYdW3wOGLpb232laDBs3ubkS2gI3G1U4D6bDdvMpLUEAk0QrHKmRd2nu1nwr7YQ== 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-SenderADCheck; bh=iI0ItWVV4yaKO03fZs5imTfHDbx5A0nOslxrbKzjJ7c=; b=Q7EzVIBDL3PzkwvaYByUyKkYcXgCyXyLczx0EqUqeaQ9jpLqEI6AMkR5olbYgMaReP6T2jz7Djd1h7jyGANByTTyZjsa7uqPIW0kDSuFq2We0FQEjfisPacXY+SXxnRJF/g76MUVAs1slzlGOpf2tuH4i/9vSmAmNVzSRatFfoKGtgpOs9ZCpllGgtNA1ItW3p8QJvLR5MeG5x04F2TfeA45S5JkXogYaJwgCTTRUzqAU1/ncsN3b0CbzfV4ot3NHtFEceOHhpPURW/0gHpkbT2ye+C2agH0FtK/u298EcRRkuFzbLWQwLMIz7sOR+dvw4au3FxF8vUHEM2pApsC2g== 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=iI0ItWVV4yaKO03fZs5imTfHDbx5A0nOslxrbKzjJ7c=; b=juiRipvHtdvQqydghn0GtVOp30Z4nKzVnO7b3jeGFHBwKF7cpDS9UVS53rtrQjKpk8ta9ixljsp81pyfVIxuLHg8ziLwwRz5rPVXnqlExGVH6QsxJlVqvBUFA+OrDl6J9oxwEy0M2zgxESRmFLjBmlixFARevoYR7lnoQyggFvA= Received: from VI1PR08MB3888.eurprd08.prod.outlook.com (20.178.14.20) by VI1PR08MB5423.eurprd08.prod.outlook.com (52.133.245.141) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2430.23; Fri, 8 Nov 2019 16:54:57 +0000 Received: from VI1PR08MB3888.eurprd08.prod.outlook.com ([fe80::2c2d:1098:f7bb:ce7c]) by VI1PR08MB3888.eurprd08.prod.outlook.com ([fe80::2c2d:1098:f7bb:ce7c%7]) with mapi id 15.20.2430.023; Fri, 8 Nov 2019 16:54:57 +0000 From: Sudakshina Das To: "gcc-patches@gcc.gnu.org" CC: Eric Botcazou , "ook@ucw.cz" , "bin.cheng@linux.alibaba.com" Subject: [PATCH, GCC] Fix unrolling check. Date: Fri, 8 Nov 2019 16:54:57 +0000 Message-ID: <3e964005-5e24-0f15-0c88-b833e086debf@arm.com> Authentication-Results-Original: spf=none (sender IP is ) smtp.mailfrom=Sudi.Das@arm.com; x-checkrecipientrouted: true x-ms-oob-tlc-oobclassifiers: OLM:1247;OLM:1247; X-Forefront-Antispam-Report-Untrusted: SFV:NSPM; SFS:(10009020)(4636009)(39860400002)(346002)(376002)(366004)(396003)(136003)(54534003)(189003)(199004)(5660300002)(305945005)(66946007)(66616009)(66476007)(66556008)(64756008)(25786009)(31696002)(99286004)(36756003)(4326008)(66446008)(5640700003)(6486002)(6916009)(6512007)(31686004)(8936002)(14454004)(66066001)(316002)(478600001)(8676002)(2501003)(71200400001)(71190400001)(86362001)(81166006)(81156014)(54906003)(2351001)(99936001)(7736002)(186003)(102836004)(26005)(6116002)(3846002)(6436002)(2616005)(386003)(476003)(486006)(2906002)(52116002)(256004)(14444005)(6506007); DIR:OUT; SFP:1101; SCL:1; SRVR:VI1PR08MB5423; H:VI1PR08MB3888.eurprd08.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; received-spf: None (protection.outlook.com: arm.com does not designate permitted sender hosts) X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: +dQyXcAXyydwB41fuMNPTd3IaaXYU00XTNlRcg65BPGOXlZZDxZl5LQX0BBmhkedJWBQmwnscmTiW0FNr1LrJ4QdwRwEV9252vjZw6moO7A6dXhRIGyjGnd1/MK+TxJdEykZzMCAKroWyKwqByMiCX4Y6Q3SEWlWJNKa56aypCh0ewwm9/X6Au18MqaioQLVAJ8paBVKidVIMnyMyrND60D7dGLgW3dNzm4Ct03WMtb+TYah18UbyKrwsqOgrK0CMVyQYAj/WFW3e5DY+zFsb83NSH4VbU6i6+4BtLXLGrbXa93wrY5Q43ZC5ynz55wqNvmnW0yV82+xg2pbtFlV9sxkkFP352n67+EMDbhbtktFO/hlaWvPrBzwKikFjySul7dZ1lASa034mTmh+8woBgnwN344Ym4xX9x2bsWBqqx1R9qrV/zpja/wCMlnjOw5 x-ms-exchange-transport-forked: True MIME-Version: 1.0 Original-Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Sudi.Das@arm.com; X-MS-Exchange-Transport-CrossTenantHeadersStripped: DB5EUR03FT015.eop-EUR03.prod.protection.outlook.com X-MS-Office365-Filtering-Correlation-Id-Prvs: b2e7bf25-1111-4285-ee01-08d7646c62b4 X-IsSubscribed: yes Hi I was fiddling around with the loop unrolling pass and noticed a check in decide_unroll_* functions (in the patch). The comment on top of this check says "/* If we were not asked to unroll this loop, just return back silently. */" However the check returns when loop->unroll == 0 rather than 1. The check was added in r255106 where the ChangeLog suggests that the actual intention was probably to check the value 1 and not 0. Tested on aarch64-none-elf with one new regression: FAIL: gcc.dg/pr40209.c (test for excess errors) This fails because the changes cause the loop to unroll 3 times using unroll_stupid and that shows up as excess error due -fopt-info. This option was added in r202077 but I am not sure why this particular test was chosen for it. Does this change look ok? Can I just remove the -fopt-info from the test or unrolling the loop in the test is not desirable? Thanks Sudi gcc/ChangeLog: 2019-11-07 Sudakshina Das * loop-unroll.c (decide_unroll_constant_iterations): Update condition to check loop->unroll. (decide_unroll_runtime_iterations): Likewise. (decide_unroll_stupid): Likewise. diff --git a/gcc/loop-unroll.c b/gcc/loop-unroll.c index 63fccd23fae38f8918a7d94411aaa43c72830dd3..9f7ab4b5c1c9b2333148e452b84afbf040707456 100644 --- a/gcc/loop-unroll.c +++ b/gcc/loop-unroll.c @@ -354,7 +354,7 @@ decide_unroll_constant_iterations (class loop *loop, int flags) widest_int iterations; /* If we were not asked to unroll this loop, just return back silently. */ - if (!(flags & UAP_UNROLL) && !loop->unroll) + if (!(flags & UAP_UNROLL) && loop->unroll == 1) return; if (dump_enabled_p ()) @@ -674,7 +674,7 @@ decide_unroll_runtime_iterations (class loop *loop, int flags) widest_int iterations; /* If we were not asked to unroll this loop, just return back silently. */ - if (!(flags & UAP_UNROLL) && !loop->unroll) + if (!(flags & UAP_UNROLL) && loop->unroll == 1) return; if (dump_enabled_p ()) @@ -1159,7 +1159,7 @@ decide_unroll_stupid (class loop *loop, int flags) widest_int iterations; /* If we were not asked to unroll this loop, just return back silently. */ - if (!(flags & UAP_UNROLL_ALL) && !loop->unroll) + if (!(flags & UAP_UNROLL_ALL) && loop->unroll == 1) return; if (dump_enabled_p ())