diff options
author | Richard Sandiford <richard.sandiford@arm.com> | 2024-10-07 13:03:03 +0100 |
---|---|---|
committer | Richard Sandiford <richard.sandiford@arm.com> | 2024-10-07 13:03:03 +0100 |
commit | 1732298d51028ae50a802e538df5d7249556255d (patch) | |
tree | 2b3dce6befa6d4f552bc0c77ab8de401eaaa67f5 /gcc | |
parent | 4fd473f66faf5bd95c84fe5c0fa41be735a7c09f (diff) | |
download | gcc-1732298d51028ae50a802e538df5d7249556255d.zip gcc-1732298d51028ae50a802e538df5d7249556255d.tar.gz gcc-1732298d51028ae50a802e538df5d7249556255d.tar.bz2 |
vect: Variable lane indices in vectorizable_slp_permutation_1 [PR116583]
The main patch for PR116583 needs to create variable indices into
an input vector. This pre-patch changes the types to allow that.
There is no pretty-print format for poly_uint64 because of issues
with passing C++ objects through "...".
gcc/
PR tree-optimization/116583
* tree-vect-slp.cc (vectorizable_slp_permutation_1): Using
poly_uint64 for scalar lane indices.
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/tree-vect-slp.cc | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/gcc/tree-vect-slp.cc b/gcc/tree-vect-slp.cc index 125e69c..97a471a 100644 --- a/gcc/tree-vect-slp.cc +++ b/gcc/tree-vect-slp.cc @@ -10310,8 +10310,8 @@ vectorizable_slp_permutation_1 (vec_info *vinfo, gimple_stmt_iterator *gsi, from the { SLP operand, scalar lane } permutation as recorded in the SLP node as intermediate step. This part should already work with SLP children with arbitrary number of lanes. */ - auto_vec<std::pair<std::pair<unsigned, unsigned>, unsigned> > vperm; - auto_vec<unsigned> active_lane; + auto_vec<std::pair<std::pair<unsigned, unsigned>, poly_uint64>> vperm; + auto_vec<poly_uint64> active_lane; vperm.create (olanes); active_lane.safe_grow_cleared (children.length (), true); for (unsigned i = 0; i < ncopies; ++i) @@ -10326,8 +10326,9 @@ vectorizable_slp_permutation_1 (vec_info *vinfo, gimple_stmt_iterator *gsi, { /* We checked above that the vectors are constant-length. */ unsigned vnunits = TYPE_VECTOR_SUBPARTS (vtype).to_constant (); - unsigned vi = (active_lane[p.first] + p.second) / vnunits; - unsigned vl = (active_lane[p.first] + p.second) % vnunits; + unsigned lane = active_lane[p.first].to_constant (); + unsigned vi = (lane + p.second) / vnunits; + unsigned vl = (lane + p.second) % vnunits; vperm.quick_push ({{p.first, vi}, vl}); } } @@ -10353,9 +10354,10 @@ vectorizable_slp_permutation_1 (vec_info *vinfo, gimple_stmt_iterator *gsi, ? multiple_p (i, npatterns) : multiple_p (i, TYPE_VECTOR_SUBPARTS (vectype)))) dump_printf (MSG_NOTE, ","); - dump_printf (MSG_NOTE, " vops%u[%u][%u]", - vperm[i].first.first, vperm[i].first.second, - vperm[i].second); + dump_printf (MSG_NOTE, " vops%u[%u][", + vperm[i].first.first, vperm[i].first.second); + dump_dec (MSG_NOTE, vperm[i].second); + dump_printf (MSG_NOTE, "]"); } dump_printf (MSG_NOTE, "\n"); } |