diff options
author | rsandifo <rsandifo@138bc75d-0d04-0410-961f-82ee72b054a4> | 2018-01-03 08:59:18 +0000 |
---|---|---|
committer | rsandifo <rsandifo@138bc75d-0d04-0410-961f-82ee72b054a4> | 2018-01-03 08:59:18 +0000 |
commit | 773fdd5f4747cf5a2eb643c87417a9ba3ffe75ba (patch) | |
tree | e12d59269ca650f27b7141a5e825d503877ad63c /gcc/fold-const.c | |
parent | 659f92d1990e0b84a6e30f6ecd76319552faf7b7 (diff) | |
download | gcc-773fdd5f4747cf5a2eb643c87417a9ba3ffe75ba.tar.gz |
poly_int: vec_perm_indices element type
This patch changes the vec_perm_indices element type from HOST_WIDE_INT
to poly_int64, so that it can represent indices into a variable-length
vector.
2018-01-03 Richard Sandiford <richard.sandiford@linaro.org>
gcc/
* vec-perm-indices.h (vec_perm_builder): Change element type
from HOST_WIDE_INT to poly_int64.
(vec_perm_indices::element_type): Update accordingly.
(vec_perm_indices::clamp): Handle polynomial element_types.
* vec-perm-indices.c (vec_perm_indices::series_p): Likewise.
(vec_perm_indices::all_in_range_p): Likewise.
(tree_to_vec_perm_builder): Check for poly_int64 trees rather
than shwi trees.
* vector-builder.h (vector_builder::stepped_sequence_p): Handle
polynomial vec_perm_indices element types.
* int-vector-builder.h (int_vector_builder::equal_p): Likewise.
* fold-const.c (fold_vec_perm): Likewise.
* optabs.c (shift_amt_for_vec_perm_mask): Likewise.
* tree-vect-generic.c (lower_vec_perm): Likewise.
* tree-vect-slp.c (vect_transform_slp_perm_load): Likewise.
* config/aarch64/aarch64.c (aarch64_evpc_tbl): Cast d->perm
element type to HOST_WIDE_INT.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@256164 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/fold-const.c')
-rw-r--r-- | gcc/fold-const.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/gcc/fold-const.c b/gcc/fold-const.c index e2e46005f8c..6c13d6d3403 100644 --- a/gcc/fold-const.c +++ b/gcc/fold-const.c @@ -8945,9 +8945,12 @@ fold_vec_perm (tree type, tree arg0, tree arg1, const vec_perm_indices &sel) tree_vector_builder out_elts (type, nelts, 1); for (i = 0; i < nelts; i++) { - if (!CONSTANT_CLASS_P (in_elts[sel[i]])) + HOST_WIDE_INT index; + if (!sel[i].is_constant (&index)) + return NULL_TREE; + if (!CONSTANT_CLASS_P (in_elts[index])) need_ctor = true; - out_elts.quick_push (unshare_expr (in_elts[sel[i]])); + out_elts.quick_push (unshare_expr (in_elts[index])); } if (need_ctor) |