diff options
author | Richard Biener <rguenther@suse.de> | 2015-04-04 10:47:08 +0000 |
---|---|---|
committer | Richard Biener <rguenth@gcc.gnu.org> | 2015-04-04 10:47:08 +0000 |
commit | 30c5a937e19ac28dbb6d023516af9c1b902614aa (patch) | |
tree | ae57389dd5207eae838acff0fa8788c691c5dda5 /gcc/tree-vect-data-refs.c | |
parent | 0da0c47dc5f7a2a8f8f8fad8c7e4d3d1bfeb37ea (diff) | |
download | gcc-30c5a937e19ac28dbb6d023516af9c1b902614aa.zip gcc-30c5a937e19ac28dbb6d023516af9c1b902614aa.tar.gz gcc-30c5a937e19ac28dbb6d023516af9c1b902614aa.tar.bz2 |
re PR tree-optimization/64909 (Missed vectorization with bdver1)
2015-04-04 Richard Biener <rguenther@suse.de>
PR tree-optimization/64909
PR tree-optimization/65660
* tree-vectorizer.h (vect_get_known_peeling_cost): Adjust
to take a cost vector for scalar iteration cost.
(vect_get_single_scalar_iteration_cost): Likewise.
* tree-vect-loop.c (vect_get_single_scalar_iteration_cost):
Compute the scalar iteration cost into a cost vector.
(vect_get_known_peeling_cost): Use the scalar cost vector to
account for the cost of the peeled iterations.
(vect_estimate_min_profitable_iters): Likewise.
* tree-vect-data-refs.c (vect_peeling_hash_get_lowest_cost):
Likewise.
From-SVN: r221866
Diffstat (limited to 'gcc/tree-vect-data-refs.c')
-rw-r--r-- | gcc/tree-vect-data-refs.c | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/gcc/tree-vect-data-refs.c b/gcc/tree-vect-data-refs.c index 094275e..3913862eb 100644 --- a/gcc/tree-vect-data-refs.c +++ b/gcc/tree-vect-data-refs.c @@ -1152,7 +1152,6 @@ vect_peeling_hash_get_lowest_cost (_vect_peel_info **slot, vec<data_reference_p> datarefs = LOOP_VINFO_DATAREFS (loop_vinfo); struct data_reference *dr; stmt_vector_for_cost prologue_cost_vec, body_cost_vec, epilogue_cost_vec; - int single_iter_cost; prologue_cost_vec.create (2); body_cost_vec.create (2); @@ -1175,14 +1174,11 @@ vect_peeling_hash_get_lowest_cost (_vect_peel_info **slot, SET_DR_MISALIGNMENT (dr, save_misalignment); } - single_iter_cost = vect_get_single_scalar_iteration_cost (loop_vinfo); + auto_vec<stmt_info_for_cost> scalar_cost_vec; + vect_get_single_scalar_iteration_cost (loop_vinfo, &scalar_cost_vec); outside_cost += vect_get_known_peeling_cost (loop_vinfo, elem->npeel, &dummy, - /* ??? We use this cost as number of stmts with scalar_stmt cost, - thus divide by that. This introduces rounding errors, thus better - introduce a new cost kind (raw_cost? scalar_iter_cost?). */ - single_iter_cost / vect_get_stmt_cost (scalar_stmt), - &prologue_cost_vec, &epilogue_cost_vec); + &scalar_cost_vec, &prologue_cost_vec, &epilogue_cost_vec); /* Prologue and epilogue costs are added to the target model later. These costs depend only on the scalar iteration cost, the |