aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-vectorizer.h
diff options
context:
space:
mode:
authorliuhongt <hongtao.liu@intel.com>2023-02-01 13:30:12 +0800
committerliuhongt <hongtao.liu@intel.com>2023-02-02 17:02:01 +0800
commit209f02b0a9e9adc0bf0247cb5eef04e0f175d64e (patch)
tree536170ab9e00d799297b6d85f3258b604107ba77 /gcc/tree-vectorizer.h
parent0f349928e16fdc7dba52561e8d40347909f9f0ff (diff)
downloadgcc-209f02b0a9e9adc0bf0247cb5eef04e0f175d64e.zip
gcc-209f02b0a9e9adc0bf0247cb5eef04e0f175d64e.tar.gz
gcc-209f02b0a9e9adc0bf0247cb5eef04e0f175d64e.tar.bz2
Don't peel nonlinear iv(mult or shift) for epilog when vf is not constant.
Normally when vf is not constant, it will be prevented by vectorizable_nonlinear_inductions, but for this case, it failed going into if (STMT_VINFO_RELEVANT_P (stmt_info)) { need_to_vectorize = true; if (STMT_VINFO_DEF_TYPE (stmt_info) == vect_induction_def && ! PURE_SLP_STMT (stmt_info)) ok = vectorizable_induction (loop_vinfo, stmt_info, NULL, NULL, &cost_vec); since the iv is never used outside of the loop, and will be dce later, so vectorizer doesn't bother checking if it's vectorizable. it's true but hit gcc_assert in vect_can_peel_nonlinear_iv_p when vf is not constant. One solution is ignoring the nonlinear iv peeling if it's !STMT_VINFO_RELEVANT_P (stmt_info) just like the upper code, the other solution is returning false earlier in the vect_can_peel_nonlinear_iv_p when vf is not constant, the patch chooses the second incase there's other cases using vect_can_advance_ivs_p which calls vect_can_peel_nonlinear_iv_p. Also remove vect_peel_nonlinear_iv_p from vectorizable_nonlinear_inductions. gcc/ChangeLog: PR tree-optimization/108601 * tree-vectorizer.h (vect_can_peel_nonlinear_iv_p): Removed. * tree-vect-loop.cc (vectorizable_nonlinear_induction): Remove vect_can_peel_nonlinear_iv_p. (vect_can_peel_nonlinear_iv_p): Don't peel nonlinear iv(mult or shift) for epilog when vf is not constant and moved the defination to .. * tree-vect-loop-manip.cc (vect_can_peel_nonlinear_iv_p): .. Here. gcc/testsuite/ChangeLog: * gcc.target/aarch64/pr108601.c: New test.
Diffstat (limited to 'gcc/tree-vectorizer.h')
-rw-r--r--gcc/tree-vectorizer.h3
1 files changed, 0 insertions, 3 deletions
diff --git a/gcc/tree-vectorizer.h b/gcc/tree-vectorizer.h
index a2aa71b..4ba6537 100644
--- a/gcc/tree-vectorizer.h
+++ b/gcc/tree-vectorizer.h
@@ -2347,9 +2347,6 @@ extern tree cse_and_gimplify_to_preheader (loop_vec_info, tree);
/* Nonlinear induction. */
extern tree vect_peel_nonlinear_iv_init (gimple_seq*, tree, tree,
tree, enum vect_induction_op_type);
-extern bool
-vect_can_peel_nonlinear_iv_p (loop_vec_info loop_vinfo,
- enum vect_induction_op_type induction_type);
/* In tree-vect-slp.cc. */
extern void vect_slp_init (void);