public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] rs6000: Improve rtx_costs for EQ a bit (PR30967)
@ 2015-05-13 17:25 Segher Boessenkool
  2015-05-13 17:29 ` David Edelsohn
  0 siblings, 1 reply; 5+ messages in thread
From: Segher Boessenkool @ 2015-05-13 17:25 UTC (permalink / raw)
  To: gcc-patches; +Cc: dje.gcc, Segher Boessenkool

This patch changes rs6000_rtx_costs to be closer to reality.  It is
still not quite right, but at least it handles more cases, so the

	(set (reg:SI) (eq:SI (reg:SI) (reg:SI)))

from the PR isn't taken as costing 1 insn anymore, while setting
a reg:DI was cost 3 insns.  The mode of the dest doesn't matter at
all here, not for any of our current scc patterns.

Testing in progress; okay for trunk?


Segher


2015-05-13  Segher Boessenkool  <segher@kernel.crashing.org>

	PR rtl-optimization/30967
	* config/rs6000/rs6000.c (rs6000_rtx_costs): Don't consider
	destination mode for the cost of scc patterns.

---
 gcc/config/rs6000/rs6000.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gcc/config/rs6000/rs6000.c b/gcc/config/rs6000/rs6000.c
index e5b8edd..1e32144 100644
--- a/gcc/config/rs6000/rs6000.c
+++ b/gcc/config/rs6000/rs6000.c
@@ -30631,7 +30631,7 @@ rs6000_rtx_costs (rtx x, int code, int outer_code, int opno ATTRIBUTE_UNUSED,
 		*total = COSTS_N_INSNS (2);
 	      return true;
 	    }
-	  else if (mode == Pmode)
+	  else
 	    {
 	      *total = COSTS_N_INSNS (3);
 	      return false;
-- 
1.8.1.4

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

* Re: [PATCH] rs6000: Improve rtx_costs for EQ a bit (PR30967)
  2015-05-13 17:25 [PATCH] rs6000: Improve rtx_costs for EQ a bit (PR30967) Segher Boessenkool
@ 2015-05-13 17:29 ` David Edelsohn
  2015-05-13 17:53   ` Segher Boessenkool
  0 siblings, 1 reply; 5+ messages in thread
From: David Edelsohn @ 2015-05-13 17:29 UTC (permalink / raw)
  To: Segher Boessenkool; +Cc: GCC Patches

On Wed, May 13, 2015 at 1:15 PM, Segher Boessenkool
<segher@kernel.crashing.org> wrote:
> This patch changes rs6000_rtx_costs to be closer to reality.  It is
> still not quite right, but at least it handles more cases, so the
>
>         (set (reg:SI) (eq:SI (reg:SI) (reg:SI)))
>
> from the PR isn't taken as costing 1 insn anymore, while setting
> a reg:DI was cost 3 insns.  The mode of the dest doesn't matter at
> all here, not for any of our current scc patterns.
>
> Testing in progress; okay for trunk?
>
>
> Segher
>
>
> 2015-05-13  Segher Boessenkool  <segher@kernel.crashing.org>
>
>         PR rtl-optimization/30967
>         * config/rs6000/rs6000.c (rs6000_rtx_costs): Don't consider
>         destination mode for the cost of scc patterns.

Okay.

Should this be applied to GCC 5 branch?

thanks, David

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

* Re: [PATCH] rs6000: Improve rtx_costs for EQ a bit (PR30967)
  2015-05-13 17:29 ` David Edelsohn
@ 2015-05-13 17:53   ` Segher Boessenkool
  2015-05-14 14:03     ` David Edelsohn
  0 siblings, 1 reply; 5+ messages in thread
From: Segher Boessenkool @ 2015-05-13 17:53 UTC (permalink / raw)
  To: David Edelsohn; +Cc: GCC Patches

On Wed, May 13, 2015 at 01:25:16PM -0400, David Edelsohn wrote:
> >         PR rtl-optimization/30967
> >         * config/rs6000/rs6000.c (rs6000_rtx_costs): Don't consider
> >         destination mode for the cost of scc patterns.
> 
> Okay.
> 
> Should this be applied to GCC 5 branch?

[ Testing is still in progress. ]

It should be prefectly safe to backport; OTOH, it is just one of very
many cases where we generate an extra sign-extend, so I don't think it
is particularly useful.  Your choice :-)


Segher

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

* Re: [PATCH] rs6000: Improve rtx_costs for EQ a bit (PR30967)
  2015-05-13 17:53   ` Segher Boessenkool
@ 2015-05-14 14:03     ` David Edelsohn
  2015-05-15 12:26       ` Segher Boessenkool
  0 siblings, 1 reply; 5+ messages in thread
From: David Edelsohn @ 2015-05-14 14:03 UTC (permalink / raw)
  To: Segher Boessenkool; +Cc: GCC Patches

On Wed, May 13, 2015 at 1:29 PM, Segher Boessenkool
<segher@kernel.crashing.org> wrote:
> On Wed, May 13, 2015 at 01:25:16PM -0400, David Edelsohn wrote:
>> >         PR rtl-optimization/30967
>> >         * config/rs6000/rs6000.c (rs6000_rtx_costs): Don't consider
>> >         destination mode for the cost of scc patterns.
>>
>> Okay.
>>
>> Should this be applied to GCC 5 branch?
>
> [ Testing is still in progress. ]
>
> It should be prefectly safe to backport; OTOH, it is just one of very
> many cases where we generate an extra sign-extend, so I don't think it
> is particularly useful.  Your choice :-)

The other prereqs are backported, so probably should backport this also.

Fixing this is a process, not an event.

- David

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

* Re: [PATCH] rs6000: Improve rtx_costs for EQ a bit (PR30967)
  2015-05-14 14:03     ` David Edelsohn
@ 2015-05-15 12:26       ` Segher Boessenkool
  0 siblings, 0 replies; 5+ messages in thread
From: Segher Boessenkool @ 2015-05-15 12:26 UTC (permalink / raw)
  To: David Edelsohn; +Cc: GCC Patches

On Thu, May 14, 2015 at 09:51:18AM -0400, David Edelsohn wrote:
> On Wed, May 13, 2015 at 1:29 PM, Segher Boessenkool
> <segher@kernel.crashing.org> wrote:
> > On Wed, May 13, 2015 at 01:25:16PM -0400, David Edelsohn wrote:
> >> >         PR rtl-optimization/30967
> >> >         * config/rs6000/rs6000.c (rs6000_rtx_costs): Don't consider
> >> >         destination mode for the cost of scc patterns.
> >>
> >> Okay.
> >>
> >> Should this be applied to GCC 5 branch?
> >
> > [ Testing is still in progress. ]
> >
> > It should be prefectly safe to backport; OTOH, it is just one of very
> > many cases where we generate an extra sign-extend, so I don't think it
> > is particularly useful.  Your choice :-)
> 
> The other prereqs are backported, so probably should backport this also.

The only related patch that could be backported (the compare imm thing)
is not backported yet AFAIK (I haven't checked); should it be?

This cost patch improves things with or without it.


Segher

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

end of thread, other threads:[~2015-05-15 12:23 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-05-13 17:25 [PATCH] rs6000: Improve rtx_costs for EQ a bit (PR30967) Segher Boessenkool
2015-05-13 17:29 ` David Edelsohn
2015-05-13 17:53   ` Segher Boessenkool
2015-05-14 14:03     ` David Edelsohn
2015-05-15 12:26       ` Segher Boessenkool

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).