From patchwork Thu Nov 10 17:19:02 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wilco Dijkstra X-Patchwork-Id: 693381 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 3tF8t641Nzz9rvt for ; Fri, 11 Nov 2016 04:19:26 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="ns0cWga/"; 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 :content-transfer-encoding:mime-version; q=dns; s=default; b=in3 P9I64k98rL6ISm1GwQ+yWGAO9MYzto/WCfMOM4/643frtBeg84ZYvBlmINWE8bww iaGRLTZ1ATBMa8svW+SS+EPTX4qtBbYYWJ45BrjbtNkszcE4WllVJKXSza+Cd9Ur QWdQNk3ncizEnsTZM4x2DZEmN2Lb5iPE/YGZKxEg= 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 :content-transfer-encoding:mime-version; s=default; bh=jPJ/RiupU +T9ZlWEIpy5jNZpbxA=; b=ns0cWga/7UUJG976m2aL4QAiyJuP0LYhNiLWdLsc4 FOyZ1WjwTUzmxLnj/EuqOJ0CJEhpunq85segx+b8clcPs4rH1gLktjxXUY/yCa2h ruuLTY1X6G738viK8kEz8Gpevg3MiZf9E1BLiBsWwmcnfyFHrpFbGxlGcNY2TdMM 5A= Received: (qmail 96479 invoked by alias); 10 Nov 2016 17:19:16 -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 96457 invoked by uid 89); 10 Nov 2016 17:19:15 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=AWL, BAYES_00, RCVD_IN_DNSWL_NONE, SPF_HELO_PASS, SPF_PASS autolearn=ham version=3.3.2 spammy=tone, Limit X-HELO: EUR02-VE1-obe.outbound.protection.outlook.com Received: from mail-eopbgr20063.outbound.protection.outlook.com (HELO EUR02-VE1-obe.outbound.protection.outlook.com) (40.107.2.63) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 10 Nov 2016 17:19:05 +0000 Received: from AM5PR0802MB2610.eurprd08.prod.outlook.com (10.175.46.18) by AM5PR0802MB2609.eurprd08.prod.outlook.com (10.175.46.17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.707.6; Thu, 10 Nov 2016 17:19:02 +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.0721.010; Thu, 10 Nov 2016 17:19:02 +0000 From: Wilco Dijkstra To: GCC Patches CC: nd Subject: [PATCH][ARM] Improve max_insns_skipped logic Date: Thu, 10 Nov 2016 17:19:02 +0000 Message-ID: authentication-results: spf=none (sender IP is ) smtp.mailfrom=Wilco.Dijkstra@arm.com; x-microsoft-exchange-diagnostics: 1; AM5PR0802MB2609; 7:BZ1g8gnn/eRkuSA7a9bfDLsRi2TKRDGL6s0ysCmzSri3WFPivZRITbKl7UqYz6gSeMBDAZu7PKz/UXpW/fRY1vtDkQcF4X+3Lrz2uLiyudKh94ovxEzqA5Z3Utcl30iQ69X6pewbftZRLCT0m3+43OTWmScAEr6Ak7IhdFGlg2F3eYzRfC2+7KqF2xKKOu89w/TJfJg3yhcNFBwGSNhWw6tZ++++47+ldw5/stgM2LlQlZTy+wuuAqZtfA3XUWYMyH5jloxnKLMhKh4HmAJ4wYQB+bbT7fd/zCkljpQgYHroFEyINYBNTp5KxTm0NTedIajPD72hUpzOQB61mlxB4FJrfkmxY5Od9o2DD9QS0ac= x-ms-office365-filtering-correlation-id: 9731079b-405a-48d5-f25b-08d4098daab3 x-microsoft-antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001); SRVR:AM5PR0802MB2609; nodisclaimer: True x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(180628864354917); x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(6040176)(601004)(2401047)(5005006)(8121501046)(10201501046)(3002001)(6055026); SRVR:AM5PR0802MB2609; BCL:0; PCL:0; RULEID:; SRVR:AM5PR0802MB2609; x-forefront-prvs: 01221E3973 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(6009001)(7916002)(199003)(377424004)(189002)(54534003)(450100001)(66066001)(101416001)(86362001)(6116002)(102836003)(77096005)(7736002)(68736007)(305945005)(74316002)(189998001)(8936002)(3846002)(586003)(122556002)(33656002)(9686002)(76576001)(7846002)(2906002)(92566002)(106356001)(110136003)(106116001)(7696004)(105586002)(4326007)(3660700001)(6916009)(97736004)(5660300001)(50986999)(54356999)(87936001)(2900100001)(81156014)(3280700002)(8676002)(81166006); DIR:OUT; SFP:1101; SCL:1; SRVR:AM5PR0802MB2609; H:AM5PR0802MB2610.eurprd08.prod.outlook.com; FPR:; SPF:None; PTR:InfoNoRecords; A:1; MX: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: 10 Nov 2016 17:19:02.3469 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM5PR0802MB2609 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