From patchwork Tue Apr 18 10:46:43 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bin Cheng X-Patchwork-Id: 751779 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 3w6hf42T1Sz9s3s for ; Tue, 18 Apr 2017 20:47:08 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="DUKU1HrN"; 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=qS6tnrG+S6BKRbVBm2EbRFSdGRN1+zDtlC81PcWxY5x21n7vag LXs2kVCr6Gft5QO9tau0zVA5MFUTTiE4BFxnv9RiVmv15X4k+ngZRYNskO/najrB ctsdofHi1IDRiqYVF0aLDfc2ypFw1HkCi1O6h3YpTqVw671qbTpUxpO9E= 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=DgX0J3RWl78PhqrxvF1I7tg4HCM=; b=DUKU1HrNPpP4YPdFYF9S FXWloau107/qNGJZ4zi5r/y+XGi5T9RNbHyTkSjhRMvnpPBcMSk3EaSI/nzTWaw4 kAKYoLyHeNaoRE1RtUbatzjJ54vbQQFSsqoWQE+RT+rCJ4p3JFUhS2lT7vBj3v2l mJsj5Tmugk7/DDGgE0gBN0s= Received: (qmail 6096 invoked by alias); 18 Apr 2017 10:46:48 -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 6055 invoked by uid 89); 18 Apr 2017 10:46:47 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-25.1 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=relate, H*c:HHH X-HELO: EUR02-AM5-obe.outbound.protection.outlook.com Received: from mail-eopbgr00077.outbound.protection.outlook.com (HELO EUR02-AM5-obe.outbound.protection.outlook.com) (40.107.0.77) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 18 Apr 2017 10:46:45 +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.1034.10; Tue, 18 Apr 2017 10:46:43 +0000 Received: from VI1PR0802MB2176.eurprd08.prod.outlook.com ([10.172.12.21]) by VI1PR0802MB2176.eurprd08.prod.outlook.com ([10.172.12.21]) with mapi id 15.01.1034.013; Tue, 18 Apr 2017 10:46:43 +0000 From: Bin Cheng To: "gcc-patches@gcc.gnu.org" CC: nd Subject: [PATCH GCC8][18/33]Relate compare iv_use with all candidates Date: Tue, 18 Apr 2017 10:46:43 +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-microsoft-exchange-diagnostics: 1; VI1PR0802MB2175; 7:mTbH5wpGw+fWGPJe3tCOuvSIOAKJ8QId0gSCjTbjcsnA7CdQf+3aoXPPtAXClFGOxsBQn8SMQ9FvBD6LoQEm8+oPuIa7yDeSGSVRe3fS8hoJFxboNXBVVZ7HrlqDyMH4p3FOB0MVW8egwHiAfEsRRDEFZmEsQ+4zZjlc3lNgf6+HNEdjYvBg13yhz7T1lLuWmKWJbVX1AZEnz0Cgj9rjGFkjMdhByAg6QdpX35gYHwtftmCwhhE+p57TJ1O8WOFpVaMMA1GckXbEkk4fPUJZUsq2iwrC2tvaN7HiiCjVMSIDqRG+/KkUDTu8hTdL2rYr462W4LrTsciQrHJplitsAQ== x-ms-office365-filtering-correlation-id: 402d7510-6240-4607-2cd5-08d48648344d x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(2017030254075)(48565401081)(201703131423075)(201703031133081)(201702281549075); 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:(102415395)(6040450)(601004)(2401047)(8121501046)(5005006)(3002001)(93006095)(93001095)(10201501046)(6055026)(6041248)(20161123560025)(20161123562025)(20161123555025)(20161123564025)(201703131423075)(201702281528075)(201703061421075)(6072148); SRVR:VI1PR0802MB2175; BCL:0; PCL:0; RULEID:; SRVR:VI1PR0802MB2175; x-forefront-prvs: 028166BF91 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(6009001)(39860400002)(39400400002)(39850400002)(39410400002)(39450400003)(39840400002)(3280700002)(189998001)(7736002)(33656002)(102836003)(86362001)(4326008)(6916009)(8936002)(25786009)(305945005)(7696004)(5660300001)(8676002)(77096006)(6506006)(74316002)(99936001)(2906002)(5640700003)(6116002)(53936002)(3846002)(81166006)(38730400002)(54356999)(2900100001)(110136004)(99286003)(55016002)(6436002)(9686003)(50986999)(122556002)(2351001)(3660700001)(2501003)(66066001); 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: 18 Apr 2017 10:46:43.7291 (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, For compare type iv_use, we want to relate it with all candidates in order to achieve smaller candidate set. Generally this doesn't hurt compilation time because compare iv_use is already related with most candidates and the number of compare iv_uses is also small. Is it OK? Thanks, bin 2017-04-11 Bin Cheng * tree-ssa-loop-ivopts.c (relate_compare_use_with_all_cands): New. (find_iv_candidates): Call relate_compare_use_with_all_cands. From 05d21bf9421fb312a3470eb232bf98cd16d072a6 Mon Sep 17 00:00:00 2001 From: Bin Cheng Date: Thu, 6 Apr 2017 10:09:18 +0100 Subject: [PATCH 18/33] relate-comp_use-with-all-cands-20170312.txt --- gcc/tree-ssa-loop-ivopts.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/gcc/tree-ssa-loop-ivopts.c b/gcc/tree-ssa-loop-ivopts.c index 2c6fa76..0f78a46 100644 --- a/gcc/tree-ssa-loop-ivopts.c +++ b/gcc/tree-ssa-loop-ivopts.c @@ -5250,6 +5250,21 @@ set_autoinc_for_original_candidates (struct ivopts_data *data) } } +/* Relate compare use with all candidates. */ + +static void +relate_compare_use_with_all_cands (struct ivopts_data *data) +{ + unsigned i, max_id = data->vcands.length () - 1; + for (i = 0; i < data->vgroups.length (); i++) + { + struct iv_group *group = data->vgroups[i]; + + if (group->type == USE_COMPARE) + bitmap_set_range (group->related_cands, 0, max_id); + } +} + /* Finds the candidates for the induction variables. */ static void @@ -5269,6 +5284,10 @@ find_iv_candidates (struct ivopts_data *data) /* Record the important candidates. */ record_important_candidates (data); + /* Relate compare iv_use with all candidates. */ + if (!data->consider_all_candidates) + relate_compare_use_with_all_cands (data); + if (dump_file && (dump_flags & TDF_DETAILS)) { unsigned i;