Message ID | mpta79avc3c.fsf@arm.com |
---|---|
State | New |
Headers | show |
Series | [10a/n] Require equal type sizes for vectorised calls | expand |
On Tue, Nov 5, 2019 at 9:10 PM Richard Sandiford <richard.sandiford@arm.com> wrote: > > As explained in the comment, vectorizable_call needs more work to > support mixtures of sizes. This avoids testsuite fallout for > later SVE patches. > > Was originally going to be later in the series, but applying it > before 11/n seems safer. As before each patch tested individually > on aarch64-linux-gnu and the series as a whole on x86_64-linux-gnu. OK. > > 2019-11-04 Richard Sandiford <richard.sandiford@arm.com> > > gcc/ > * tree-vect-stmts.c (vectorizable_call): Require the types > to have the same size. > > Index: gcc/tree-vect-stmts.c > =================================================================== > --- gcc/tree-vect-stmts.c 2019-11-05 10:38:50.718047381 +0000 > +++ gcc/tree-vect-stmts.c 2019-11-05 10:38:55.542013228 +0000 > @@ -3317,6 +3317,19 @@ vectorizable_call (stmt_vec_info stmt_in > > return false; > } > + /* FORNOW: we don't yet support mixtures of vector sizes for calls, > + just mixtures of nunits. E.g. DI->SI versions of __builtin_ctz* > + are traditionally vectorized as two VnDI->VnDI IFN_CTZs followed > + by a pack of the two vectors into an SI vector. We would need > + separate code to handle direct VnDI->VnSI IFN_CTZs. */ > + if (TYPE_SIZE (vectype_in) != TYPE_SIZE (vectype_out)) > + { > + if (dump_enabled_p ()) > + dump_printf_loc (MSG_MISSED_OPTIMIZATION, vect_location, > + "mismatched vector sizes %T and %T\n", > + vectype_in, vectype_out); > + return false; > + } > > /* FORNOW */ > nunits_in = TYPE_VECTOR_SUBPARTS (vectype_in);
Index: gcc/tree-vect-stmts.c =================================================================== --- gcc/tree-vect-stmts.c 2019-11-05 10:38:50.718047381 +0000 +++ gcc/tree-vect-stmts.c 2019-11-05 10:38:55.542013228 +0000 @@ -3317,6 +3317,19 @@ vectorizable_call (stmt_vec_info stmt_in return false; } + /* FORNOW: we don't yet support mixtures of vector sizes for calls, + just mixtures of nunits. E.g. DI->SI versions of __builtin_ctz* + are traditionally vectorized as two VnDI->VnDI IFN_CTZs followed + by a pack of the two vectors into an SI vector. We would need + separate code to handle direct VnDI->VnSI IFN_CTZs. */ + if (TYPE_SIZE (vectype_in) != TYPE_SIZE (vectype_out)) + { + if (dump_enabled_p ()) + dump_printf_loc (MSG_MISSED_OPTIMIZATION, vect_location, + "mismatched vector sizes %T and %T\n", + vectype_in, vectype_out); + return false; + } /* FORNOW */ nunits_in = TYPE_VECTOR_SUBPARTS (vectype_in);