aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-vectorizer.h
diff options
context:
space:
mode:
authorRichard Sandiford <richard.sandiford@arm.com>2021-11-30 09:52:27 +0000
committerRichard Sandiford <richard.sandiford@arm.com>2021-11-30 09:52:27 +0000
commit9b577047eec65936a5299cac13dd7b73cdfc4ae4 (patch)
tree90141b80bfacae40df1049460e140ec7746da304 /gcc/tree-vectorizer.h
parent0fb2ab504067ad0d2179622861dd71140b736afe (diff)
downloadgcc-9b577047eec65936a5299cac13dd7b73cdfc4ae4.zip
gcc-9b577047eec65936a5299cac13dd7b73cdfc4ae4.tar.gz
gcc-9b577047eec65936a5299cac13dd7b73cdfc4ae4.tar.bz2
vect: Fix vect_is_reduction
The current definition of vect_is_reduction (provided for target costing) misses some pattern statements. gcc/ * tree-vectorizer.h (vect_is_reduction): Use STMT_VINFO_REDUC_IDX. gcc/testsuite/ * gcc.target/aarch64/sve/cost_model_13.c: New test.
Diffstat (limited to 'gcc/tree-vectorizer.h')
-rw-r--r--gcc/tree-vectorizer.h3
1 files changed, 1 insertions, 2 deletions
diff --git a/gcc/tree-vectorizer.h b/gcc/tree-vectorizer.h
index 0eb13d6..76e81ea 100644
--- a/gcc/tree-vectorizer.h
+++ b/gcc/tree-vectorizer.h
@@ -2372,8 +2372,7 @@ vect_is_store_elt_extraction (vect_cost_for_stmt kind, stmt_vec_info stmt_info)
inline bool
vect_is_reduction (stmt_vec_info stmt_info)
{
- return (STMT_VINFO_REDUC_DEF (stmt_info)
- || VECTORIZABLE_CYCLE_DEF (STMT_VINFO_DEF_TYPE (stmt_info)));
+ return STMT_VINFO_REDUC_IDX (stmt_info) >= 0;
}
/* If STMT_INFO describes a reduction, return the vect_reduction_type