From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 40132 invoked by alias); 20 Apr 2017 16:02:34 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 39996 invoked by uid 89); 20 Apr 2017 16:02:34 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-24.7 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=november, November X-HELO: EUR02-HE1-obe.outbound.protection.outlook.com Received: from mail-eopbgr10059.outbound.protection.outlook.com (HELO EUR02-HE1-obe.outbound.protection.outlook.com) (40.107.1.59) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 20 Apr 2017 16:02:33 +0000 Received: from AM5PR0802MB2610.eurprd08.prod.outlook.com (10.175.46.18) by AM5PR0802MB2388.eurprd08.prod.outlook.com (10.175.43.150) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1047.13; Thu, 20 Apr 2017 16:02:31 +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.1047.013; Thu, 20 Apr 2017 16:02:31 +0000 From: Wilco Dijkstra To: GCC Patches , Kyrylo Tkachov CC: nd , Richard Earnshaw Subject: Re: [PATCH][ARM] Improve max_insns_skipped logic Date: Thu, 20 Apr 2017 16:05:00 -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-microsoft-exchange-diagnostics: 1;AM5PR0802MB2388;7:2wvEgHArzyMPPtfK9x5a/url9bmvN1XuJt+46UeR53K1laa/Itg2kd7O4Z31joS1YXsPGzSD203jnaFeC6YyFP/WO9DJxDwfvNIJ1AebFajw2635uKfg3YEXW1lsaa+JF5ZCZG/h4hrqFhWp35u8SNG9aqQzYmjgp45PaxrOhduY2W9rAV/YduKiqPLJEpQ7jW2w6ZcMreS0X+nJ1rsGZAxx8IbO98J+Rf7MZGOeSZuGbP2QjnCNkexfrezvATuyLdFUqsCxlBQ0KBlJ55YdV0/fcF7v6D1yKMlY6fVcYbmibk0a32Jv3OddadDOtZbDB5S3SLGnm1RrtJpJakRYwQ== x-ms-office365-filtering-correlation-id: f76f8912-7920-4482-2e75-08d48806a6e0 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:(22001)(2017030254075)(48565401081)(201703131423075)(201703031133081);SRVR:AM5PR0802MB2388; nodisclaimer: True x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(180628864354917); x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(6040450)(601004)(2401047)(8121501046)(5005006)(93006095)(93001095)(3002001)(10201501046)(6055026)(6041248)(20161123562025)(20161123560025)(201703131423075)(201702281528075)(201703061421075)(20161123564025)(20161123555025)(6072148);SRVR:AM5PR0802MB2388;BCL:0;PCL:0;RULEID:;SRVR:AM5PR0802MB2388; x-forefront-prvs: 02830F0362 x-forefront-antispam-report: SFV:NSPM;SFS:(10009020)(979002)(6009001)(39450400003)(39850400002)(39410400002)(39840400002)(39860400002)(39400400002)(54534003)(377424004)(189002)(199003)(54906002)(6246003)(229853002)(99286003)(55016002)(86362001)(6636002)(7696004)(66066001)(189998001)(53936002)(9686003)(5660300001)(2950100002)(6506006)(4326008)(33656002)(76176999)(102836003)(6116002)(54356999)(3846002)(50986999)(2900100001)(8936002)(77096006)(6436002)(8676002)(74316002)(81166006)(122556002)(3280700002)(2906002)(53546009)(25786009)(3660700001)(305945005)(38730400002)(7736002)(969003)(989001)(999001)(1009001)(1019001);DIR:OUT;SFP:1101;SCL:1;SRVR:AM5PR0802MB2388;H:AM5PR0802MB2610.eurprd08.prod.outlook.com;FPR:;SPF:None;MLV:ovrnspm;PTR:InfoNoRecords;MX:1;A:1;LANG:en; spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-originalarrivaltime: 20 Apr 2017 16:02:31.5162 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM5PR0802MB2388 X-SW-Source: 2017-04/txt/msg00905.txt.bz2 ping From: Wilco Dijkstra Sent: 10 November 2016 17:19 To: GCC Patches Cc: nd Subject: [PATCH][ARM] Improve max_insns_skipped logic =A0=20=20=20 Improve the logic when setting max_insns_skipped.=A0 Limit the maximum size= of IT to MAX_INSN_PER_IT_BLOCK as otherwise multiple IT instructions are needed, increasing codesize.=A0 Given 4 works well for Thumb-2, use the same limit = for ARM for consistency.=20 ChangeLog: 2016-11-04=A0 Wilco Dijkstra=A0 =A0=A0=A0=A0=A0=A0=A0 * config/arm/arm.c (arm_option_params_internal): Impr= ove setting of =A0=A0=A0=A0=A0=A0=A0 max_insns_skipped. -- diff --git a/gcc/config/arm/arm.c b/gcc/config/arm/arm.c index f046854e9665d54911616fc1c60fee407188f7d6..29e8d1d07d918fbb2a627a65351= 0dfc8587ee01a 100644 --- a/gcc/config/arm/arm.c +++ b/gcc/config/arm/arm.c @@ -2901,20 +2901,12 @@ arm_option_params_internal (void) =A0=A0=A0=A0=A0=A0 targetm.max_anchor_offset =3D TARGET_MAX_ANCHOR_OFFSET; =A0=A0=A0=A0 } =A0 -=A0 if (optimize_size) -=A0=A0=A0 { -=A0=A0=A0=A0=A0 /* If optimizing for size, bump the number of instructions= that we -=A0=A0=A0=A0=A0=A0=A0=A0 are prepared to conditionally execute (even on a = StrongARM).=A0 */ -=A0=A0=A0=A0=A0 max_insns_skipped =3D 6; +=A0 /* Increase the number of conditional instructions with -Os.=A0 */ +=A0 max_insns_skipped =3D optimize_size ? 4 : current_tune->max_insns_skip= ped; =A0 -=A0=A0=A0=A0=A0 /* For THUMB2, we limit the conditional sequence to one IT= block.=A0 */ -=A0=A0=A0=A0=A0 if (TARGET_THUMB2) -=A0=A0=A0=A0=A0=A0=A0 max_insns_skipped =3D arm_restrict_it ? 1 : 4; -=A0=A0=A0 } -=A0 else -=A0=A0=A0 /* When -mrestrict-it is in use tone down the if-conversion.=A0 = */ -=A0=A0=A0 max_insns_skipped =3D (TARGET_THUMB2 && arm_restrict_it) -=A0=A0=A0=A0=A0 ? 1 : current_tune->max_insns_skipped; +=A0 /* For THUMB2, we limit the conditional sequence to one IT block.=A0 */ +=A0 if (TARGET_THUMB2) +=A0=A0=A0 max_insns_skipped =3D MIN (max_insns_skipped, MAX_INSN_PER_IT_BL= OCK); =A0} =A0 =A0/* True if -mflip-thumb should next add an attribute for the default =20=20=20=20