public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] S/390: Increase register move costs for CC_REGS
@ 2018-11-05 14:38 Robin Dapp
  2018-11-05 16:39 ` Andreas Krebbel
  0 siblings, 1 reply; 2+ messages in thread
From: Robin Dapp @ 2018-11-05 14:38 UTC (permalink / raw)
  To: GCC Patches; +Cc: Andreas Krebbel, Ilya Leoshkevich

[-- Attachment #1: Type: text/plain, Size: 317 bytes --]

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.

[-- Attachment #2: gcc-no-cc-reg-move.diff --]
[-- Type: text/x-patch, Size: 475 bytes --]

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;
 }
 

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] S/390: Increase register move costs for CC_REGS
  2018-11-05 14:38 [PATCH] S/390: Increase register move costs for CC_REGS Robin Dapp
@ 2018-11-05 16:39 ` Andreas Krebbel
  0 siblings, 0 replies; 2+ messages in thread
From: Andreas Krebbel @ 2018-11-05 16:39 UTC (permalink / raw)
  To: Robin Dapp, GCC Patches; +Cc: Ilya Leoshkevich

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2018-11-05 16:39 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-11-05 14:38 [PATCH] S/390: Increase register move costs for CC_REGS Robin Dapp
2018-11-05 16:39 ` Andreas Krebbel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).