This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH][ARM] Improve max_insns_skipped logic
- From: Wilco Dijkstra <Wilco dot Dijkstra at arm dot com>
- To: GCC Patches <gcc-patches at gcc dot gnu dot org>, Richard Earnshaw <Richard dot Earnshaw at arm dot com>, Kyrylo Tkachov <Kyrylo dot Tkachov at arm dot com>
- Cc: nd <nd at arm dot com>
- Date: Thu, 2 Feb 2017 14:45:09 +0000
- Subject: Re: [PATCH][ARM] Improve max_insns_skipped logic
- Authentication-results: sourceware.org; auth=none
- Authentication-results: spf=none (sender IP is ) smtp.mailfrom=Wilco dot Dijkstra at arm dot com;
- Nodisclaimer: True
- References: <AM5PR0802MB2610A85D93128828E83A0C3C83B80@AM5PR0802MB2610.eurprd08.prod.outlook.com>,<VI1PR0802MB2621D7E7085A22A196DF563483820@VI1PR0802MB2621.eurprd08.prod.outlook.com>,<AM5PR0802MB26109C998E091E30B873F783839A0@AM5PR0802MB2610.eurprd08.prod.outlook.com>,<AM5PR0802MB2610B123F76CF88542152AAB837C0@AM5PR0802MB2610.eurprd08.prod.outlook.com>
- Spamdiagnosticmetadata: NSPM
- Spamdiagnosticoutput: 1:99
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 <wdijkstr@arm.com>
* 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