diff options
author | jakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4> | 2007-12-10 22:49:43 +0000 |
---|---|---|
committer | jakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4> | 2007-12-10 22:49:43 +0000 |
commit | be53c6d4abca9b31e58f7c90ffd5071896d76a48 (patch) | |
tree | b3d2088e27b5f07e19b2e68b56260c2086c9d5ae /gcc/tree-vectorizer.c | |
parent | e240f813cb99426b8c21731b14c7561e39e17751 (diff) | |
download | gcc-be53c6d4abca9b31e58f7c90ffd5071896d76a48.tar.gz |
PR tree-optimization/34371
* tree-vectorizer.h (struct _loop_vec_info): Add num_iters_unchanged
field.
(LOOP_VINFO_NITERS_UNCHANGED): Define to num_iters_unchanged field.
* tree-vectorizer.c (set_prologue_iterations,
slpeel_tree_peel_loop_to_edge): Call unshare_expr on
LOOP_VINFO_NITERS_UNCHANGED before using it.
* gcc.c-torture/compile/20071207-1.c: New test.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@130755 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree-vectorizer.c')
-rw-r--r-- | gcc/tree-vectorizer.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/gcc/tree-vectorizer.c b/gcc/tree-vectorizer.c index fcc74168c46..0131b9a4aaf 100644 --- a/gcc/tree-vectorizer.c +++ b/gcc/tree-vectorizer.c @@ -1037,7 +1037,7 @@ set_prologue_iterations (basic_block bb_before_first_loop, tree gimplify_stmt_list; tree cost_pre_condition = NULL_TREE; tree scalar_loop_iters = - LOOP_VINFO_NITERS_UNCHANGED (loop_vec_info_for_loop (loop)); + unshare_expr (LOOP_VINFO_NITERS_UNCHANGED (loop_vec_info_for_loop (loop))); e = single_pred_edge (bb_before_first_loop); cond_bb = split_edge(e); @@ -1154,8 +1154,6 @@ slpeel_tree_peel_loop_to_edge (struct loop *loop, edge exit_e = single_exit (loop); LOC loop_loc; tree cost_pre_condition = NULL_TREE; - tree scalar_loop_iters = - LOOP_VINFO_NITERS_UNCHANGED (loop_vec_info_for_loop (loop)); if (!slpeel_can_duplicate_loop_p (loop, e)) return NULL; @@ -1307,10 +1305,13 @@ slpeel_tree_peel_loop_to_edge (struct loop *loop, build_int_cst (TREE_TYPE (first_niters), 0)); if (check_profitability) { - cost_pre_condition = + tree scalar_loop_iters + = unshare_expr (LOOP_VINFO_NITERS_UNCHANGED + (loop_vec_info_for_loop (loop))); + cost_pre_condition = build2 (LE_EXPR, boolean_type_node, scalar_loop_iters, build_int_cst (TREE_TYPE (scalar_loop_iters), th)); - + pre_condition = fold_build2 (TRUTH_OR_EXPR, boolean_type_node, cost_pre_condition, pre_condition); } |