]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
tree-optimization/102847 - adjust VMAT_INVARIANT load costing
authorRichard Biener <rguenther@suse.de>
Thu, 21 Oct 2021 10:10:20 +0000 (12:10 +0200)
committerRichard Biener <rguenther@suse.de>
Thu, 21 Oct 2021 10:10:20 +0000 (12:10 +0200)
This adds the missing scalar load cost in the prologue.

2021-10-21  Richard Biener  <rguenther@suse.de>

PR tree-optimization/102847
* tree-vect-stmts.c (vect_model_load_cost): Add the scalar
load cost in the prologue for VMAT_INVARIANT.

gcc/tree-vect-stmts.c

index 8f527452bd0e37b6df04bc1661b061d3d27dce40..c28c9370655aa9fe79df13e9f20aa95de2bd72cc 100644 (file)
@@ -1194,6 +1194,9 @@ vect_model_load_cost (vec_info *vinfo,
   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_load, stmt_info, 0,
+                                        vect_prologue);
       prologue_cost += record_stmt_cost (cost_vec, 1,
                                         scalar_to_vec, stmt_info, 0,
                                         vect_prologue);