From: Wilco Dijkstra <Wilco.Dijkstra@arm.com>
To: GCC Patches <gcc-patches@gcc.gnu.org>
Cc: Richard Sandiford <Richard.Sandiford@arm.com>,
Kyrylo Tkachov <Kyrylo.Tkachov@arm.com>
Subject: [PATCH] AArch64: Tune case-values-threshold
Date: Mon, 18 Oct 2021 16:19:00 +0000 [thread overview]
Message-ID: <VE1PR08MB559988D252EEABF494E24BAD83BC9@VE1PR08MB5599.eurprd08.prod.outlook.com> (raw)
Tune the case-values-threshold setting for modern cores. A value of 11 improves
SPECINT2017 by 0.2% and reduces codesize by 0.04%. With -Os use value 8 which
reduces codesize by 0.07%.
Passes regress, OK for commit?
ChangeLog:
2021-10-18 Wilco Dijkstra <wdijkstr@arm.com>
* config/aarch64/aarch64.c (aarch64_case_values_threshold):
Change to 8 with -Os, 11 otherwise.
---
diff --git a/gcc/config/aarch64/aarch64.c b/gcc/config/aarch64/aarch64.c
index f5b25a7f7041645921e6ad85714efda73b993492..adc5256c5ccc1182710d87cc6a1091083d888663 100644
--- a/gcc/config/aarch64/aarch64.c
+++ b/gcc/config/aarch64/aarch64.c
@@ -9360,8 +9360,8 @@ aarch64_cannot_force_const_mem (machine_mode mode ATTRIBUTE_UNUSED, rtx x)
The expansion for a table switch is quite expensive due to the number
of instructions, the table lookup and hard to predict indirect jump.
When optimizing for speed, and -O3 enabled, use the per-core tuning if
- set, otherwise use tables for > 16 cases as a tradeoff between size and
- performance. When optimizing for size, use the default setting. */
+ set, otherwise use tables for >= 11 cases as a tradeoff between size and
+ performance. When optimizing for size, use 8 for smallest codesize. */
static unsigned int
aarch64_case_values_threshold (void)
@@ -9372,7 +9372,7 @@ aarch64_case_values_threshold (void)
&& selected_cpu->tune->max_case_values != 0)
return selected_cpu->tune->max_case_values;
else
- return optimize_size ? default_case_values_threshold () : 17;
+ return optimize_size ? 8 : 11;
}
/* Return true if register REGNO is a valid index register.
next reply other threads:[~2021-10-18 16:19 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-10-18 16:19 Wilco Dijkstra [this message]
2021-10-18 16:31 ` Richard Sandiford
2021-10-19 12:57 ` Wilco Dijkstra
2021-10-19 13:23 ` Richard Sandiford
2021-10-19 14:37 ` Bernhard Reutner-Fischer
2021-10-19 14:55 ` Wilco Dijkstra
2021-10-20 11:30 ` Richard Sandiford
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=VE1PR08MB559988D252EEABF494E24BAD83BC9@VE1PR08MB5599.eurprd08.prod.outlook.com \
--to=wilco.dijkstra@arm.com \
--cc=Kyrylo.Tkachov@arm.com \
--cc=Richard.Sandiford@arm.com \
--cc=gcc-patches@gcc.gnu.org \
/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).