From 7f52eb891b738337d5cf82c7c440a5eea8c7b0c9 Mon Sep 17 00:00:00 2001 From: Richard Sandiford Date: Thu, 14 Nov 2019 15:09:24 +0000 Subject: [PATCH] Require equal type sizes for vectorised calls As explained in the comment, vectorizable_call needs more work to support mixtures of sizes. This avoids testsuite fallout for later SVE patches. 2019-11-14 Richard Sandiford gcc/ * tree-vect-stmts.c (vectorizable_call): Require the types to have the same size. From-SVN: r278239 --- gcc/ChangeLog | 5 +++++ gcc/tree-vect-stmts.c | 13 +++++++++++++ 2 files changed, 18 insertions(+) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 28baebee3b7..41c94140b1a 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2019-11-14 Richard Sandiford + + * tree-vect-stmts.c (vectorizable_call): Require the types + to have the same size. + 2019-11-14 Richard Sandiford * tree-vect-stmts.c (vectorizable_call): If an operand is diff --git a/gcc/tree-vect-stmts.c b/gcc/tree-vect-stmts.c index b7fff782277..80f59accad7 100644 --- a/gcc/tree-vect-stmts.c +++ b/gcc/tree-vect-stmts.c @@ -3309,6 +3309,19 @@ vectorizable_call (stmt_vec_info stmt_info, gimple_stmt_iterator *gsi, 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); -- 2.30.2