diff mbox

[AArch64] Adjust generic move costs

Message ID 000101d00018$449fc1c0$cddf4540$@com
State New
Headers show

Commit Message

Wilco Nov. 14, 2014, 2:35 p.m. UTC
Hi,

This patch adjusts the generic move costs to better reflect the INT<->FP move costs used in the
various core specific cost tables.

The intention of these generic costs is that they provide reasonable performance across a range of
cores without unduly pessimizing any one specific core.

This adjustment is sufficient to prevent the register allocator inserting huge amounts of
unnecessary int<->FP moves. The GP2FP/FP2GP costs must be larger than the memory cost to avoid the
worst of this issue. In sha2 this replaces all 642 redundant fp moves with 35 load and 7 store
spills.

OK for commit?

ChangeLog:
2014-11-14  Wilco Dijkstra  <wdijkstr@arm.com>

	* gcc/config/aarch64/aarch64.c (generic_regmove_cost):
	Increase FP move cost.

---
 gcc/config/aarch64/aarch64.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

Comments

Marcus Shawcroft Nov. 17, 2014, 5:13 p.m. UTC | #1
On 14 November 2014 14:35, Wilco Dijkstra <wdijkstr@arm.com> wrote:

> 2014-11-14  Wilco Dijkstra  <wdijkstr@arm.com>
>
>         * gcc/config/aarch64/aarch64.c (generic_regmove_cost):
>         Increase FP move cost.

OK /Marcus
Ramana Radhakrishnan Nov. 18, 2014, 3:48 p.m. UTC | #2
On Mon, Nov 17, 2014 at 5:13 PM, Marcus Shawcroft
<marcus.shawcroft@gmail.com> wrote:
> On 14 November 2014 14:35, Wilco Dijkstra <wdijkstr@arm.com> wrote:
>
>> 2014-11-14  Wilco Dijkstra  <wdijkstr@arm.com>
>>
>>         * gcc/config/aarch64/aarch64.c (generic_regmove_cost):
>>         Increase FP move cost.
>
> OK /Marcus

Changelog should probably indicate PR target/61915 when committing ?

Ramana
diff mbox

Patch

diff --git a/gcc/config/aarch64/aarch64.c b/gcc/config/aarch64/aarch64.c
index de53c94..cd30724 100644
--- a/gcc/config/aarch64/aarch64.c
+++ b/gcc/config/aarch64/aarch64.c
@@ -218,8 +218,10 @@  __extension__
 static const struct cpu_regmove_cost generic_regmove_cost =
 {
   NAMED_PARAM (GP2GP, 1),
-  NAMED_PARAM (GP2FP, 2),
-  NAMED_PARAM (FP2GP, 2),
+  /* Avoid the use of slow int<->fp moves for spilling by setting
+     their cost higher than memmov_cost.  */
+  NAMED_PARAM (GP2FP, 5),
+  NAMED_PARAM (FP2GP, 5),
   NAMED_PARAM (FP2FP, 2)
 };