diff options
author | Richard Sandiford <richard.sandiford@linaro.org> | 2018-01-03 07:16:14 +0000 |
---|---|---|
committer | Richard Sandiford <rsandifo@gcc.gnu.org> | 2018-01-03 07:16:14 +0000 |
commit | c7bda0f40e1ddd9fc2c347fafeab93350be036f8 (patch) | |
tree | 7516a622c4b68d05b3807f30526c3f42782b6b9e /gcc | |
parent | 4d694b27c3697f7eef16a17eb926076bf836575a (diff) | |
download | gcc-c7bda0f40e1ddd9fc2c347fafeab93350be036f8.zip gcc-c7bda0f40e1ddd9fc2c347fafeab93350be036f8.tar.gz gcc-c7bda0f40e1ddd9fc2c347fafeab93350be036f8.tar.bz2 |
poly_int: vectorizable_call
This patch makes vectorizable_call handle variable-length vectors.
The only substantial change is to use build_index_vector for
IFN_GOMP_SIMD_LANE; this makes no functional difference for
fixed-length vectors.
2018-01-03 Richard Sandiford <richard.sandiford@linaro.org>
Alan Hayward <alan.hayward@arm.com>
David Sherwood <david.sherwood@arm.com>
gcc/
* tree-vect-stmts.c (vectorizable_call): Treat the number of
vectors as polynomial. Use build_index_vector for
IFN_GOMP_SIMD_LANE.
Co-Authored-By: Alan Hayward <alan.hayward@arm.com>
Co-Authored-By: David Sherwood <david.sherwood@arm.com>
From-SVN: r256137
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 8 | ||||
-rw-r--r-- | gcc/tree-vect-stmts.c | 16 |
2 files changed, 14 insertions, 10 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 1e8431c..9aded12 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -2,6 +2,14 @@ Alan Hayward <alan.hayward@arm.com> David Sherwood <david.sherwood@arm.com> + * tree-vect-stmts.c (vectorizable_call): Treat the number of + vectors as polynomial. Use build_index_vector for + IFN_GOMP_SIMD_LANE. + +2018-01-03 Richard Sandiford <richard.sandiford@linaro.org> + Alan Hayward <alan.hayward@arm.com> + David Sherwood <david.sherwood@arm.com> + * tree-vect-stmts.c (get_load_store_type): Treat the number of units as polynomial. Reject VMAT_ELEMENTWISE and VMAT_STRIDED_SLP for variable-length vectors. diff --git a/gcc/tree-vect-stmts.c b/gcc/tree-vect-stmts.c index 932c309..210632b 100644 --- a/gcc/tree-vect-stmts.c +++ b/gcc/tree-vect-stmts.c @@ -2650,8 +2650,8 @@ vectorizable_call (gimple *gs, gimple_stmt_iterator *gsi, gimple **vec_stmt, tree vec_oprnd0 = NULL_TREE, vec_oprnd1 = NULL_TREE; stmt_vec_info stmt_info = vinfo_for_stmt (gs), prev_stmt_info; tree vectype_out, vectype_in; - int nunits_in; - int nunits_out; + poly_uint64 nunits_in; + poly_uint64 nunits_out; loop_vec_info loop_vinfo = STMT_VINFO_LOOP_VINFO (stmt_info); bb_vec_info bb_vinfo = STMT_VINFO_BB_VINFO (stmt_info); vec_info *vinfo = stmt_info->vinfo; @@ -2771,11 +2771,11 @@ vectorizable_call (gimple *gs, gimple_stmt_iterator *gsi, gimple **vec_stmt, /* FORNOW */ nunits_in = TYPE_VECTOR_SUBPARTS (vectype_in); nunits_out = TYPE_VECTOR_SUBPARTS (vectype_out); - if (nunits_in == nunits_out / 2) + if (known_eq (nunits_in * 2, nunits_out)) modifier = NARROW; - else if (nunits_out == nunits_in) + else if (known_eq (nunits_out, nunits_in)) modifier = NONE; - else if (nunits_out == nunits_in / 2) + else if (known_eq (nunits_out * 2, nunits_in)) modifier = WIDEN; else return false; @@ -2974,11 +2974,7 @@ vectorizable_call (gimple *gs, gimple_stmt_iterator *gsi, gimple **vec_stmt, if (gimple_call_internal_p (stmt) && gimple_call_internal_fn (stmt) == IFN_GOMP_SIMD_LANE) { - tree_vector_builder v (vectype_out, 1, 3); - for (int k = 0; k < 3; ++k) - v.quick_push (build_int_cst (unsigned_type_node, - j * nunits_out + k)); - tree cst = v.build (); + tree cst = build_index_vector (vectype_out, j * nunits_out, 1); tree new_var = vect_get_new_ssa_name (vectype_out, vect_simple_var, "cst_"); gimple *init_stmt = gimple_build_assign (new_var, cst); |