From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1666) id 8FA453857B8E; Mon, 16 Oct 2023 12:50:21 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 8FA453857B8E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1697460621; bh=qXJBJzbmGHxrEQnq3BNw+COW+zFfr4/C5PjZ54hQnM4=; h=From:To:Subject:Date:From; b=iyEk+n/cEtqHNf+W05iUtGLov0CRObmja2Vil5Jghbo8ejCOoX/XkUg6xb5zxzj3r ////A6QPLgZhgtoJi1RhTv0+Ht75SYEYOr7IxB3Dx5vJpgqGIiwJJrAJAt63uUOGxX 7RVjAqZLYOkq4EA8GIfCWo/lxUEAOHBKEsZvLsxI= 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: 00c421ff2e0cd8bf4f6b405e963fca4f311cdd35 X-Git-Newrev: 83c9d09888461de024bf83f47469bbb12c8f0d98 Message-Id: <20231016125021.8FA453857B8E@sourceware.org> Date: Mon, 16 Oct 2023 12:50:21 +0000 (GMT) List-Id: https://gcc.gnu.org/g:83c9d09888461de024bf83f47469bbb12c8f0d98 commit 83c9d09888461de024bf83f47469bbb12c8f0d98 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 672c84ffbf05..436efdd4807d 100644 --- a/gcc/tree-vect-slp.cc +++ b/gcc/tree-vect-slp.cc @@ -1149,7 +1149,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,