aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-vectorizer.h
diff options
context:
space:
mode:
authorRichard Sandiford <richard.sandiford@arm.com>2019-09-19 13:33:55 +0000
committerRichard Sandiford <rsandifo@gcc.gnu.org>2019-09-19 13:33:55 +0000
commitc449d3ae28ff4e133114fb67dbf7dcc7a95ca5d5 (patch)
tree12ab56e51ea7fe069d7e8ffa1c0b6e41ea5252ba /gcc/tree-vectorizer.h
parent37bc3aa0474f21b7a678b09951634de3205d014e (diff)
downloadgcc-c449d3ae28ff4e133114fb67dbf7dcc7a95ca5d5.zip
gcc-c449d3ae28ff4e133114fb67dbf7dcc7a95ca5d5.tar.gz
gcc-c449d3ae28ff4e133114fb67dbf7dcc7a95ca5d5.tar.bz2
Enforce correct COND_EXPR order for EXTRACT_LAST_REDUCTION
For conditional reductions, the "then" value needs to be the candidate value calculated by this iteration while the "else" value needs to be the result carried over from previous iterations. If the COND_EXPR is the other way around, we need to swap it. 2019-09-19 Richard Sandiford <richard.sandiford@arm.com> gcc/ * tree-vectorizer.h (vectorizable_condition): Take an int reduction index instead of a boolean flag. * tree-vect-stmts.c (vectorizable_condition): Likewise. Swap the "then" and "else" values for EXTRACT_LAST_REDUCTION reductions if the reduction accumulator is the "then" rather than the "else" value. (vect_analyze_stmt): Update call accordingly. (vect_transform_stmt): Likewise. * tree-vect-loop.c (vectorizable_reduction): Likewise, asserting that the index is > 0. From-SVN: r275962
Diffstat (limited to 'gcc/tree-vectorizer.h')
-rw-r--r--gcc/tree-vectorizer.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/gcc/tree-vectorizer.h b/gcc/tree-vectorizer.h
index ac6e899..aef0ff8 100644
--- a/gcc/tree-vectorizer.h
+++ b/gcc/tree-vectorizer.h
@@ -1534,7 +1534,7 @@ extern void vect_remove_stores (stmt_vec_info);
extern opt_result vect_analyze_stmt (stmt_vec_info, bool *, slp_tree,
slp_instance, stmt_vector_for_cost *);
extern bool vectorizable_condition (stmt_vec_info, gimple_stmt_iterator *,
- stmt_vec_info *, bool, slp_tree,
+ stmt_vec_info *, int, slp_tree,
stmt_vector_for_cost *);
extern bool vectorizable_shift (stmt_vec_info, gimple_stmt_iterator *,
stmt_vec_info *, slp_tree,