public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r12-4603] tree-optimization/102847 - properly cost VMAT_INVARIANT loads
@ 2021-10-21  9:21 Richard Biener
  0 siblings, 0 replies; only message in thread
From: Richard Biener @ 2021-10-21  9:21 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:7878981f1d44b4c9bb6c4a3137b37f06c725b73d

commit r12-4603-g7878981f1d44b4c9bb6c4a3137b37f06c725b73d
Author: Richard Biener <rguenther@suse.de>
Date:   Thu Oct 21 10:24:03 2021 +0200

    tree-optimization/102847 - properly cost VMAT_INVARIANT loads
    
    The following adds proper costing of VMAT_INVARIANT loads, avoiding
    to ask the target about the cost of an unsupported vector load cost
    which we won't emit anyway.
    
    2021-10-21  Richard Biener  <rguenther@suse.de>
    
            PR tree-optimization/102847
            * tree-vect-stmts.c (vect_model_load_cost): Explicitely
            handle VMAT_INVARIANT as a splat in the prologue.

Diff:
---
 gcc/tree-vect-stmts.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/gcc/tree-vect-stmts.c b/gcc/tree-vect-stmts.c
index 9cbc1af4cc9..8f527452bd0 100644
--- a/gcc/tree-vect-stmts.c
+++ b/gcc/tree-vect-stmts.c
@@ -1191,6 +1191,13 @@ vect_model_load_cost (vec_info *vinfo,
 				       ncopies * assumed_nunits,
 				       scalar_load, stmt_info, 0, vect_body);
     }
+  else if (memory_access_type == VMAT_INVARIANT)
+    {
+      /* Invariant loads will ideally be hoisted and splat to a vector.  */
+      prologue_cost += record_stmt_cost (cost_vec, 1,
+					 scalar_to_vec, stmt_info, 0,
+					 vect_prologue);
+    }
   else
     vect_get_load_cost (vinfo, stmt_info, ncopies,
 			alignment_support_scheme, misalignment, first_stmt_p,


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2021-10-21  9:21 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-21  9:21 [gcc r12-4603] tree-optimization/102847 - properly cost VMAT_INVARIANT loads Richard Biener

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