From patchwork Tue Jun 27 15:38:35 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Wilco Dijkstra X-Patchwork-Id: 781272 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 3wxqpK6ggKz9ryT for ; Wed, 28 Jun 2017 01:38:49 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="qlua54Le"; 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:references:in-reply-to :content-type:content-transfer-encoding:mime-version; q=dns; s= default; b=motaPhLic6/BNqMTNXToQomUOF52PaGC9qMrkE187wQ+IHgn5QndO RUbWbsruBpetHhi4N9F8/LYEY0Nnnwc8faiWtsj6A/zBnBiikrRvC+cAhuGjs30Q VwqN97Yl3tE4I0KJGIo20ERBKzUFZ1f7VOor8+sMDl5sE61oQiUlpE= 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:references:in-reply-to :content-type:content-transfer-encoding:mime-version; s=default; bh=OKESkOzqTjfdapMz2KSTeRBsUd8=; b=qlua54Led/njJyfTuEez491n99l6 yHvCPcdA/gZ1ZouUYlC7FBfYugmXQh5epIb5CFpulqMsyBNigT4Z8wzTvC6r1dm6 9Tn/rU0byg8pAxxxEWIigwW5S6WULyPtXd8eVkwU+AUC7TrKurq9aDEJhfhwGW76 ZOE9CWOsqpiuTAE= Received: (qmail 49848 invoked by alias); 27 Jun 2017 15:38:40 -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 49839 invoked by uid 89); 27 Jun 2017 15:38: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=tone X-HELO: EUR01-DB5-obe.outbound.protection.outlook.com Received: from mail-db5eur01on0064.outbound.protection.outlook.com (HELO EUR01-DB5-obe.outbound.protection.outlook.com) (104.47.2.64) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 27 Jun 2017 15:38:38 +0000 Received: from AM5PR0802MB2610.eurprd08.prod.outlook.com (10.175.46.18) by AM5PR0802MB2387.eurprd08.prod.outlook.com (10.175.43.149) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1199.15; Tue, 27 Jun 2017 15:38:35 +0000 Received: from AM5PR0802MB2610.eurprd08.prod.outlook.com ([fe80::a81e:e7d3:8fc6:7bb5]) by AM5PR0802MB2610.eurprd08.prod.outlook.com ([fe80::a81e:e7d3:8fc6:7bb5%18]) with mapi id 15.01.1220.011; Tue, 27 Jun 2017 15:38:35 +0000 From: Wilco Dijkstra To: GCC Patches , Kyrylo Tkachov CC: nd , Richard Earnshaw Subject: Re: [PATCH][ARM] Improve max_insns_skipped logic Date: Tue, 27 Jun 2017 15:38:35 +0000 Message-ID: References: , , In-Reply-To: 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; AM5PR0802MB2387; 7:Hqy8qr4DiCvzo0bVrIfVYPrMXu8SZAq2zIVzI20onxE2FcTfqMble58yzveNX2PS9hjFXJ1PooLBftMCKw3grfrQ9m0tDQW4m0gINxS0L/6wuVdVWrLDltFuJRETfluSEQ+fIMYEMEwplhiC2/z9zAO16BsZZwjeM6sg0AjVaQiLSEDs7YIRMNqBV/VvXvhqtJlumM7jcKJCP26dzMsaAYjd6GydkTi1VD2muvLT6H4T5NmV8zUtHS+Z2pn0sh/XLiA/ZteatwDajljGLt6tVtl8vqY1f/boiV6Kg6LyThHE9Wd0wOkcznpzL1bfdtUFdsbCy+JAyD9h6kgF3GjHl5Vu1eRrcvI4uPUqcfUMM7+xiJvN2y7zlBu50z94gbwW6XVW37MNtPol1F1ouFQEjCkTqKOZuEM0MyyaDGlKRluC//G8jv/IyAU7yrktGNiOQ294//WdgX5Z2ttSOjUEtuM4dJADCXidEUKJjgaoMOLExnTBSKmWsX3xNDq+WjTEfdAZUDUQdWzY8VzqVL8+am8FBT/qgPa1x2J1t/rznGEdZujUQ4InDFVmpjw2GTsrgqkd83/t5KIL5hLX56UQedRfORsIKz8RTK2XTwkMiyE2K9YbcujSabTY7PEJiTt9H9MUljKIaoOKgvFfGjW0PsnZXFVbLq1+qG1PHvHYFNZi0e4esJuAmyrKcJTjmfsuhTLOtGjB+DlQk4fLcDRHbAbVmu9U+JBOil0kko7FwFh2zszwI9S/tUFSlysqLIEj9SFotev0aF5dB6xaR0/AMEohDtXUt2cLbkTRtckaWD8= x-ms-office365-filtering-correlation-id: 4b670bc0-38af-437e-86e8-08d4bd7292ce x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: UriScan:; BCL:0; PCL:0; RULEID:(300000500095)(300135000095)(300000501095)(300135300095)(22001)(300000502095)(300135100095)(2017030254075)(48565401081)(300000503095)(300135400095)(201703131423075)(201703031133081)(201702281549075)(300000504095)(300135200095)(300000505095)(300135600095)(300000506067)(300135500095); SRVR:AM5PR0802MB2387; x-ms-traffictypediagnostic: AM5PR0802MB2387: nodisclaimer: True x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(180628864354917)(236129657087228)(247924648384137); x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(601004)(2401047)(8121501046)(5005006)(100000703101)(100105400095)(10201501046)(93006095)(93001095)(3002001)(6055026)(6041248)(20161123564025)(20161123555025)(20161123560025)(20161123558100)(20161123562025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(6072148)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:AM5PR0802MB2387; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:AM5PR0802MB2387; x-forefront-prvs: 0351D213B3 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(6009001)(39840400002)(39450400003)(39860400002)(39850400002)(39410400002)(39400400002)(377424004)(8676002)(14454004)(6436002)(76176999)(25786009)(6506006)(6116002)(54356999)(50986999)(7736002)(189998001)(102836003)(4326008)(2906002)(74316002)(81166006)(5660300001)(55016002)(2900100001)(6636002)(305945005)(229853002)(72206003)(3660700001)(478600001)(8936002)(2950100002)(6246003)(9686003)(86362001)(3280700002)(53546010)(7696004)(5250100002)(99286003)(54906002)(38730400002)(33656002)(53936002); DIR:OUT; SFP:1101; SCL:1; SRVR:AM5PR0802MB2387; H:AM5PR0802MB2610.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: 27 Jun 2017 15:38:35.0740 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM5PR0802MB2387 ping From: Wilco Dijkstra Sent: 10 November 2016 17:19 To: GCC Patches Cc: nd Subject: [PATCH][ARM] Improve max_insns_skipped logic     Improve the logic when setting max_insns_skipped.  Limit the maximum size of IT to MAX_INSN_PER_IT_BLOCK as otherwise multiple IT instructions are needed, increasing codesize.  Given 4 works well for Thumb-2, use the same limit for ARM for consistency. ChangeLog: 2016-11-04  Wilco Dijkstra          * config/arm/arm.c (arm_option_params_internal): Improve setting of         max_insns_skipped. diff --git a/gcc/config/arm/arm.c b/gcc/config/arm/arm.c index f046854e9665d54911616fc1c60fee407188f7d6..29e8d1d07d918fbb2a627a653510dfc8587ee01a 100644 --- a/gcc/config/arm/arm.c +++ b/gcc/config/arm/arm.c @@ -2901,20 +2901,12 @@ arm_option_params_internal (void)        targetm.max_anchor_offset = TARGET_MAX_ANCHOR_OFFSET;      }   -  if (optimize_size) -    { -      /* If optimizing for size, bump the number of instructions that we -         are prepared to conditionally execute (even on a StrongARM).  */ -      max_insns_skipped = 6; +  /* Increase the number of conditional instructions with -Os.  */ +  max_insns_skipped = optimize_size ? 4 : current_tune->max_insns_skipped;   -      /* For THUMB2, we limit the conditional sequence to one IT block.  */ -      if (TARGET_THUMB2) -        max_insns_skipped = arm_restrict_it ? 1 : 4; -    } -  else -    /* When -mrestrict-it is in use tone down the if-conversion.  */ -    max_insns_skipped = (TARGET_THUMB2 && arm_restrict_it) -      ? 1 : current_tune->max_insns_skipped; +  /* For THUMB2, we limit the conditional sequence to one IT block.  */ +  if (TARGET_THUMB2) +    max_insns_skipped = MIN (max_insns_skipped, MAX_INSN_PER_IT_BLOCK);  }    /* True if -mflip-thumb should next add an attribute for the default