From: Kyrill Tkachov <kyrylo.tkachov@foss.arm.com>
To: Wilco Dijkstra <Wilco.Dijkstra@arm.com>,
GCC Patches <gcc-patches@gcc.gnu.org>
Cc: nd <nd@arm.com>, Richard Earnshaw <Richard.Earnshaw@arm.com>
Subject: Re: [PATCH][ARM] Improve max_insns_skipped logic
Date: Mon, 04 Sep 2017 16:52:00 -0000 [thread overview]
Message-ID: <59AD84DE.20601@foss.arm.com> (raw)
In-Reply-To: <AM5PR0802MB26107011663DF719F014F84183DC0@AM5PR0802MB2610.eurprd08.prod.outlook.com>
On 27/06/17 16:38, Wilco Dijkstra wrote:
>
>
> 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);
I like the simplifications in the selection logic here :)
However, changing the value for ARM from 6 to 4 looks a bit arbitrary to me.
There's probably a reason why default values for ARM and Thumb-2 are
different
(maybe not a good one) and I'd rather not change it without some code
size data measurements.
So I'd rather not let that hold this cleanup patch though, so this is ok
(assuming a normal bootstrap and testing cycle) without changing the 6
to a 4
and you can propose a change to 4 as a separate patch that can be
discussed on its own.
Thanks,
Kyrill
> }
>
> /* True if -mflip-thumb should next add an attribute for the default
>
next prev parent reply other threads:[~2017-09-04 16:52 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-11-10 17:19 Wilco Dijkstra
2016-11-11 10:32 ` Richard Earnshaw
2016-11-11 11:42 ` Wilco Dijkstra
2016-11-14 14:15 ` Wilco Dijkstra
2016-12-06 15:05 ` Wilco Dijkstra
2016-12-14 16:39 ` Wilco Dijkstra
2017-01-17 12:16 ` Wilco Dijkstra
2017-02-02 14:45 ` Wilco Dijkstra
2017-02-23 16:58 ` Wilco Dijkstra
2017-04-20 16:05 ` Wilco Dijkstra
2017-06-13 14:00 ` Wilco Dijkstra
2017-06-27 15:38 ` Wilco Dijkstra
2017-09-04 16:52 ` Kyrill Tkachov [this message]
2017-09-05 10:32 ` Wilco Dijkstra
2017-09-05 17:16 ` Kyrill Tkachov
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=59AD84DE.20601@foss.arm.com \
--to=kyrylo.tkachov@foss.arm.com \
--cc=Richard.Earnshaw@arm.com \
--cc=Wilco.Dijkstra@arm.com \
--cc=gcc-patches@gcc.gnu.org \
--cc=nd@arm.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).