From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1666) id 7673C3861935; Thu, 9 Nov 2023 13:03:23 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 7673C3861935 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1699535003; bh=VCJmtIP6WWe/lXB+m743CVOiEyLbghhGxTMewAAY53g=; h=From:To:Subject:Date:From; b=h0lnofOCynwMPeBW5lpejYTgkaAGxpfH8qpOafrUttwjeBBDlw8d+gKmASnvXcLuC XegCa4SoqzMIDQ88jnT/nT0kdd6wTVmvKYJPwTmoUEwTgK10UxLFVJLxqv3Rbt/k3D HvqK2NDI+a5vqUuUx/KW++StziruYsdej7TEvPXo= 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)] Do not account single-lane SLP graphs against discovery limit X-Act-Checkin: gcc X-Git-Author: Richard Biener X-Git-Refname: refs/users/rguenth/heads/vect-force-slp X-Git-Oldrev: 74ef772d49727647f66fffe866e76c7f861a1889 X-Git-Newrev: 2885097eaf348a562d5abbfdc6d006a08bba18db Message-Id: <20231109130323.7673C3861935@sourceware.org> Date: Thu, 9 Nov 2023 13:03:23 +0000 (GMT) List-Id: https://gcc.gnu.org/g:2885097eaf348a562d5abbfdc6d006a08bba18db commit 2885097eaf348a562d5abbfdc6d006a08bba18db Author: Richard Biener Date: Fri Sep 29 15:12:54 2023 +0200 Do not account single-lane SLP graphs against discovery limit The following avoids accounting single-lane SLP to the discovery limit. Even when raising it the attempt of forming multi-lane SLP can exhaust the limit before we fall back to single-lane. * tree-vect-slp.cc (vect_build_slp_tree): Only account multi-lane SLP to limit. Diff: --- gcc/tree-vect-slp.cc | 31 ++++++++++++++++++------------- 1 file changed, 18 insertions(+), 13 deletions(-) diff --git a/gcc/tree-vect-slp.cc b/gcc/tree-vect-slp.cc index 4c7ad976963..b3a2ec0ab87 100644 --- a/gcc/tree-vect-slp.cc +++ b/gcc/tree-vect-slp.cc @@ -1726,21 +1726,26 @@ vect_build_slp_tree (vec_info *vinfo, SLP_TREE_SCALAR_STMTS (res) = stmts; bst_map->put (stmts.copy (), res); - if (*limit == 0) + /* Single-lane SLP doesn't have the chance of run-away, do not account + it to the limit. */ + if (stmts.length () > 1) { - if (dump_enabled_p ()) - dump_printf_loc (MSG_NOTE, vect_location, - "SLP discovery limit exceeded\n"); - /* Mark the node invalid so we can detect those when still in use - as backedge destinations. */ - SLP_TREE_SCALAR_STMTS (res) = vNULL; - SLP_TREE_DEF_TYPE (res) = vect_uninitialized_def; - res->failed = XNEWVEC (bool, group_size); - memset (res->failed, 0, sizeof (bool) * group_size); - memset (matches, 0, sizeof (bool) * group_size); - return NULL; + if (*limit == 0) + { + if (dump_enabled_p ()) + dump_printf_loc (MSG_NOTE, vect_location, + "SLP discovery limit exceeded\n"); + /* Mark the node invalid so we can detect those when still in use + as backedge destinations. */ + SLP_TREE_SCALAR_STMTS (res) = vNULL; + SLP_TREE_DEF_TYPE (res) = vect_uninitialized_def; + res->failed = XNEWVEC (bool, group_size); + memset (res->failed, 0, sizeof (bool) * group_size); + memset (matches, 0, sizeof (bool) * group_size); + return NULL; + } + --*limit; } - --*limit; if (dump_enabled_p ()) dump_printf_loc (MSG_NOTE, vect_location,