public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [ping #4][patch] Fix PR80929: Realistic PARALLEL cost in seq_cost.
@ 2017-07-11  8:47 Georg-Johann Lay
  2017-07-12 12:11 ` Segher Boessenkool
  0 siblings, 1 reply; 5+ messages in thread
From: Georg-Johann Lay @ 2017-07-11  8:47 UTC (permalink / raw)
  To: gcc-patches

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

Ping #4

This small addition improves costs of PARALLELs in
rtlanal.c:seq_cost().  Up to now, these costs are
assumed to be 1 which gives gross inexact costs for,
e.g. divmod which is represented as PARALLEL.

The patch just forwards cost computation to insn_rtx_cost
which uses the cost of the 1st SET (if any) and otherwise
assign costs of 1 insn.

Bootstrapped & regtested on x86_64.

Moreover, it fixed the division by constant on avr where
the problem popped up since PR79665.

Ok to install?

Johann

gcc/
	PR middle-end/80929
	* rtlanal.c (seq_cost) [PARALLEL]: Get cost from insn_rtx_cost
	instead of assuming cost of 1.

[-- Attachment #2: pr80929.diff --]
[-- Type: text/x-patch, Size: 467 bytes --]

Index: rtlanal.c
===================================================================
--- rtlanal.c	(revision 248745)
+++ rtlanal.c	(working copy)
@@ -5300,6 +5300,9 @@ seq_cost (const rtx_insn *seq, bool spee
       set = single_set (seq);
       if (set)
         cost += set_rtx_cost (set, speed);
+      else if (INSN_P (seq)
+	       && PARALLEL == GET_CODE (PATTERN (seq)))
+	cost += 1 + insn_rtx_cost (PATTERN (seq), speed);
       else
         cost++;
     }

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

end of thread, other threads:[~2017-07-13 11:04 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-07-11  8:47 [ping #4][patch] Fix PR80929: Realistic PARALLEL cost in seq_cost Georg-Johann Lay
2017-07-12 12:11 ` Segher Boessenkool
2017-07-12 13:30   ` Georg-Johann Lay
2017-07-12 19:36     ` Segher Boessenkool
2017-07-13 11:04       ` Georg-Johann Lay

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