This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH][AArch64] Adjust generic move costs
- From: "Wilco Dijkstra" <wdijkstr at arm dot com>
- To: <gcc-patches at gcc dot gnu dot org>
- Date: Fri, 14 Nov 2014 14:35:41 -0000
- Subject: [PATCH][AArch64] Adjust generic move costs
- Authentication-results: sourceware.org; auth=none
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(-)
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)
};
--
1.9.1