From patchwork Wed Oct 11 16:10:14 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bin Cheng X-Patchwork-Id: 824487 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=gcc.gnu.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=gcc-patches-return-463953-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="Jpiiw+P3"; 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 3yBzTx14S5z9sBW for ; Thu, 12 Oct 2017 03:10:28 +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=tmuePDJEFOoA+l/bXB4HyZS0B0xYmS2BXgODebNhxxNhA/QjmC cJMxh7FqPh/Zo1e7hb+RaMfvlX3+upnHEeyQxqVcGmkIMn8QF+IV0EViEDuikP2A 5gRWPwJqJZ307xThUqG59BaF8m9tpCtYAvoMsjEzb25DNAchFAd2l0AJA= 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=EV6Vz5Hl6JBNFWif7AuN9stpgH0=; b=Jpiiw+P3Yo4bR0qESUvD dEcK8cNPBv3lemN0XM6LYJfuQxEWSpk7lvy5q27OCQQRpcqutO0LOUTS5xlDh678 URS4paFU2SeMnlJO8TDbiisRdflhIi+Sh4O/zE2MgJuolIIKcXiP8QIKox9lbW9Y fchyR1AJIxqdxOoXNfjQZAs= Received: (qmail 105782 invoked by alias); 11 Oct 2017 16:10:21 -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 105773 invoked by uid 89); 11 Oct 2017 16:10:20 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-25.8 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.2 spammy= X-HELO: EUR01-VE1-obe.outbound.protection.outlook.com Received: from mail-ve1eur01on0087.outbound.protection.outlook.com (HELO EUR01-VE1-obe.outbound.protection.outlook.com) (104.47.1.87) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 11 Oct 2017 16:10:18 +0000 Received: from HE1PR0801MB2746.eurprd08.prod.outlook.com (10.169.123.154) by HE1PR0801MB2745.eurprd08.prod.outlook.com (10.169.123.153) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.77.7; Wed, 11 Oct 2017 16:10:14 +0000 Received: from HE1PR0801MB2746.eurprd08.prod.outlook.com ([fe80::1c5f:4f32:712b:804e]) by HE1PR0801MB2746.eurprd08.prod.outlook.com ([fe80::1c5f:4f32:712b:804e%14]) with mapi id 15.20.0077.020; Wed, 11 Oct 2017 16:10:14 +0000 From: Bin Cheng To: "gcc-patches@gcc.gnu.org" CC: nd Subject: [PATCH GCC]Refine comment and set type for partition merged from SCC Date: Wed, 11 Oct 2017 16:10:14 +0000 Message-ID: authentication-results: spf=none (sender IP is ) smtp.mailfrom=Bin.Cheng@arm.com; x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; HE1PR0801MB2745; 6:7WcW744YnVFRCx9cHck2lh4PnMEZO8LR33M0MQRhHwuv2t4kMSR2lvFfJi9y1D38LEk3iD2b51gHXZMcQ3E7V+yUX3m6N9fqFUH0krvvzw5OZh5W/FVsUSHDeGAZKxhlNVhvsTz9ruTAuTGMAPDa7B/d0tEQDHw8VL+FNh5dGQGs2Hk9/Bc9DueH8eE+wfYTCnuAAc9VJhzHBJiWaz1/irrjiJu08xX0Y6X4Qxmd4HxB5XCBFIFq5qVhSXHWcJOpE9hRXNuZirCCckcmKvX0a6QAQPm8rZ/Usu58UY9XYPbj9qGO97JrOk/F/QkpK7AsUHegZPiLnAGYjLE772OdAw==; 5:9x6R9M3isvioBzXX5cHNWpcPFJFIJoLZVEdMKa1w/BXo5wIXW21ZtSDn/6YKDJ2vWm/iHShi9JPZJjXrLn+tu68Xyor8dUXDm5DQ0uAEOAukEKFGLV2h4P26evIUOLSwaJ8CSjlH2tS8pxRZQ2vKUAVL7K7VXbNXNrURFZJ3/eo=; 24:x4lGZRdMOD1gr/BfTyjL9Qy5HTp1hkQCR51KPwReYsx5K7QpviA10pLip3NsAYLnB2LF5QKPo0GZf18LAlgRYhutBAWG/NouZVZWa3/0mEQ=; 7:qq7dCSWfQhBZxruaoSpAQa06e/V4rls92N99uq5OCIxd/L4BZBJlK8ZVIPSwTHOuy5KgGPn5vG6lVj/A1iSf7Wiv6AgXCpAEN41eu6l4JyNDMxLt9O31YWZFAc1wakROlqpdJwvizE0A0kLLIL8NEcgIpgvPBX/7+0VVrqrMIBqlFkAO5ym5aw26yJfIM9cCiciXd8AQomn+eMPxtXUTe8BC3tJLqmBQ3rI0aQyCjEI= x-ms-exchange-antispam-srfa-diagnostics: SSOS; x-ms-office365-filtering-correlation-id: 41f41cd2-d901-4e0e-cc1b-08d510c28e96 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(2017030254152)(48565401081)(2017052603199)(49563074)(201703131423075)(201703031133081)(201702281549075); SRVR:HE1PR0801MB2745; x-ms-traffictypediagnostic: HE1PR0801MB2745: nodisclaimer: True x-exchange-antispam-report-test: UriScan:(180628864354917); x-microsoft-antispam-prvs: x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(102415395)(6040450)(2401047)(5005006)(8121501046)(3002001)(100000703101)(100105400095)(93006095)(93001095)(10201501046)(6055026)(6041248)(20161123564025)(20161123560025)(20161123562025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123558100)(20161123555025)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:HE1PR0801MB2745; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:HE1PR0801MB2745; x-forefront-prvs: 0457F11EAF x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(6009001)(346002)(376002)(39860400002)(189002)(199003)(377424004)(25786009)(72206003)(478600001)(5250100002)(2351001)(101416001)(3280700002)(2501003)(3660700001)(50986999)(54356999)(66066001)(2900100001)(99936001)(189998001)(106356001)(102836003)(2906002)(6116002)(3846002)(14454004)(4001150100001)(6916009)(97736004)(7696004)(105586002)(33656002)(316002)(68736007)(6506006)(5640700003)(6436002)(5660300001)(81156014)(8676002)(74316002)(81166006)(7736002)(8936002)(305945005)(4326008)(9686003)(99286003)(55016002)(53936002)(86362001); DIR:OUT; SFP:1101; SCL:1; SRVR:HE1PR0801MB2745; H:HE1PR0801MB2746.eurprd08.prod.outlook.com; FPR:; SPF:None; PTR:InfoNoRecords; MX:1; A:1; LANG:en; received-spf: None (protection.outlook.com: arm.com does not designate permitted sender hosts) spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-originalarrivaltime: 11 Oct 2017 16:10:14.2084 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-Transport-CrossTenantHeadersStamped: HE1PR0801MB2745 X-IsSubscribed: yes Hi, When reading the code I found it's could be confusing without comment. This patch adds comment explaining why we want merge PARALLEL type partitions in a SCC, even though the result partition can no longer be executed in parallel. It also sets type of the result partition to sequential. Bootstrap and test on x86_64 and AArch64. Is it OK? Thanks, bin 2017-10-10 Bin Cheng * tree-loop-distribution.c (break_alias_scc_partitions): Add comment and set PTYPE_SEQUENTIAL for merged partition. diff --git a/gcc/tree-loop-distribution.c b/gcc/tree-loop-distribution.c index 9ffac53..dc429cf 100644 --- a/gcc/tree-loop-distribution.c +++ b/gcc/tree-loop-distribution.c @@ -2062,7 +2062,7 @@ break_alias_scc_partitions (struct graph *rdg, auto_vec scc_types; struct partition *partition, *first; - /* If all paritions in a SCC has the same type, we can simply merge the + /* If all partitions in a SCC have the same type, we can simply merge the SCC. This loop finds out such SCCS and record them in bitmap. */ bitmap_set_range (sccs_to_merge, 0, (unsigned) num_sccs); for (i = 0; i < num_sccs; ++i) @@ -2075,6 +2075,10 @@ break_alias_scc_partitions (struct graph *rdg, if (pg->vertices[j].component != i) continue; + /* Note we Merge partitions of parallel type on purpose, though + the result partition is sequential. The reason is vectorizer + can do more accurate runtime alias check in this case. Also + it results in more conservative distribution. */ if (first->type != partition->type) { bitmap_clear_bit (sccs_to_merge, i); @@ -2096,7 +2100,7 @@ break_alias_scc_partitions (struct graph *rdg, if (bitmap_count_bits (sccs_to_merge) != (unsigned) num_sccs) { /* Run SCC finding algorithm again, with alias dependence edges - skipped. This is to topologically sort paritions according to + skipped. This is to topologically sort partitions according to compilation time known dependence. Note the topological order is stored in the form of pg's post order number. */ num_sccs_no_alias = graphds_scc (pg, NULL, pg_skip_alias_edge); @@ -2139,6 +2143,8 @@ break_alias_scc_partitions (struct graph *rdg, data = (struct pg_vdata *)pg->vertices[k].data; gcc_assert (data->id == k); data->partition = NULL; + /* The result partition of merged SCC must be sequential. */ + first->type = PTYPE_SEQUENTIAL; } } }