From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1666) id BE6513857721; Thu, 9 Nov 2023 13:03:43 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org BE6513857721 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1699535023; bh=BeTcCaCOCmwbVCLpiBkq2Pw/cKqPrrvchzkmlHduP+I=; h=From:To:Subject:Date:From; b=hP+Ve8/97zCvuQwNLa/mUQm1Y5vFTuMNshvb2A0cgHJZhxeZmib27n/XRSX5CZfhf AfnMY/yDkKFk6YruGZh43cRRnMMRPHLly7W+8cFthyq8fjcRxfdD0qpXnPp524tycr Cqyg9qG7jZ5b5fNjNYTt7MheLNlmPMPBNhfO6k8U= 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: 9aba2dcdcd78eb80ffdcf60a5f8c8a821d923042 X-Git-Newrev: 1a7a3d4fdb569c91be1de2aa4c6e8d58d54fcc22 Message-Id: <20231109130343.BE6513857721@sourceware.org> Date: Thu, 9 Nov 2023 13:03:43 +0000 (GMT) List-Id: https://gcc.gnu.org/g:1a7a3d4fdb569c91be1de2aa4c6e8d58d54fcc22 commit 1a7a3d4fdb569c91be1de2aa4c6e8d58d54fcc22 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 69df69ac755..15d60c14e01 100644 --- a/gcc/tree-vect-slp.cc +++ b/gcc/tree-vect-slp.cc @@ -1216,7 +1216,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,