diff options
author | Richard Biener <rguenther@suse.de> | 2020-09-15 16:12:53 +0200 |
---|---|---|
committer | Richard Biener <rguenther@suse.de> | 2020-09-15 16:59:09 +0200 |
commit | d876184c095d6ac41e64eaf4e2c78864d2d935c1 (patch) | |
tree | b9495a64cd86e35fd68b745183f4c9f006bff90c | |
parent | 3304888c252f079a04ff2be95672d8c1d9a7d34f (diff) | |
download | gcc-d876184c095d6ac41e64eaf4e2c78864d2d935c1.zip gcc-d876184c095d6ac41e64eaf4e2c78864d2d935c1.tar.gz gcc-d876184c095d6ac41e64eaf4e2c78864d2d935c1.tar.bz2 |
make swap argument of vect_get_and_check_slp_defs readonly
Since some time we're only using this argument to communicate from
vect_build_slp_tree_1 to vect_get_and_check_slp_defs. This makes
the direction of information flow clear.
2020-09-15 Richard Biener <rguenther@suse.de>
* tree-vect-slp.c (vect_get_and_check_slp_defs): Make swap
argument by-value and do not change it.
(vect_build_slp_tree_2): Adjust, set swap to NULL after last
use.
-rw-r--r-- | gcc/tree-vect-slp.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/gcc/tree-vect-slp.c b/gcc/tree-vect-slp.c index d844fe4..f9f4d70 100644 --- a/gcc/tree-vect-slp.c +++ b/gcc/tree-vect-slp.c @@ -391,7 +391,7 @@ can_duplicate_and_interleave_p (vec_info *vinfo, unsigned int count, swapping operands of father node of this one, return 1; if everything is ok return 0. */ static int -vect_get_and_check_slp_defs (vec_info *vinfo, unsigned char *swap, +vect_get_and_check_slp_defs (vec_info *vinfo, unsigned char swap, vec<stmt_vec_info> stmts, unsigned stmt_num, vec<slp_oprnd_info> *oprnds_info) { @@ -441,7 +441,7 @@ vect_get_and_check_slp_defs (vec_info *vinfo, unsigned char *swap, else return -1; - bool swapped = (*swap != 0); + bool swapped = (swap != 0); gcc_assert (!swapped || first_op_cond); for (i = 0; i < number_of_oprnds; i++) { @@ -450,7 +450,7 @@ again: { /* Map indicating how operands of cond_expr should be swapped. */ int maps[3][4] = {{0, 1, 2, 3}, {1, 0, 2, 3}, {0, 1, 3, 2}}; - int *map = maps[*swap]; + int *map = maps[swap]; if (i < 2) oprnd = TREE_OPERAND (gimple_op (stmt_info->stmt, @@ -607,7 +607,6 @@ again: stmt_info->stmt); } - *swap = swapped; return 0; } @@ -1391,7 +1390,7 @@ vect_build_slp_tree_2 (vec_info *vinfo, slp_oprnd_info oprnd_info; FOR_EACH_VEC_ELT (stmts, i, stmt_info) { - int res = vect_get_and_check_slp_defs (vinfo, &swap[i], + int res = vect_get_and_check_slp_defs (vinfo, swap[i], stmts, i, &oprnds_info); if (res != 0) matches[(res == -1) ? 0 : i] = false; @@ -1404,6 +1403,7 @@ vect_build_slp_tree_2 (vec_info *vinfo, vect_free_oprnd_info (oprnds_info); return NULL; } + swap = NULL; auto_vec<slp_tree, 4> children; |