Hi,

This is a set of patches improving register costs on AArch64. The first fixes
aarch64_register_move_cost() to support CALLER_SAVE_REGS and POINTER_REGS so 
costs are calculated
correctly in the register allocator.

ChangeLog:
2014-09-04  Wilco Dijkstra  <wdijk...@arm.com>

        * gcc/config/aarch64/aarch64.c (aarch64_register_move_cost):
        Add cost handling of CALLER_SAVE_REGS and POINTER_REGS.

---
 gcc/config/aarch64/aarch64.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/gcc/config/aarch64/aarch64.c b/gcc/config/aarch64/aarch64.c
index befdfbb..6245f59 100644
--- a/gcc/config/aarch64/aarch64.c
+++ b/gcc/config/aarch64/aarch64.c
@@ -5817,6 +5817,13 @@ aarch64_register_move_cost (enum machine_mode mode,
   const struct cpu_regmove_cost *regmove_cost
     = aarch64_tune_params->regmove_cost;
 
+  /* Caller save and pointer regs are equivalent to GENERAL_REGS.  */
+  if (to == CALLER_SAVE_REGS || to == POINTER_REGS)
+    to = GENERAL_REGS;
+
+  if (from == CALLER_SAVE_REGS || from == POINTER_REGS)
+    from = GENERAL_REGS;
+
   /* Moving between GPR and stack cost is the same as GP2GP.  */
   if ((from == GENERAL_REGS && to == STACK_REG)
       || (to == GENERAL_REGS && from == STACK_REG))
-- 
1.9.1


Reply via email to