This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH, rs6000] Make LR/CTR moves expensive for Power7 also
- From: Pat Haugen <pthaugen at linux dot vnet dot ibm dot com>
- To: gcc-patches at gcc dot gnu dot org
- Cc: David Edelsohn <dje dot gcc at gmail dot com>
- Date: Mon, 11 Apr 2011 15:03:47 -0500
- Subject: [PATCH, rs6000] Make LR/CTR moves expensive for Power7 also
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.
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];