From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1666) id EF5F73858430; Fri, 23 Feb 2024 07:31:50 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org EF5F73858430 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1708673510; bh=RC5sPFN4s3zWNNtTz6vvErhP0thdvjFsf3L0jS3h79g=; h=From:To:Subject:Date:From; b=BIKWx8OeV9kzJqpbeKzNn/ISmvOfzMJ4I7eZ0sxE0+5WtUEmMtLGzEW7QQJxqMbML OHBHVkQK9KZp/gMgu78Pst1b28lni7sjwUO+7rF6EjrhHuQMgFJITZOie2cvQxzF/b zN0nXCEhDh9CALbjNLXo2RvXj6c23KVnMr0mUNcs= Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: Richard Biener To: gcc-cvs@gcc.gnu.org Subject: [gcc(refs/users/rguenth/heads/vect-force-slp)] Avoid SLP build failure for unsupported shifts X-Act-Checkin: gcc X-Git-Author: Richard Biener X-Git-Refname: refs/users/rguenth/heads/vect-force-slp X-Git-Oldrev: a373df9da828ad09aff6f7bab46e5330c9b299ff X-Git-Newrev: ef49bc613081e6cf821f6871930c01fc241bef15 Message-Id: <20240223073150.EF5F73858430@sourceware.org> Date: Fri, 23 Feb 2024 07:31:50 +0000 (GMT) List-Id: https://gcc.gnu.org/g:ef49bc613081e6cf821f6871930c01fc241bef15 commit ef49bc613081e6cf821f6871930c01fc241bef15 Author: Richard Biener Date: Thu Oct 5 14:07:02 2023 +0200 Avoid SLP build failure for unsupported shifts When asserting that SLP _build_ can succeed we run into the SLP shift discovery code trying to be clever doing vectorizable_shifts work and failing discovery already. That gives a false impression for now, so disable that when we do single-lane builds. * tree-vect-slp.cc (vect_build_slp_tree_1): Do not fail fatally for shifts not supported by the target when discovering a single lane. Diff: --- gcc/tree-vect-slp.cc | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/gcc/tree-vect-slp.cc b/gcc/tree-vect-slp.cc index 83ee8a7efc32..32fccba7f154 100644 --- a/gcc/tree-vect-slp.cc +++ b/gcc/tree-vect-slp.cc @@ -1209,7 +1209,13 @@ vect_build_slp_tree_1 (vec_info *vinfo, unsigned char *swap, if (!directly_supported_p (rhs_code, vectype, optab_vector)) { /* No vector/vector shift, try for a vector/scalar shift. */ - if (!directly_supported_p (rhs_code, vectype, optab_scalar)) + if (!directly_supported_p (rhs_code, vectype, optab_scalar) + /* ??? We are using this to guide operand swapping to + eventually make all shift operands the same but we + shouldn't fail in the end - that's be business of + vectorizable_shift. + Avoid spurious ICEs for single-lane discovery. */ + && group_size != 1) { if (dump_enabled_p ()) dump_printf_loc (MSG_MISSED_OPTIMIZATION, vect_location,