diff options
author | Richard Biener <rguenther@suse.de> | 2015-02-10 11:48:47 +0000 |
---|---|---|
committer | Richard Biener <rguenth@gcc.gnu.org> | 2015-02-10 11:48:47 +0000 |
commit | 696814edb80cfae8840213cf3e3100d0265944bd (patch) | |
tree | 23cfbb89274e498a827a4e773622710dfa8b4ded /gcc/tree-vect-loop.c | |
parent | 644a47612e7b5919bb36df5d6c0b28992d99ce5f (diff) | |
download | gcc-696814edb80cfae8840213cf3e3100d0265944bd.zip gcc-696814edb80cfae8840213cf3e3100d0265944bd.tar.gz gcc-696814edb80cfae8840213cf3e3100d0265944bd.tar.bz2 |
re PR tree-optimization/64909 (Missed vectorization with bdver1)
2015-02-10 Richard Biener <rguenther@suse.de>
PR tree-optimization/64909
* tree-vect-loop.c (vect_estimate_min_profitable_iters): Properly
pass a scalar-stmt count estimate to the cost model.
* tree-vect-data-refs.c (vect_peeling_hash_get_lowest_cost): Likewise.
* gcc.dg/vect/costmodel/x86_64/costmodel-pr64909.c: New testcase.
From-SVN: r220580
Diffstat (limited to 'gcc/tree-vect-loop.c')
-rw-r--r-- | gcc/tree-vect-loop.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/gcc/tree-vect-loop.c b/gcc/tree-vect-loop.c index c5f1c29..3e7c701 100644 --- a/gcc/tree-vect-loop.c +++ b/gcc/tree-vect-loop.c @@ -2834,6 +2834,11 @@ vect_estimate_min_profitable_iters (loop_vec_info loop_vinfo, statements. */ scalar_single_iter_cost = vect_get_single_scalar_iteration_cost (loop_vinfo); + /* ??? Below 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?). */ + int scalar_single_iter_stmts + = scalar_single_iter_cost / vect_get_stmt_cost (scalar_stmt); /* Add additional cost for the peeled instructions in prologue and epilogue loop. @@ -2868,10 +2873,10 @@ vect_estimate_min_profitable_iters (loop_vec_info loop_vinfo, /* FORNOW: Don't attempt to pass individual scalar instructions to the model; just assume linear cost for scalar iterations. */ (void) add_stmt_cost (target_cost_data, - peel_iters_prologue * scalar_single_iter_cost, + peel_iters_prologue * scalar_single_iter_stmts, scalar_stmt, NULL, 0, vect_prologue); (void) add_stmt_cost (target_cost_data, - peel_iters_epilogue * scalar_single_iter_cost, + peel_iters_epilogue * scalar_single_iter_stmts, scalar_stmt, NULL, 0, vect_epilogue); } else @@ -2887,7 +2892,7 @@ vect_estimate_min_profitable_iters (loop_vec_info loop_vinfo, (void) vect_get_known_peeling_cost (loop_vinfo, peel_iters_prologue, &peel_iters_epilogue, - scalar_single_iter_cost, + scalar_single_iter_stmts, &prologue_cost_vec, &epilogue_cost_vec); |