Patchwork [rs6000] Make LR/CTR moves expensive for Power7 also

login
register
mail settings
Submitter Pat Haugen
Date April 11, 2011, 8:03 p.m.
Message ID <4DA35EA3.5090606@linux.vnet.ibm.com>
Download mbox | patch
Permalink /patch/90643/
State New
Headers show

Comments

Pat Haugen - April 11, 2011, 8:03 p.m.
The following was overlooked on initial Power7 support.

Bootstrap/regtest on powerpc64-linux with no new regressions. Ok for trunk and 4.6?

-Pat


2011-04-11  Pat Haugen <pthaugen@us.ibm.com>

	* config/rs6000/rs6000.c (rs6000_register_move_cost): Make LR/CTR
	moves expensive on Power7 also.
David Edelsohn - April 11, 2011, 8:58 p.m.
On Mon, Apr 11, 2011 at 4:03 PM, Pat Haugen <pthaugen@linux.vnet.ibm.com> wrote:
> The following was overlooked on initial Power7 support.
>
> Bootstrap/regtest on powerpc64-linux with no new regressions. Ok for trunk
> and 4.6?
>
> -Pat
>
>
> 2011-04-11  Pat Haugen <pthaugen@us.ibm.com>
>
>        * config/rs6000/rs6000.c (rs6000_register_move_cost): Make LR/CTR
>        moves expensive on Power7 also.

Okay.

Thanks, David

Patch

Index: gcc/config/rs6000/rs6000.c
===================================================================
--- gcc/config/rs6000/rs6000.c	(revision 172255)
+++ gcc/config/rs6000/rs6000.c	(working copy)
@@ -26701,9 +26701,10 @@  rs6000_register_move_cost (enum machine_
        else if (from == CR_REGS)
  	ret = 4;

-      /* Power6 has slower LR/CTR moves so make them more expensive than
-	 memory in order to bias spills to memory .*/
-      else if (rs6000_cpu == PROCESSOR_POWER6
+      /* For those processors that have slow LR/CTR moves, make them more
+	 expensive than memory in order to bias spills to memory .*/
+      else if ((rs6000_cpu == PROCESSOR_POWER6
+		|| rs6000_cpu == PROCESSOR_POWER7)
  	       && reg_classes_intersect_p (from, LINK_OR_CTR_REGS))
          ret = 6 * hard_regno_nregs[0][mode];