aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-vect-stmts.c
diff options
context:
space:
mode:
authorRichard Guenther <rguenther@suse.de>2012-05-14 15:01:22 +0000
committerRichard Guenther <rguenther@suse.de>2012-05-14 15:01:22 +0000
commit2ff2fd878a43208c34475a45f2829462b4fe7e8f (patch)
tree9aa4a5b963dd59f3951fd6abdc29e564d2dd64a5 /gcc/tree-vect-stmts.c
parent5e3ecc37c26465480f4edd4698c9dc4fa9fc7edd (diff)
2012-05-14 Richard Guenther <rguenther@suse.de>
PR tree-optimization/53331 * tree-vect-data-refs.c (vect_verify_datarefs_alignment): Ignore strided loads. * tree-vect-stmts.c (vect_model_load_cost): Handle strided loads. git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@187466 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree-vect-stmts.c')
-rw-r--r--gcc/tree-vect-stmts.c17
1 files changed, 13 insertions, 4 deletions
diff --git a/gcc/tree-vect-stmts.c b/gcc/tree-vect-stmts.c
index 88204fec2d3..bdb6828baad 100644
--- a/gcc/tree-vect-stmts.c
+++ b/gcc/tree-vect-stmts.c
@@ -1032,10 +1032,19 @@ vect_model_load_cost (stmt_vec_info stmt_info, int ncopies, bool load_lanes_p,
}
/* The loads themselves. */
- vect_get_load_cost (first_dr, ncopies,
- ((!STMT_VINFO_GROUPED_ACCESS (stmt_info)) || group_size > 1
- || slp_node),
- &inside_cost, &outside_cost);
+ if (STMT_VINFO_STRIDE_LOAD_P (stmt_info))
+ {
+ /* N scalar loads plus gathering them into a vector.
+ ??? scalar_to_vec isn't the cost for that. */
+ inside_cost += (vect_get_stmt_cost (scalar_load) * ncopies
+ * TYPE_VECTOR_SUBPARTS (STMT_VINFO_VECTYPE (stmt_info)));
+ inside_cost += ncopies * vect_get_stmt_cost (scalar_to_vec);
+ }
+ else
+ vect_get_load_cost (first_dr, ncopies,
+ ((!STMT_VINFO_GROUPED_ACCESS (stmt_info))
+ || group_size > 1 || slp_node),
+ &inside_cost, &outside_cost);
if (vect_print_dump_info (REPORT_COST))
fprintf (vect_dump, "vect_model_load_cost: inside_cost = %d, "