From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1666) id 3487F38582BC; Thu, 19 Oct 2023 13:29:32 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 3487F38582BC DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1697722172; bh=sRtOFGha977b1SqeqEFPTP+GGAculzaJihUa/p2NtOI=; h=From:To:Subject:Date:From; b=LIFm9UWX//tSpeDZbPtjv2q433VyO998XWBfF53Z52MesoLd2e8gOXNNU7t71c9bo xQQcH/pLYMg/8hcY2KnR0iaA5H6Mz+FoOLU8/m4kCL3AIVquzpljtkNUaTwICuF73G A58npMQjHBtDCIyRyIIhTXYeilHJrF2g+zs/wGjI= 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: d10fc552a91c2436797838102bfbcf615aadefd4 X-Git-Newrev: 881b485e01e2150757042dfff9640ee813cf31e8 Message-Id: <20231019132932.3487F38582BC@sourceware.org> Date: Thu, 19 Oct 2023 13:29:32 +0000 (GMT) List-Id: https://gcc.gnu.org/g:881b485e01e2150757042dfff9640ee813cf31e8 commit 881b485e01e2150757042dfff9640ee813cf31e8 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 4f06cb45ea28..af6a81155960 100644 --- a/gcc/tree-vect-slp.cc +++ b/gcc/tree-vect-slp.cc @@ -1185,7 +1185,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,