[AArch64] Add cost handling of CALLER_SAVE_REGS and POINTER_REGS
authorWilco Dijkstra <wdijkstr@arm.com>
Fri, 12 Sep 2014 09:39:42 +0000 (09:39 +0000)
committerJiong Wang <jiwang@gcc.gnu.org>
Fri, 12 Sep 2014 09:39:42 +0000 (09:39 +0000)
2014-09-12  Wilco Dijkstra  <wdijkstr@arm.com>

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

From-SVN: r215206

gcc/ChangeLog
gcc/config/aarch64/aarch64.c

index 4d43c393d30f71fd4dc98c2906eacb47bc5c16d6..37202e8c87cf9c32c8ff760b2f824c0062af31f9 100644 (file)
@@ -1,3 +1,8 @@
+2014-09-12  Wilco Dijkstra  <wilco.dijkstra@arm.com>
+
+       * config/aarch64/aarch64.c (aarch64_register_move_cost): Add cost
+       handling of CALLER_SAVE_REGS and POINTER_REGS.
+
 2014-09-12  Wilco Dijkstra  <wilco.dijkstra@arm.com>
 
        * gcc/ree.c (combine_reaching_defs): Ensure inserted copy don't change
index 6bb10db8a9408b23360d2c3d5fe508471d958719..6f21fd9239bbf6325729ce59bb2bf708ee8a9faa 100644 (file)
@@ -5932,6 +5932,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))