From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1666) id 31AC43857704; Fri, 6 Oct 2023 07:07:48 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 31AC43857704 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1696576068; bh=9X3UyXdfNj+lQSExXMt/usjgTMqAeLVa5aYN5nE9KQg=; h=From:To:Subject:Date:From; b=DlQlGEb4n4YVKNcGuFusrDaqvluBvBxd4pAUUuncFpUsVfUlKosFSOl2mvV2NJhfe FgafK8r8dWclfVYDQFdFecIqllBbNCR2iXIyXIe+5FbAlgSf9Tv04RHLB0whqRDwh+ hvMx8Nniu1HyaLha1Ax93V805tkKj7wK9c0iSHLE= 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: ed3595acef0d5362e257bb2137e3e4feec0d67e3 X-Git-Newrev: 2016b3bae4f9aec33052c3e12d9ad4233a62bb6b Message-Id: <20231006070748.31AC43857704@sourceware.org> Date: Fri, 6 Oct 2023 07:07:48 +0000 (GMT) List-Id: https://gcc.gnu.org/g:2016b3bae4f9aec33052c3e12d9ad4233a62bb6b commit 2016b3bae4f9aec33052c3e12d9ad4233a62bb6b 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 a3a32aa701e..4ff8cbaec04 100644 --- a/gcc/tree-vect-slp.cc +++ b/gcc/tree-vect-slp.cc @@ -1131,7 +1131,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,