This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH][ARM] Do not lower cost of setting core reg to constant. It doesn't have any effect


Hi all,

This hunk that slightly reduces the cost of immediate moves doesn't actually have any effect.
In the whole of SPEC2006 it didn't make a difference. In any case, I'd like to move to a point
where we use COSTS_N_INSNS units for our costs and not increment decrement them by one.

This patch removes that bit of logic and makes it slightly cleaner to look at. As far as I know
its logic has never been confirmed in practice.

Bootstrapped and tested on arm.

Ok for trunk?

Thanks,
Kyrill

2015-04-22  Kyrylo Tkachov  <kyrylo.tkachov@arm.com>

    * config/arm/arm.c (arm_new_rtx_costs): Do not lower cost
    immediate moves.
commit e225669ff70f09520007b7898b170fb8fa75281f
Author: Kyrylo Tkachov <kyrylo.tkachov@arm.com>
Date:   Wed Apr 8 10:18:23 2015 +0100

    [ARM] Do not lower cost of setting core reg to constant. It doesn't have any effect

diff --git a/gcc/config/arm/arm.c b/gcc/config/arm/arm.c
index 0ef05c9..03988ac 100644
--- a/gcc/config/arm/arm.c
+++ b/gcc/config/arm/arm.c
@@ -9725,11 +9725,7 @@ arm_new_rtx_costs (rtx x, enum rtx_code code, enum rtx_code outer_code,
 	     and we would otherwise be unable to work out the true cost.  */
 	  *cost = rtx_cost (SET_DEST (x), SET, 0, speed_p);
 	  outer_code = SET;
-	  /* Slightly lower the cost of setting a core reg to a constant.
-	     This helps break up chains and allows for better scheduling.  */
-	  if (REG_P (SET_DEST (x))
-	      && REGNO (SET_DEST (x)) <= LR_REGNUM)
-	    *cost -= 1;
+
 	  x = SET_SRC (x);
 	  /* Immediate moves with an immediate in the range [0, 255] can be
 	     encoded in 16 bits in Thumb mode.  */

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]