From patchwork Mon Jun 12 17:02:38 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bin Cheng X-Patchwork-Id: 774753 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org 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 3wmfNT5wF2z9s71 for ; Tue, 13 Jun 2017 03:03:05 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="jwJCYzw/"; dkim-atps=neutral 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=wNa+iENT87T6RWZOZWHlzoe0CMDBVvV4hxZ2pIog4lp+KgI3m6 BiReedziHBv+EjjuthpJ+2nXd+FUFjmxsW9Of3+9/cMXF2JnDSG1MveU21FRcRKt MpOPX+MFiPZfTvdzHjRDp6A/6m8qNrulXPStaGuQnrYCZKYZP6+jsp2uk= 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=v5s58os5YSxCwbMJg91r5Re2lNw=; b=jwJCYzw/D45hXU26bQtn nTOENUKogjNbbIDp0f45/M/WpBCIMATIgXGo/dSNDlS2biw0qa1Ltv/kXzsW+qr7 9uWgyPiys2aXE7cBG1ad+rRLakp4bxXWKVk7pbbeHqyFM9bJHKm/U0bz5NLBF3HU w3y7+yVIArHJgihWqxQzc1o= Received: (qmail 38671 invoked by alias); 12 Jun 2017 17:02:41 -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 38412 invoked by uid 89); 12 Jun 2017 17:02:39 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-26.9 required=5.0 tests=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.2 spammy= X-HELO: EUR03-AM5-obe.outbound.protection.outlook.com Received: from mail-eopbgr30066.outbound.protection.outlook.com (HELO EUR03-AM5-obe.outbound.protection.outlook.com) (40.107.3.66) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 12 Jun 2017 17:02:37 +0000 Received: from VI1PR0802MB2176.eurprd08.prod.outlook.com (10.172.12.21) by VI1PR0802MB2175.eurprd08.prod.outlook.com (10.172.12.20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1157.12; Mon, 12 Jun 2017 17:02:39 +0000 Received: from VI1PR0802MB2176.eurprd08.prod.outlook.com ([fe80::2dae:8af1:7884:bb6d]) by VI1PR0802MB2176.eurprd08.prod.outlook.com ([fe80::2dae:8af1:7884:bb6d%18]) with mapi id 15.01.1157.017; Mon, 12 Jun 2017 17:02:39 +0000 From: Bin Cheng To: "gcc-patches@gcc.gnu.org" CC: nd Subject: [PATCH GCC][03/13]Mark and skip distributed loops Date: Mon, 12 Jun 2017 17:02:38 +0000 Message-ID: authentication-results: arm.com; dkim=none (message not signed) header.d=none; arm.com; dmarc=none action=none header.from=arm.com; x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; VI1PR0802MB2175; 7:CwXq1w2Zuc24K1Pl3y623dyG13/H0emnUc1eJSWlSreTU7G9UxqY47tpBc0T7u1qK7eIXdXX0f8p+1GtUmWRs6AfW5fKMn6jpQf2gLNpxu6HqnRiSBn4KvwWRLTpJug2aauLJVUwEa5PCS4WqonvPtayMWF18Hv6IoDUUk9jOJzgmCCqaZXkxNfRbV0oJJR+mkRSELLKCwnEhsgq9gqxL2PuGJWE4q4zEo6t2E4jJaNwEmac4mtS42J8+EmkB1h0HT5kXVcE2FWvpHcWyj+snBMLXx56Iz2q3gOb4DhKkbAsxq0qOoxhUT94QdkqJITB3iCZy4SbKkEehD1AVrrM8A== x-ms-traffictypediagnostic: VI1PR0802MB2175: x-ms-office365-filtering-correlation-id: cadd51bd-9d01-4803-49c3-08d4b1b4d4f9 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(2017030254075)(48565401081)(201703131423075)(201703031133081); SRVR:VI1PR0802MB2175; nodisclaimer: True x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(180628864354917); x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(102415395)(6040450)(601004)(2401047)(8121501046)(5005006)(10201501046)(3002001)(100000703101)(100105400095)(93006095)(93001095)(6055026)(6041248)(20161123560025)(20161123564025)(20161123562025)(20161123555025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123558100)(6072148)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:VI1PR0802MB2175; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:VI1PR0802MB2175; x-forefront-prvs: 03361FCC43 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(6009001)(39450400003)(39400400002)(39410400002)(39860400002)(39850400002)(39840400002)(377424004)(38730400002)(55016002)(50986999)(110136004)(99286003)(72206003)(14454004)(33656002)(53936002)(8936002)(478600001)(9686003)(5660300001)(86362001)(8676002)(3280700002)(2906002)(6506006)(99936001)(2351001)(189998001)(2501003)(7696004)(6436002)(25786009)(2900100001)(54356999)(74316002)(81166006)(3660700001)(4326008)(7736002)(5640700003)(5250100002)(305945005)(6916009)(66066001)(102836003)(3846002); DIR:OUT; SFP:1101; SCL:1; SRVR:VI1PR0802MB2175; H:VI1PR0802MB2176.eurprd08.prod.outlook.com; FPR:; SPF:None; MLV:sfv; LANG:en; spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-originalarrivaltime: 12 Jun 2017 17:02:38.8957 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR0802MB2175 X-IsSubscribed: yes Hi, This simple patch marks distributed loops and skips it in following distribution. Bootstrap and test on x86_64 and AArch64. Is it OK? Thanks, bin 2017-06-07 Bin Cheng * tree-loop-distribution.c (generate_loops_for_partition): Mark distributed loops. (pass_loop_distribution::execute): Skip distributed loops. From 705ad383bb8a806eb8b0fcd6faa298938dd3176b Mon Sep 17 00:00:00 2001 From: Bin Cheng Date: Wed, 7 Jun 2017 13:20:08 +0100 Subject: [PATCH 03/14] record-and-skip-distributed-loop-20170607.txt --- gcc/tree-loop-distribution.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/gcc/tree-loop-distribution.c b/gcc/tree-loop-distribution.c index 9f0c801..b0b9d66 100644 --- a/gcc/tree-loop-distribution.c +++ b/gcc/tree-loop-distribution.c @@ -618,8 +618,11 @@ generate_loops_for_partition (struct loop *loop, partition *partition, if (copy_p) { + int ldist_alias_id = loop->num; loop = copy_loop_before (loop); gcc_assert (loop != NULL); + loop->ldist_alias_id = ldist_alias_id; + loop->aux = (void *)loop; create_preheader (loop, CP_SIMPLE_PREHEADERS); create_bb_after_loop (loop); } @@ -1770,6 +1773,9 @@ pass_loop_distribution::execute (function *fun) gimple_set_uid (gsi_stmt (gsi), -1); } + FOR_EACH_LOOP (loop, LI_ONLY_INNERMOST) + loop->aux = NULL; + /* We can at the moment only distribute non-nested loops, thus restrict walking to innermost loops. */ FOR_EACH_LOOP (loop, LI_ONLY_INNERMOST) @@ -1779,6 +1785,10 @@ pass_loop_distribution::execute (function *fun) int num = loop->num; unsigned int i; + /* Skip distributed loops. */ + if (loop->aux != NULL) + continue; + /* If the loop doesn't have a single exit we will fail anyway, so do that early. */ if (!single_exit (loop)) @@ -1865,6 +1875,9 @@ out: fprintf (dump_file, "Loop %d is the same.\n", num); } + FOR_EACH_LOOP (loop, LI_ONLY_INNERMOST) + loop->aux = NULL; + if (cd) delete cd;