From patchwork Thu Feb 23 16:57:43 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Wilco Dijkstra X-Patchwork-Id: 731587 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 3vTgR63NJmz9s7N for ; Fri, 24 Feb 2017 03:58:09 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="v3fIxmuu"; 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=yJJtksWx3pC5jqY1+TOyoc4HApUnr+1Xd5eqMI0UTvMKeu9NQojfH DD6VQ/GHXL0Lnej5XXvUKuWigPAyNvvdr7ey2omppJfxPEWObJ+4H05RDvzrUX5f fQiLe++rKz/6SFEXEiIIY89NKhoj6KbfzcTpCPLNftJsiMUI1TRIeI= 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=EHI1Tz+9V8GyEiL/cBOWla8WRas=; b=v3fIxmuuyWwiSyQ7UaCSeYDXlcsF FUzf+d+s0pXpk/UZsz62/xHJSmMdVFjO30hKErYGoIUIP4BUikFRKhghKEZJSe4E kP9Bt6paPjTHbk3dcHgDYppH22niuHD92R2RuLXBt4Y9DN9IbGBPT/Rupb8h/9ST 0V3v45TInAvgh/E= Received: (qmail 129279 invoked by alias); 23 Feb 2017 16:57:52 -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 129197 invoked by uid 89); 23 Feb 2017 16:57:51 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-24.4 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=tone, increasing, HContent-Language:en-GB X-HELO: EUR01-DB5-obe.outbound.protection.outlook.com Received: from mail-db5eur01on0072.outbound.protection.outlook.com (HELO EUR01-DB5-obe.outbound.protection.outlook.com) (104.47.2.72) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 23 Feb 2017 16:57:48 +0000 Received: from AM5PR0802MB2610.eurprd08.prod.outlook.com (10.175.46.18) by AM5PR0802MB2385.eurprd08.prod.outlook.com (10.175.43.147) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.933.12; Thu, 23 Feb 2017 16:57:44 +0000 Received: from AM5PR0802MB2610.eurprd08.prod.outlook.com ([10.175.46.18]) by AM5PR0802MB2610.eurprd08.prod.outlook.com ([10.175.46.18]) with mapi id 15.01.0933.011; Thu, 23 Feb 2017 16:57:44 +0000 From: Wilco Dijkstra To: GCC Patches , Richard Earnshaw , Kyrylo Tkachov CC: nd Subject: Re: [PATCH][ARM] Improve max_insns_skipped logic Date: Thu, 23 Feb 2017 16:57:43 +0000 Message-ID: References: , , , , In-Reply-To: authentication-results: spf=none (sender IP is ) smtp.mailfrom=Wilco.Dijkstra@arm.com; x-ms-office365-filtering-correlation-id: 3c46b7f2-2b13-4974-4373-08d45c0d1610 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(48565401081); SRVR:AM5PR0802MB2385; x-microsoft-exchange-diagnostics: 1; AM5PR0802MB2385; 7:4pXZRFA5L0oSE2JSo0HD0guZf4P+Z4p0PO0pJ81w1LlvFMtU+FsqSkoSWNGqvVGHvJZxgVi3cgMkOUvXcS9Z2TJvzMHr/I3zUIDRapMcAvfaBHr1pnMf+V2fj0tRWAZwqAtfy9cG2cH7nMGeXs6fi9LLit9vHzOtFckMPSuFvg16VoncWH5UN9K6ef7j1lGJ6GJ4kJlJqb/16YSwZmfTU0E7AO5awGXAIXodZZ+COv1IuY7Cg4h44t6wRVTbwLO3QVgyV/Fsh0tNLOuA4YCzi8ygz5sIOCre8W2S0X/bqYBSerITEj8aqXwYGDcjV8Qrs6mBflbCkfqgFnu16iZAUQ== nodisclaimer: True x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(180628864354917); x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(6040375)(601004)(2401047)(8121501046)(5005006)(3002001)(10201501046)(6055026)(6041248)(20161123562025)(20161123558025)(20161123560025)(20161123564025)(20161123555025)(6072148); SRVR:AM5PR0802MB2385; BCL:0; PCL:0; RULEID:; SRVR:AM5PR0802MB2385; x-forefront-prvs: 02272225C5 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(6009001)(7916002)(39410400002)(39860400002)(39840400002)(39450400003)(39850400002)(189002)(377424004)(54534003)(199003)(305945005)(6506006)(25786008)(106116001)(7736002)(105586002)(74316002)(6436002)(3280700002)(68736007)(229853002)(106356001)(6636002)(99286003)(2950100002)(55016002)(33656002)(9686003)(81156014)(8676002)(86362001)(8936002)(81166006)(6246003)(93886004)(76176999)(54356999)(122556002)(5660300001)(38730400002)(4326007)(7696004)(2906002)(53936002)(450100001)(66066001)(101416001)(189998001)(92566002)(102836003)(3846002)(2900100001)(50986999)(3660700001)(6116002)(53546006)(77096006)(97736004); DIR:OUT; SFP:1101; SCL:1; SRVR:AM5PR0802MB2385; H:AM5PR0802MB2610.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: 23 Feb 2017 16:57:43.9126 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM5PR0802MB2385 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