S/390: Increase register move costs for CC_REGS

Message ID 3ddc5be6-7e0d-5168-62b2-99bbb2116672@linux.ibm.com
State New
Headers show
Series
  • S/390: Increase register move costs for CC_REGS
Related show

Commit Message

Robin Dapp Nov. 5, 2018, 2:38 p.m.
Hi,

the attached patch increases the move costs for moves involving the CC
register.  This saves us some instructions in SPEC CPU2006.

Regards
 Robin

--

gcc/ChangeLog:

2018-11-05  Robin Dapp  <rdapp@linux.ibm.com>

	* config/s390/s390.c (s390_register_move_cost): Increase costs
	for moves involving the CC reg.

Comments

Andreas Krebbel Nov. 5, 2018, 4:39 p.m. | #1
On 05.11.18 15:38, Robin Dapp wrote:
> Hi,

> 

> the attached patch increases the move costs for moves involving the CC

> register.  This saves us some instructions in SPEC CPU2006.

> 

> Regards

>  Robin

> 

> --

> 

> gcc/ChangeLog:

> 

> 2018-11-05  Robin Dapp  <rdapp@linux.ibm.com>

> 

> 	* config/s390/s390.c (s390_register_move_cost): Increase costs

> 	for moves involving the CC reg.

> 


Ok. Thanks!

Andreas

Patch

diff --git a/gcc/config/s390/s390.c b/gcc/config/s390/s390.c
index 762c6bff07b..0f33101d779 100644
--- a/gcc/config/s390/s390.c
+++ b/gcc/config/s390/s390.c
@@ -3416,6 +3416,11 @@  s390_register_move_cost (machine_mode mode,
 	  && reg_classes_intersect_p (to, GENERAL_REGS)))
     return 10;
 
+  /* We usually do not want to copy via CC.  */
+  if (reg_classes_intersect_p (from, CC_REGS)
+       || reg_classes_intersect_p (to, CC_REGS))
+    return 5;
+
   return 1;
 }