tree-optimization/102847 - adjust VMAT_INVARIANT load costing
Commit Message
This adds the missing scalar load cost in the prologue.
Bootstrapped on x86_64-unknown-linux-gnu, testing in progress.
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 | 3 +++
1 file changed, 3 insertions(+)
@@ -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);